Skip to content
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

refactor: bad sgid session returns 400 instead of 500 #2249

Merged

Conversation

KishenKumarrrrr
Copy link
Contributor

Problem

Since Feb 8 2024, the POST /login/sgid endpoint is called twice whenever a user attempts to log in via a GSIB device. One of the API calls is made without req.session.sgid set and thus fails in the BE and results in a HTTP 500 being returned.

However, this HTTP 500 does not affect the user's ability to log in and is not reflected in the network tab of the developer console as well. Thus, the impact of this issue is low. Instead of returning a HTTP 500, we are choosing to downgrade the error to a HTTP 400 instead to reflect the seriousness of the issue.

Our current hypothesis is that this second call is made by SIS instead of our FE due to *.postman.gov.sg being whitelisted on SGProxy but the SGID URL having to go through SIS. The emergence of this issue also nicely corresponds to the date we whitelisted *.postman.gov.sg which lends credence to the hypothesis.

@KishenKumarrrrr KishenKumarrrrr self-assigned this Feb 23, 2024
Copy link
Member

@jia1 jia1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Have we checked in with sgID, or is this not worth pursuing?

@KishenKumarrrrr
Copy link
Contributor Author

Thanks!

Have we checked in with sgID, or is this not worth pursuing?

I think it is more likely a result of the jumping between SIS and the machine itself. This only happens on GSIB so likely not a SGID issue. Since this doesn't impact the user's ability to log in, probably not worth pursuing.

@KishenKumarrrrr KishenKumarrrrr merged commit 12cc5c6 into master Feb 23, 2024
32 of 33 checks passed
@KishenKumarrrrr KishenKumarrrrr deleted the refactor/return-http-400-for-sgid-bad-session branch February 23, 2024 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants