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

feat: add debug flag for dumping OIDC tokens to output MONGOSH-1845 #2112

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

addaleax
Copy link
Contributor

@addaleax addaleax commented Jul 31, 2024

Depends on #2109, not logically but since there are a number of adjacent source locations being modified, there are quite a few conflicts otherwise, plus on mongodb-js/oidc-plugin#194 for including the IdP server info

Comment on lines 1272 to 1274
Buffer.from(part, 'base64url')
.toString('base64url')
.replace(/=+$/, '') === part
Copy link
Contributor

Choose a reason for hiding this comment

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

Trying to understand what does this condition ensure? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, added a comment here 🙂 This bit is trying to validate that the parts are base64url-encoded (required for JWTs) by decoding it from base64url and re-encoding it back, then checking whether that's equal to the original string

@addaleax addaleax marked this pull request as ready for review August 1, 2024 09:20
@addaleax addaleax merged commit 781d1c9 into main Aug 1, 2024
58 of 61 checks passed
@addaleax addaleax deleted the 1845-dev branch August 1, 2024 11:49
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