mockoidc icon indicating copy to clipboard operation
mockoidc copied to clipboard

mockoidc: enable server impersonation

Open raggi opened this issue 3 years ago • 2 comments

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.

raggi avatar May 26 '22 00:05 raggi

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.

raggi avatar May 26 '22 00:05 raggi

@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

lanwen avatar Sep 06 '22 10:09 lanwen