APIKeyOptional may return an API key from the ExtractAPIKey handler.
(r *http.Request)
| 84 | |
| 85 | // APIKeyOptional may return an API key from the ExtractAPIKey handler. |
| 86 | func APIKeyOptional(r *http.Request) (database.APIKey, bool) { |
| 87 | key, ok := r.Context().Value(apiKeyContextKey{}).(database.APIKey) |
| 88 | return key, ok |
| 89 | } |
| 90 | |
| 91 | // APIKey returns the API key from the ExtractAPIKey handler. |
| 92 | func APIKey(r *http.Request) database.APIKey { |