UserAuthorization returns the roles and scope used for authorization. Depends on the ExtractAPIKey handler.
(ctx context.Context)
| 106 | // UserAuthorization returns the roles and scope used for authorization. Depends |
| 107 | // on the ExtractAPIKey handler. |
| 108 | func 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. |