Class StartChallengeCommandHandler
- Namespace
- SEBT.Portal.UseCases.IdProofing
- Assembly
- SEBT.Portal.UseCases.dll
Handles starting a document verification challenge. Loads the challenge by (publicId, userId) for IDOR prevention, validates the state transition (must be Created → Pending), calls Socure to generate a DocV session token, and updates the challenge.
public class StartChallengeCommandHandler : ICommandHandler<StartChallengeCommand, StartChallengeResponse>
- Inheritance
-
objectStartChallengeCommandHandler
- Implements
Constructors
StartChallengeCommandHandler(IDocVerificationChallengeRepository, IUserRepository, IHouseholdRepository, ISocureClient, SocureSettings, IOptions<IdProofingEligibilitySettings>, IValidator<StartChallengeCommand>, ILogger<StartChallengeCommandHandler>)
Handles starting a document verification challenge. Loads the challenge by (publicId, userId) for IDOR prevention, validates the state transition (must be Created → Pending), calls Socure to generate a DocV session token, and updates the challenge.
public StartChallengeCommandHandler(IDocVerificationChallengeRepository challengeRepository, IUserRepository userRepository, IHouseholdRepository householdRepository, ISocureClient socureClient, SocureSettings socureSettings, IOptions<IdProofingEligibilitySettings> idProofingEligibilitySettings, IValidator<StartChallengeCommand> validator, ILogger<StartChallengeCommandHandler> logger)
Parameters
challengeRepositoryIDocVerificationChallengeRepositoryuserRepositoryIUserRepositoryhouseholdRepositoryIHouseholdRepositorysocureClientISocureClientsocureSettingsSocureSettingsidProofingEligibilitySettingsIOptions<IdProofingEligibilitySettings>validatorIValidator<StartChallengeCommand>loggerILogger<StartChallengeCommandHandler>
Methods
Handle(StartChallengeCommand, CancellationToken)
public Task<Result<StartChallengeResponse>> Handle(StartChallengeCommand command, CancellationToken cancellationToken = default)
Parameters
commandStartChallengeCommandcancellationTokenCancellationToken
Returns
- Task<Result<StartChallengeResponse>>