requireAuthentication checks incoming requests for tokens presented using the Authorization header
(w http.ResponseWriter, r *http.Request)
| 10 | |
| 11 | // requireAuthentication checks incoming requests for tokens presented using the Authorization header |
| 12 | func (a *API) requireAuthentication(w http.ResponseWriter, r *http.Request) (context.Context, error) { |
| 13 | token, err := a.extractBearerToken(w, r) |
| 14 | if err != nil { |
| 15 | a.clearCookieToken(r.Context(), w) |
| 16 | return nil, err |
| 17 | } |
| 18 | |
| 19 | return a.parseJWTClaims(token, r, w) |
| 20 | } |
| 21 | |
| 22 | type adminCheckParams struct { |
| 23 | Aud string `json:"aud"` |
nothing calls this directly
no test coverage detected