Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for KeyFunc (0.06 sec)

  1. internal/jwt/parser_test.go

    	errorKeyFunc   = func(claim *MapClaims) ([]byte, error) { return nil, fmt.Errorf("error loading key") }
    )
    
    var jwtTestData = []struct {
    	name        string
    	tokenString string
    	keyfunc     func(*MapClaims) ([]byte, error)
    	claims      jwt.Claims
    	valid       bool
    	errors      int32
    }{
    	{
    		"basic",
    		"",
    		defaultKeyFunc,
    		&MapClaims{
    			MapClaims: jwt.MapClaims{
    				"foo": "bar",
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Nov 05 19:20:08 UTC 2021
    - 6K bytes
    - Viewed (0)
  2. internal/jwt/parser.go

    func ParseWithClaims(tokenStr string, claims *MapClaims, fn func(*MapClaims) ([]byte, error)) error {
    	// Key lookup function has to be provided.
    	if fn == nil {
    		// keyFunc was not provided, return error.
    		return jwtgo.NewValidationError("no Keyfunc was provided.", jwtgo.ValidationErrorUnverifiable)
    	}
    
    	bufp := base64BufPool.Get().(*[]byte)
    	defer base64BufPool.Put(bufp)
    
    	tokenBuf := base64BufPool.Get().(*[]byte)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Sep 17 16:45:46 UTC 2024
    - 14.1K bytes
    - Viewed (0)
Back to top