Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for NewMapClaims (0.16 sec)

  1. internal/jwt/parser.go

    	}
    
    	if c.AccessKey == "" && c.Subject == "" {
    		return jwtgo.NewValidationError("accessKey/sub missing",
    			jwtgo.ValidationErrorClaimsInvalid)
    	}
    
    	return nil
    }
    
    // NewMapClaims - Initializes a new map claims
    func NewMapClaims() *MapClaims {
    	return &MapClaims{MapClaims: jwtgo.MapClaims{}}
    }
    
    // Lookup returns the value and if the key is found.
    func (c *MapClaims) Lookup(key string) (value string, ok bool) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue May 09 07:53:08 GMT 2023
    - 13.9K bytes
    - Viewed (0)
  2. internal/auth/credentials.go

    func ExtractClaims(token, secretKey string) (*jwt.MapClaims, error) {
    	if token == "" || secretKey == "" {
    		return nil, errors.New("invalid argument")
    	}
    
    	claims := jwt.NewMapClaims()
    	stsTokenCallback := func(claims *jwt.MapClaims) ([]byte, error) {
    		return []byte(secretKey), nil
    	}
    
    	if err := jwt.ParseWithClaims(token, claims, stsTokenCallback); err != nil {
    		return nil, err
    	}
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Wed May 01 12:41:13 GMT 2024
    - 11.7K bytes
    - Viewed (0)
  3. cmd/auth-handler.go

    	if token != "" {
    		claims, err := getClaimsFromTokenWithSecret(token, secret)
    		if err != nil {
    			return nil, toAPIErrorCode(r.Context(), err)
    		}
    		return claims, ErrNone
    	}
    
    	claims := xjwt.NewMapClaims()
    	return claims.Map(), ErrNone
    }
    
    // Check request auth type verifies the incoming http request
    //   - validates the request signature
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26K bytes
    - Viewed (0)
Back to top