Skip to content

Conversation

@addaleax
Copy link
Collaborator

@addaleax addaleax commented Nov 5, 2025

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

… 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.
@addaleax addaleax requested a review from paula-stacho November 5, 2025 02:35
@addaleax addaleax changed the title feat(oidc-mock-provider,mongodb-runner): make OIDC mocks more broadlyusable COMPASS-10034 feat(oidc-mock-provider,mongodb-runner): make OIDC mocks more broadly usable COMPASS-10034 Nov 5, 2025
@paula-stacho
Copy link
Collaborator

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.',
Copy link
Collaborator

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) {
Copy link
Collaborator

@paula-stacho paula-stacho Nov 7, 2025

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?

Copy link
Collaborator Author

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!

@addaleax addaleax requested a review from paula-stacho November 7, 2025 15:23
@addaleax addaleax merged commit 8a9d630 into main Nov 7, 2025
33 checks passed
@addaleax addaleax deleted the 10034-dev branch November 7, 2025 15:57
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.

3 participants