MX-237: Create Password Reset Endpot for Self Service Plugin - #137
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis pull request introduces a forgot password functionality to the self-service plugin. It adds API endpoints for password reset requests and renewal, includes service layer implementation with username validation and authorization token generation, routes tokens via email or SMS, and configures security rules to permit unauthenticated access to these endpoints. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant SelfForgotPasswordApiResource
participant SelfServiceForgotPasswordWritePlatformServiceImpl
participant Repository as SelfServiceRegistrationRepository
participant EmailService as GmailBackedPlatformEmailService
participant SmsService as SmsMessageScheduledJobService
Client->>SelfForgotPasswordApiResource: POST /v1/self/password/request
SelfForgotPasswordApiResource->>SelfServiceForgotPasswordWritePlatformServiceImpl: createForgotPasswordRequest(jsonBody)
SelfServiceForgotPasswordWritePlatformServiceImpl->>SelfServiceForgotPasswordWritePlatformServiceImpl: Validate parameters & username
SelfServiceForgotPasswordWritePlatformServiceImpl->>SelfServiceForgotPasswordWritePlatformServiceImpl: Generate 4-digit token
SelfServiceForgotPasswordWritePlatformServiceImpl->>Repository: saveAndFlush(SelfServiceRegistration)
Repository-->>SelfServiceForgotPasswordWritePlatformServiceImpl: persisted record
alt Email Authentication
SelfServiceForgotPasswordWritePlatformServiceImpl->>EmailService: sendDefinedDomainObject(EmailDetail)
EmailService-->>Client: Email with token
else SMS Authentication
SelfServiceForgotPasswordWritePlatformServiceImpl->>SmsService: sendMessage(SmsMessage)
SmsService-->>Client: SMS with token
end
SelfServiceForgotPasswordWritePlatformServiceImpl-->>SelfForgotPasswordApiResource: SelfServiceRegistration
SelfForgotPasswordApiResource-->>Client: Success message
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
MX-237: Create Password Reset Endpot for Self Service Plugin
Summary by CodeRabbit