discoveryHandler mocks the provider discovery endpoint with a mock response. Makes a JSON document available at the path formed by concatenating the string .well-known/openid-configuration to the Issuer.
(w http.ResponseWriter, r *http.Request)
| 210 | // Makes a JSON document available at the path formed by concatenating the string |
| 211 | // /.well-known/openid-configuration to the Issuer. |
| 212 | func (s *mockAuthServer) discoveryHandler(w http.ResponseWriter, r *http.Request) { |
| 213 | if s.options.forceError.errorType == discoveryErr { |
| 214 | w.WriteHeader(http.StatusInternalServerError) |
| 215 | return |
| 216 | } |
| 217 | issuer := s.options.issuer |
| 218 | metadata := auth.ProviderMetadata{ |
| 219 | Issuer: issuer, |
| 220 | TokenEndpoint: issuer + "/token", |
| 221 | JwksUri: issuer + "/keys", |
| 222 | AuthorizationEndpoint: issuer + "/auth", |
| 223 | IdTokenSigningAlgValuesSupported: []string{"RS256"}, |
| 224 | TokenEndpointAuthMethodsSupported: []string{ |
| 225 | "client_secret_basic", |
| 226 | "client_secret_post", |
| 227 | "client_secret_jwt", |
| 228 | "private_key_jwt", |
| 229 | "none", |
| 230 | }, |
| 231 | } |
| 232 | renderJSON(w, r, http.StatusOK, metadata) |
| 233 | } |
| 234 | |
| 235 | // renderJSON renders the response data as "application/json" with the status code. |
| 236 | // It may report status 500 Internal Server Error if there is any failure in converting the |
nothing calls this directly
no test coverage detected