Package org.springframework.security.web.webauthn.management

# Class MapUserCredentialRepository

java.lang.Object
org.springframework.security.web.webauthn.management.MapUserCredentialRepository

All Implemented Interfaces:
  `UserCredentialRepository`

public class MapUserCredentialRepository extends Object implements UserCredentialRepository
A `Map` based implementation of `UserCredentialRepository`.

Since:
  6.4

## Constructor Summary

Constructors
Constructor
Description
`MapUserCredentialRepository()`

## Method Summary

Modifier and Type
Method
Description
`void`
`delete(Bytes credentialId)`
Deletes an entry by credential id
`CredentialRecord`
`findByCredentialId(Bytes credentialId)`
Finds an entry by credential id.
`List<CredentialRecord>`
`findByUserId(Bytes userId)`
Finds all `CredentialRecord` instances for a specific user.
`void`
`save(CredentialRecord credentialRecord)`
Saves a `CredentialRecord`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### MapUserCredentialRepository

public MapUserCredentialRepository()

## Method Details

### delete

public void delete(Bytes credentialId)
Description copied from interface: `UserCredentialRepository`
Deletes an entry by credential id

Specified by:
  `delete` in interface `UserCredentialRepository`
Parameters:
  `credentialId` - `CredentialRecord.getCredentialId()`

### save

public void save(CredentialRecord credentialRecord)
Description copied from interface: `UserCredentialRepository`
Saves a `CredentialRecord`

Specified by:
  `save` in interface `UserCredentialRepository`
Parameters:
  `credentialRecord` - the `CredentialRecord` to save.

### findByCredentialId

public CredentialRecord findByCredentialId(Bytes credentialId)
Description copied from interface: `UserCredentialRepository`
Finds an entry by credential id.

Specified by:
  `findByCredentialId` in interface `UserCredentialRepository`
Parameters:
  `credentialId` - `CredentialRecord.getCredentialId()`
Returns:
  the `CredentialRecord` or null if not found.

### findByUserId

public List<CredentialRecord> findByUserId(Bytes userId)
Description copied from interface: `UserCredentialRepository`
Finds all `CredentialRecord` instances for a specific user.

Specified by:
  `findByUserId` in interface `UserCredentialRepository`
Parameters:
  `userId` - the `PublicKeyCredentialUserEntity.getId()` to search for a user.
Returns:
  all `CredentialRecord` instances for a specific user or empty if no results found. Never null.
See Also:
  - `PublicKeyCredentialUserEntityRepository`