Table of Contents

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
object
StartChallengeCommandHandler
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

challengeRepository IDocVerificationChallengeRepository
userRepository IUserRepository
householdRepository IHouseholdRepository
socureClient ISocureClient
socureSettings SocureSettings
idProofingEligibilitySettings IOptions<IdProofingEligibilitySettings>
validator IValidator<StartChallengeCommand>
logger ILogger<StartChallengeCommandHandler>

Methods

Handle(StartChallengeCommand, CancellationToken)

public Task<Result<StartChallengeResponse>> Handle(StartChallengeCommand command, CancellationToken cancellationToken = default)

Parameters

command StartChallengeCommand
cancellationToken CancellationToken

Returns

Task<Result<StartChallengeResponse>>