Interface FederatedCredentialRepository

All Known Implementing Classes:
JdbcFederatedCredentialRepository

public interface FederatedCredentialRepository
Repository for persisting and retrieving FederatedCredential records.
  • Method Details

    • findByIssuerAndSubject

      Optional<FederatedCredential> findByIssuerAndSubject(String issuer, String subject)
      Finds a credential by its issuer and subject claims.
      Parameters:
      issuer - the issuer
      subject - the subject at that issuer
      Returns:
      the credential, or empty if not found
    • findById

      default Optional<FederatedCredential> findById(UUID id)
      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

      List<FederatedCredential> findAllByIdentityId(UUID identityId)
      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

      void deleteById(UUID id)
      Deletes the credential with the given id.
      Parameters:
      id - the credential UUID