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

Function APIKey

coderd/httpmw/apikey.go:92–98  ·  view source on GitHub ↗

APIKey returns the API key from the ExtractAPIKey handler.

(r *http.Request)

Source from the content-addressed store, hash-verified

90
91// APIKey returns the API key from the ExtractAPIKey handler.
92func APIKey(r *http.Request) database.APIKey {
93 key, ok := APIKeyOptional(r)
94 if !ok {
95 panic("developer error: ExtractAPIKey middleware not provided")
96 }
97 return key
98}
99
100// UserAuthorizationOptional may return the roles and scope used for
101// authorization. Depends on the ExtractAPIKey handler.

Callers 15

externalAuthByIDMethod · 0.92
externalAuthCallbackMethod · 0.92
listUserExternalAuthsMethod · 0.92
postFileMethod · 0.92
userOIDCClaimsMethod · 0.92
postUserMethod · 0.92
deleteUserMethod · 0.92
userLoginTypeMethod · 0.92
putUserStatusMethod · 0.92
putUserPasswordMethod · 0.92

Calls 1

APIKeyOptionalFunction · 0.85