Class PasswordPolicyServiceImpl

java.lang.Object
io.gravitee.am.service.impl.PasswordPolicyServiceImpl
All Implemented Interfaces:
PasswordPolicyService

@Component public class PasswordPolicyServiceImpl extends Object implements PasswordPolicyService
Author:
Eric LELEU (eric.leleu at graviteesource.com), Rafal PODLES (rafal.podles at graviteesource.com), GraviteeSource Team
  • Constructor Details

    • PasswordPolicyServiceImpl

      public PasswordPolicyServiceImpl()
  • Method Details

    • findByDomain

      public io.reactivex.rxjava3.core.Flowable<PasswordPolicy> findByDomain(String domain)
      Description copied from interface: PasswordPolicyService
      Get all password policies by domain
      Specified by:
      findByDomain in interface PasswordPolicyService
      Parameters:
      domain - the domain
      Returns:
      list of PasswordPolicy
    • create

      public io.reactivex.rxjava3.core.Single<PasswordPolicy> create(PasswordPolicy policy, User principal)
      Description copied from interface: PasswordPolicyService
      Create a new password policy linked to the reference entity (domain for example)
      Specified by:
      create in interface PasswordPolicyService
      Parameters:
      policy - the new password policy
      principal - the user performing the action
      Returns:
      PasswordPolicy
    • findByReferenceAndId

      public io.reactivex.rxjava3.core.Maybe<PasswordPolicy> findByReferenceAndId(ReferenceType referenceType, String referenceId, String policyId)
      Description copied from interface: PasswordPolicyService
      Retrieve a password policy by its reference type, reference ID, and policy ID.
      Specified by:
      findByReferenceAndId in interface PasswordPolicyService
      Parameters:
      referenceType - the type of reference (e.g., DOMAIN)
      referenceId - the identifier of the reference
      policyId - the ID of the password policy to retrieve
      Returns:
      a Maybe emitting the retrieved PasswordPolicy, if found; otherwise, completes
    • update

      public io.reactivex.rxjava3.core.Single<PasswordPolicy> update(ReferenceType referenceType, String referenceId, String policyId, UpdatePasswordPolicy policy, User principal)
      Description copied from interface: PasswordPolicyService
      Update a password policy linked to the reference entity (domain for example)
      Specified by:
      update in interface PasswordPolicyService
      Parameters:
      referenceType - the type of reference
      referenceId - the identifier of the reference
      policyId - the policy id to update
      policy - the new policy settings
      principal - the user
      Returns:
      Password Policy
    • deleteAndUpdateIdp

      public io.reactivex.rxjava3.core.Completable deleteAndUpdateIdp(ReferenceType referenceType, String referenceId, String policyId, User principal)
      Description copied from interface: PasswordPolicyService
      Delete the password policy and reset the policyId for each IDP linked to it
      Specified by:
      deleteAndUpdateIdp in interface PasswordPolicyService
      Parameters:
      referenceType - the type of reference (e.g., DOMAIN)
      referenceId - the identifier of the reference
      policyId - the ID of the password policy to set as default
      principal - the principal user performing the operation
      Returns:
      a Completable
    • setDefaultPasswordPolicy

      public io.reactivex.rxjava3.core.Single<PasswordPolicy> setDefaultPasswordPolicy(ReferenceType referenceType, String referenceId, String policyId, User principal)
      Description copied from interface: PasswordPolicyService
      Set a password policy as the default policy for a reference entity (e.g., domain).
      Specified by:
      setDefaultPasswordPolicy in interface PasswordPolicyService
      Parameters:
      referenceType - the type of reference (e.g., DOMAIN)
      referenceId - the identifier of the reference
      policyId - the ID of the password policy to set as default
      principal - the principal user performing the operation
      Returns:
      a Single emitting the updated PasswordPolicy that has been set as default
    • deleteByReference

      public io.reactivex.rxjava3.core.Completable deleteByReference(ReferenceType referenceType, String referenceId)
      Description copied from interface: PasswordPolicyService
      Delete password policies by the reference
      Specified by:
      deleteByReference in interface PasswordPolicyService
      Parameters:
      referenceType - the type of reference (e.g., DOMAIN)
      referenceId - the identifier of the reference
      Returns:
      a Completable
    • retrievePasswordPolicy

      public io.reactivex.rxjava3.core.Maybe<PasswordPolicy> retrievePasswordPolicy(User user, PasswordSettingsAware passwordSettingsAware, IdentityProvider provider)
      Description copied from interface: PasswordPolicyService
      Retrieve the password policy associated with a user, based on the user's password settings awareness.
      Specified by:
      retrievePasswordPolicy in interface PasswordPolicyService
      Parameters:
      user - the user for whom to retrieve the password policy
      passwordSettingsAware - the object that is aware of the password settings
      provider - the identity provider
      Returns:
      a Maybe emitting the retrieved PasswordPolicy, if found; otherwise, completes