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

Function UserAuthorization

coderd/httpmw/apikey.go:108–114  ·  view source on GitHub ↗

UserAuthorization returns the roles and scope used for authorization. Depends on the ExtractAPIKey handler.

(ctx context.Context)

Source from the content-addressed store, hash-verified

106// UserAuthorization returns the roles and scope used for authorization. Depends
107// on the ExtractAPIKey handler.
108func UserAuthorization(ctx context.Context) rbac.Subject {
109 auth, ok := UserAuthorizationOptional(ctx)
110 if !ok {
111 panic("developer error: ExtractAPIKey middleware not provided")
112 }
113 return auth
114}
115
116// OAuth2Configs is a collection of configurations for OAuth-based authentication.
117// This should be extended to support other authentication types in the future.

Callers 12

deleteUserMethod · 0.92
postChatsMethod · 0.92
AuthorizeFilterFunction · 0.92
AuthorizeMethod · 0.92
AuthorizeSQLFilterMethod · 0.92
checkAuthorizationMethod · 0.92
AssignableSiteRolesMethod · 0.92
assignableOrgRolesMethod · 0.92
TestAPIKeyFunction · 0.92
TestExtractUserRolesFunction · 0.92
ShowAuthorizePageFunction · 0.92
authorizeMethod · 0.92

Calls 1

Tested by 2

TestAPIKeyFunction · 0.74
TestExtractUserRolesFunction · 0.74