Class LockSignInMethodsUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.social.LockSignInMethodsUseCase

@Service @Transactional(propagation=MANDATORY) public class LockSignInMethodsUseCase extends Object
Use case that locks the sign-in methods of an account for the rest of the caller's transaction and counts them: a password its owner knows (not a generated one), the linked identities, a passkey and the bound certificates. Every use case that removes a sign-in method starts with it, so two concurrent removals of the same account are serialized and the second one counts what the first left. It only runs inside the caller's transaction, which holds the lock.
  • Field Details

    • signInMethodsLock

      private final SignInMethodsLock signInMethodsLock
      Port that serializes the removals of an account.
    • federatedIdentityRepository

      private final FederatedIdentityRepository federatedIdentityRepository
      Port that stores the links.
    • generatedPasswordRepository

      private final GeneratedPasswordRepository generatedPasswordRepository
      Port that remembers the accounts that only hold a generated password.
    • passkeyRepository

      private final PasskeyRepository passkeyRepository
      Port that reads the passkeys.
    • certificateBindingRepository

      private final CertificateBindingRepository certificateBindingRepository
      Port that reads the bound certificates.
  • Constructor Details

    • LockSignInMethodsUseCase

      public LockSignInMethodsUseCase()
  • Method Details

    • execute

      public SignInMethods execute(UUID userId)
      Locks the sign-in methods of an account and counts them.
      Parameters:
      userId - identifier of the account.
      Returns:
      the ways the account can sign in now, counted once the lock is held.