Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ParseWithStandardClaims (0.2 sec)

  1. internal/jwt/parser.go

    func (c *MapClaims) MarshalJSON() ([]byte, error) {
    	json := jsoniter.ConfigCompatibleWithStandardLibrary
    	return json.Marshal(c.MapClaims)
    }
    
    // ParseWithStandardClaims - parse the token string, valid methods.
    func ParseWithStandardClaims(tokenStr string, claims *StandardClaims, key []byte) error {
    	// Key is not provided.
    	if key == nil {
    		// keyFunc was not provided, return error.
    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. cmd/jwt_test.go

    	if err != nil {
    		b.Fatal(err)
    	}
    
    	b.ResetTimer()
    	b.ReportAllocs()
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			err = xjwt.ParseWithStandardClaims(token, xjwt.NewStandardClaims(), []byte(creds.SecretKey))
    			if err != nil {
    				b.Fatal(err)
    			}
    		}
    	})
    }
    
    func BenchmarkParseJWTMapClaims(b *testing.B) {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 19 16:45:14 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  3. internal/jwt/parser_test.go

    				}
    				err = ParseWithClaims(data.tokenString, &MapClaims{}, data.keyfunc)
    			case *StandardClaims:
    				if data.tokenString == "" {
    					data.tokenString = standardClaimsToken(claims)
    				}
    				err = ParseWithStandardClaims(data.tokenString, &StandardClaims{}, []byte("HelloSecret"))
    			}
    
    			if data.valid && err != nil {
    				t.Errorf("Error while verifying token: %T:%v", err, err)
    			}
    
    			if !data.valid && err == nil {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Nov 05 19:20:08 GMT 2021
    - 6K bytes
    - Viewed (0)
  4. cmd/storage-rest-server.go

    	if err != nil {
    		if err == jwtreq.ErrNoTokenInRequest {
    			return errNoAuthToken
    		}
    		return errMalformedAuth
    	}
    
    	claims := xjwt.NewStandardClaims()
    	if err = xjwt.ParseWithStandardClaims(token, claims, []byte(globalActiveCred.SecretKey)); err != nil {
    		return errAuthentication
    	}
    
    	owner := claims.AccessKey == globalActiveCred.AccessKey || claims.Subject == globalActiveCred.AccessKey
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 44.8K bytes
    - Viewed (0)
Back to top