Interface FederatedCredentialRepository
- All Known Implementing Classes:
JdbcFederatedCredentialRepository
public interface FederatedCredentialRepository
Repository for persisting and retrieving
FederatedCredential records.-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteById(UUID id) Deletes the credential with the given id.findAllByIdentityId(UUID identityId) Finds every federated credential linked to the identity, oldest first: by id, which is UUIDv7, so the earliest created comes first.default Optional<FederatedCredential> Finds a credential by its id, so that unlinking it can report its issuer.findByIssuerAndSubject(String issuer, String subject) Finds a credential by its issuer and subject claims.save(FederatedCredential credential) Persists a credential.
-
Method Details
-
findByIssuerAndSubject
Finds a credential by its issuer and subject claims.- Parameters:
issuer- the issuersubject- the subject at that issuer- Returns:
- the credential, or empty if not found
-
findById
Finds a credential by its id, so that unlinking it can report its issuer. A repository that cannot find by id keeps this default, and unlinks it serves report no issuer.- Parameters:
id- the credential UUID- Returns:
- the matching credential, or empty if not found
-
findAllByIdentityId
Finds every federated credential linked to the identity, oldest first: by id, which is UUIDv7, so the earliest created comes first.- Parameters:
identityId- the identity- Returns:
- its federated credentials, possibly none
-
save
Persists a credential. If a record with the same id already exists it is left unchanged (federated credentials are immutable — issuer and subject never change after creation).- Parameters:
credential- the credential to save- Returns:
- the saved credential
-
deleteById
Deletes the credential with the given id.- Parameters:
id- the credential UUID
-