Skip to content

mockoidc: enable server impersonation #36

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

raggi
Copy link

@raggi raggi commented May 26, 2022

By customizing EndpointConfig, the mock server can now impersonate many other OIDC servers, which can then be used with a MITM-ing http.RoundTripper to execute tests against otherwise unaltered client code.

By customizing EndpointConfig, the mock server can now impersonate many
other OIDC servers, which can then be used with a MITM-ing
http.RoundTripper to execute tests against unaltered client code.
@raggi
Copy link
Author

raggi commented May 26, 2022

I'm happy to add additional test coverage, or provide examples of usage as you might like, but I wanted to send an in-principle patch first for feedback.

@lanwen
Copy link

lanwen commented Sep 6, 2022

@raggi Would you be so kind to provide a usage example? Seems that doing

endpoints := mockoidc.EndpointConfig{
		IssuerBase:    "/",
		TokenEndpoint: "/oauth/token",
	}
	endpoints.Defaults()
	m.EndpointConfig = endpoints

doesn't really work, as well as not really convenient, as you can't inline it. Thank you

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants