-
Notifications
You must be signed in to change notification settings - Fork 9
feat(oidc-mock-provider,mongodb-runner): make OIDC mocks more broadly usable COMPASS-10034 #589
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
Conversation
… usable COMPASS-10034 Internal TSEs have requested making oidc-mock-provider available for internal testing with OIDC. While it cannot replicate every aspect of real-world identity providers, it is an easily spun up local equivalent of those, and provides flexibility that those real-world identity providers lack in terms of configurability. This change widens the array of CLI options provided for the oidc-mock-provider CLI, and integrates it into mongodb-runner so that the latter can spin up a joint OIDC-IdP-and-mongod-cluster environment on Linux, if that is desired.
|
Still going through the code, just want to say it works like a charm and it's easy to use! 🎉 Thank you so much! |
| .option('port', { | ||
| alias: 'p', | ||
| type: 'string', | ||
| desc: 'Port to run the server on. Setting to 0 auto-assigns to a random port.', |
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.
TIL
| const audience = sampleTokenConfig.payload.aud; | ||
| const provider = await OIDCMockProvider.create({ | ||
| ...config, | ||
| overrideRequestHandler(url, req, res) { |
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.
won't this override the log-requests from cli?
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.
Yeah, good point, we should be calling the original overrideRequestHandler() – fixed!
Internal TSEs have requested making oidc-mock-provider available for internal testing with OIDC. While it cannot replicate every aspect of real-world identity providers, it is an easily spun up local equivalent of those, and provides flexibility that those real-world identity providers lack in terms of configurability.
This change widens the array of CLI options provided for the oidc-mock-provider CLI, and integrates it into mongodb-runner so that the latter can spin up a joint OIDC-IdP-and-mongod-cluster environment on Linux, if that is desired.
Description
Open Questions
Checklist