APIKey returns the API key from the ExtractAPIKey handler.
(r *http.Request)
| 90 | |
| 91 | // APIKey returns the API key from the ExtractAPIKey handler. |
| 92 | func 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. |