MCPcopy Index your code
hub / github.com/coder/coder / GetProtectedResourceMetadata

Function GetProtectedResourceMetadata

coderd/oauth2provider/metadata.go:33–45  ·  view source on GitHub ↗

GetProtectedResourceMetadata returns an http.HandlerFunc that handles GET /.well-known/oauth-protected-resource

(accessURL *url.URL)

Source from the content-addressed store, hash-verified

31
32// GetProtectedResourceMetadata returns an http.HandlerFunc that handles GET /.well-known/oauth-protected-resource
33func GetProtectedResourceMetadata(accessURL *url.URL) http.HandlerFunc {
34 return func(rw http.ResponseWriter, r *http.Request) {
35 ctx := r.Context()
36 metadata := codersdk.OAuth2ProtectedResourceMetadata{
37 Resource: accessURL.String(),
38 AuthorizationServers: []string{accessURL.String()},
39 ScopesSupported: rbac.ExternalScopeNames(),
40 // RFC 6750 Bearer Token methods supported as fallback methods in api key middleware
41 BearerMethodsSupported: []string{"header", "query"},
42 }
43 httpapi.Write(ctx, rw, http.StatusOK, metadata)
44 }
45}

Callers 1

Calls 4

ExternalScopeNamesFunction · 0.92
WriteFunction · 0.92
ContextMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected