- Sort Score
- Result 10 results
- Languages All
Results 1 - 3 of 3 for metricsRequestAuthenticate (0.15 sec)
-
cmd/jwt_test.go
Header: http.Header{ "Authorization": []string{"invalid-token"}, }, }, expectedErr: errAuthentication, }, } for i, testCase := range testCases { _, _, _, gotErr := metricsRequestAuthenticate(testCase.req) if testCase.expectedErr != gotErr { t.Errorf("Test %d, expected err %s, got %s", i+1, testCase.expectedErr, gotErr) } } } func BenchmarkParseJWTStandardClaims(b *testing.B) {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 22 07:04:48 UTC 2024 - 4.4K bytes - Viewed (0) -
cmd/jwt.go
} // Check if the request is authenticated. // Returns nil if the request is authenticated. errNoAuthToken if token missing. // Returns errAuthentication for all other errors. func metricsRequestAuthenticate(req *http.Request) (*xjwt.MapClaims, []string, bool, error) { token, err := jwtreq.AuthorizationHeaderExtractor.ExtractToken(req) if err != nil { if err == jwtreq.ErrNoTokenInRequest {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 22 07:04:48 UTC 2024 - 4.5K bytes - Viewed (0) -
cmd/metrics.go
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { tc, ok := r.Context().Value(mcontext.ContextTraceKey).(*mcontext.TraceCtxt) claims, groups, owner, authErr := metricsRequestAuthenticate(r) if authErr != nil || (claims != nil && !claims.VerifyIssuer("prometheus", true)) { if ok { tc.FuncName = "handler.MetricsAuth" tc.ResponseRecorder.LogErrBody = true }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Aug 15 12:04:40 UTC 2024 - 16.6K bytes - Viewed (0)