-
Notifications
You must be signed in to change notification settings - Fork 155
ES-2739 - Update CSRF token endpoint in eSignet API #1617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Signed-off-by: Prathmesh Jadhav <prathmesh.j@cyberpwn.com>
WalkthroughCSRF token fetching was added before test execution in MosipTestRunner; a csrfTokenEndpoint property was added; XSRFTOKEN removed from application.properties; DB cleanup SQL was hardened; and a ConsentNoCapture end-to-end test workflow (templates, YAMLs, and TestNG entries) was added. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@api-test/src/main/resources/config/application.properties`:
- Around line 82-83: Remove the hardcoded token strings in the commented
properties (keys "XSRFTOKEN" and "XSRF-TOKEN") and replace them with
non-sensitive placeholders (e.g. XSRFTOKEN=<placeholder> or a property reference
like ${XSRF_TOKEN}) so no real token appears in the repo; move actual token
values to environment variables or local override files and document the
expected env/property name for local setup.
🧹 Nitpick comments (1)
api-test/src/main/resources/esignet/OTPAuthFactorFlow/ConsentNoCapture/AuthenticateConsentNoCapture/AuthenticateConsentNoCapture.yml (1)
11-33: Inconsistent indentation in embedded JSON reduces readability.The JSON strings embedded in
inputandoutputhave inconsistent indentation:
- Lines 12-17 use 8-space indentation
- Lines 18-26 (
sendOtpblock) use 4-space indentation- Lines 29-32 (
output) use mixed 2-space and 4-space indentationWhile this doesn't affect YAML parsing (since they're quoted strings), it hampers maintainability.
🔧 Suggested fix for consistent formatting
input: '{ - "encodedHash": "$ID:OAuthDetailsRequest_NoCapture_AuthToken_Xsrf_Smoke_sid_encodedResp$", - "requestTime": "$TIMESTAMP$", - "transactionId": "$ID:OAuthDetailsRequest_NoCapture_AuthToken_Xsrf_Smoke_sid_transactionId$", - "individualId": "$ID:AddIdentity_For_OTPFlow_VerifiedClaims_smoke_Pos_UIN$", - "authFactorType" : "OTP", - "challenge" : "$ID:AddIdentity_For_OTPFlow_VerifiedClaims_smoke_Pos_EMAIL$", - "sendOtp":{ - "encodedHash": "$ID:OAuthDetailsRequest_NoCapture_AuthToken_Xsrf_Smoke_sid_encodedResp$", - "requestTime": "$TIMESTAMP$", - "transactionId": "$ID:OAuthDetailsRequest_NoCapture_AuthToken_Xsrf_Smoke_sid_transactionId$", - "individualId": "$ID:AddIdentity_For_OTPFlow_VerifiedClaims_smoke_Pos_UIN$", - "otpChannels": [{"channel": "email"},{"channel": "phone"}], - "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", - "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" - } - }' + "encodedHash": "$ID:OAuthDetailsRequest_NoCapture_AuthToken_Xsrf_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_NoCapture_AuthToken_Xsrf_Smoke_sid_transactionId$", + "individualId": "$ID:AddIdentity_For_OTPFlow_VerifiedClaims_smoke_Pos_UIN$", + "authFactorType": "OTP", + "challenge": "$ID:AddIdentity_For_OTPFlow_VerifiedClaims_smoke_Pos_EMAIL$", + "sendOtp": { + "encodedHash": "$ID:OAuthDetailsRequest_NoCapture_AuthToken_Xsrf_Smoke_sid_encodedResp$", + "requestTime": "$TIMESTAMP$", + "transactionId": "$ID:OAuthDetailsRequest_NoCapture_AuthToken_Xsrf_Smoke_sid_transactionId$", + "individualId": "$ID:AddIdentity_For_OTPFlow_VerifiedClaims_smoke_Pos_UIN$", + "otpChannels": [{"channel": "email"}, {"channel": "phone"}], + "sendOtpReqTemplate": "esignet/SendOtp/SendOtp", + "sendOtpEndPoint": "/v1/esignet/authorization/send-otp" + } + }' output: '{ - "consentAction": "NOCAPTURE", - "sendOtpResp":{ - "sendOtpResTemplate":"esignet/SendOtp/SendOtpResult" - } -}' + "consentAction": "NOCAPTURE", + "sendOtpResp": { + "sendOtpResTemplate": "esignet/SendOtp/SendOtpResult" + } + }'
Signed-off-by: Prathmesh Jadhav <prathmesh.j@cyberpwn.com>
Signed-off-by: Prathmesh Jadhav <prathmesh.j@cyberpwn.com>
...uthFactorFlow/ConsentNoCapture/AuthenticateConsentNoCapture/AuthenticateConsentNoCapture.yml
Show resolved
Hide resolved
...uthFactorFlow/ConsentNoCapture/AuthenticateConsentNoCapture/AuthenticateConsentNoCapture.yml
Show resolved
Hide resolved
...net/OTPAuthFactorFlow/ConsentNoCapture/GenTokenConsentNoCapture/GenTokenConsentNoCapture.yml
Show resolved
Hide resolved
| uniqueIdentifier: TC_ESignet_UserInfoConsentNoCapture_01 | ||
| description: Get OIDC user info with Verified Claims | ||
| role: resident | ||
| restMethod: get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CheckErrorsOnlyInResponse should be used
Summary by CodeRabbit
New Features
Tests
Chores
✏️ Tip: You can customize this high-level summary in your review settings.