Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for metricsRequestAuthenticate (0.21 sec)

  1. 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 Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Apr 19 16:45:14 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  2. 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 Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 5.4K bytes
    - Viewed (0)
Back to top