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

Function UserAuthorizationOptional

coderd/httpmw/apikey.go:102–104  ·  view source on GitHub ↗

UserAuthorizationOptional may return the roles and scope used for authorization. Depends on the ExtractAPIKey handler.

(ctx context.Context)

Source from the content-addressed store, hash-verified

100// UserAuthorizationOptional may return the roles and scope used for
101// authorization. Depends on the ExtractAPIKey handler.
102func UserAuthorizationOptional(ctx context.Context) (rbac.Subject, bool) {
103 return dbauthz.ActorFromContext(ctx)
104}
105
106// UserAuthorization returns the roles and scope used for authorization. Depends
107// on the ExtractAPIKey handler.

Callers 3

TestAPIKeyFunction · 0.92
RateLimitFunction · 0.85
UserAuthorizationFunction · 0.85

Calls 1

ActorFromContextFunction · 0.92

Tested by 1

TestAPIKeyFunction · 0.74