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

chore(oidc): add docker compose configuration that uses mock oidc provider #23

Merged
merged 4 commits into from
Dec 4, 2023

Conversation

gribnoysup
Copy link
Contributor

It is kinda hacky, but it works even on macos where we can't use host network and allows easier control over oidc provider response for testing purposes (it's the same as we use in e2e tests)

// to localhost. To make sure that all responses returned by mock provider are
// matching the proxy address that is exposed outside, we override instance
// issuer property after we start the mock provider.
provider.issuer = `http://localhost:${proxyPort}`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is probably an easier way to achieve this, but this seems to work just fine

Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

lgtm! Haven't given it a try but looks good, nice comment on the mac hack.
Left one comment/suggestion on port number.

```sh
mongosh \
--host localhost \
--port 27017 \
Copy link
Member

Choose a reason for hiding this comment

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

How do you feel about using a different port than the default? That way it won't conflict with other testing environments we have. Maybe 27096?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense (and your other comment too), let me update that!

Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

Should we add this to the scripts/ps-all.sh, scripts/start-all.sh, and scripts/stop-all.sh?

@gribnoysup
Copy link
Contributor Author

gribnoysup commented Dec 4, 2023

Updated. Also added export for this env to the default package export as this one doesn't require any special setup compared to the one using external oidc provider

@gribnoysup gribnoysup merged commit 0799920 into main Dec 4, 2023
1 check passed
@Anemy Anemy deleted the oidc-mock-provider-docker branch December 4, 2023 15:16
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