mockoidc
mockoidc copied to clipboard
mockoidc: enable server impersonation
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.
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 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