-
Notifications
You must be signed in to change notification settings - Fork 64
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
[VI-252] MAP SecurityToken duration validation #19635
Conversation
5baf574
to
0f749ed
Compare
@@ -66,6 +66,10 @@ def client_assertion_patient_id_type | |||
'icn' | |||
end | |||
|
|||
def max_token_duration | |||
900 |
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.
could we make this 900.seconds
? just so it's clear
lib/map/security_token/service.rb
Outdated
rescue Errors::InvalidTokenDurationError => e | ||
raise e |
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.
I dont think you need to rescue and re-raise here. This should get rescued in the token
method
lib/map/security_token/service.rb
Outdated
if response_body['expires_in'].to_i > config.max_token_duration | ||
raise Errors::InvalidTokenDurationError, | ||
"#{config.logging_prefix} token failed, token duration exceeds maximum" | ||
end |
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.
should we move this check to a separate method? I think it would make it a bit easier to read
0f749ed
to
927c0e8
Compare
Scope has changed enough that I'm closing this ticket and opening a different PR here: #19907 |
Summary
900
seconds are considered invalid and will result in a502 bad gateway
error if requested through the MAP services controller.Related issue(s)
Testing done
locahost:3000/v0/map_services/chatbot/token
- you should receive a 200 response & a tokenvets-api-mockdata/map/secure_token_service/token.yml
expires_in
value to greater than 900 & re-request the token - you should receive a 502 Bad Gateway errorScreenshots
What areas of the site does it impact?
MAP STS requests
Acceptance criteria
Requested Feedback
(OPTIONAL)What should the reviewers know in addition to the above. Is there anything specific you wish the reviewer to assist with. Do you have any concerns with this PR, why?