- Sort Score
- Result 10 results
- Languages All
Results 1 - 5 of 5 for NewWithClaims (0.18 sec)
-
internal/jwt/parser_test.go
} func mapClaimsToken(claims *MapClaims) string { claims.SetAccessKey("test") j := jwt.NewWithClaims(jwt.SigningMethodHS512, claims) tk, _ := j.SignedString([]byte("HelloSecret")) return tk } func standardClaimsToken(claims *StandardClaims) string { claims.AccessKey = "test" claims.Subject = "test" j := jwt.NewWithClaims(jwt.SigningMethodHS512, claims) tk, _ := j.SignedString([]byte("HelloSecret")) return tk }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri Nov 05 19:20:08 UTC 2021 - 6K bytes - Viewed (0) -
cmd/jwt.go
) func authenticateNode(accessKey, secretKey string) (string, error) { claims := xjwt.NewStandardClaims() claims.SetExpiry(UTCNow().Add(defaultInterNodeJWTExpiry)) claims.SetAccessKey(accessKey) jwt := jwtgo.NewWithClaims(jwtgo.SigningMethodHS512, claims) return jwt.SignedString([]byte(secretKey)) } // Check if the request is authenticated. // Returns nil if the request is authenticated. errNoAuthToken if token missing.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 22 07:04:48 UTC 2024 - 4.5K bytes - Viewed (0) -
internal/config/identity/openid/jwt_test.go
claimsMap.SetAccessKey("test-access") if err := updateClaimsExpiry("3600", claimsMap.MapClaims); err != nil { t.Error(err) } // Build simple token with updated expiration claim token := jwtgo.NewWithClaims(jwtgo.SigningMethodHS256, claimsMap) tokenString, err := token.SignedString(signKey) if err != nil { t.Error(err) } // Parse token to be sure it is valid
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 24 23:05:23 UTC 2024 - 8.3K bytes - Viewed (0) -
cmd/jwt_test.go
) func getTokenString(accessKey, secretKey string) (string, error) { claims := xjwt.NewMapClaims() claims.SetExpiry(UTCNow().Add(defaultJWTExpiry)) claims.SetAccessKey(accessKey) token := jwtgo.NewWithClaims(jwtgo.SigningMethodHS512, claims) return token.SignedString([]byte(secretKey)) } // Tests web request authenticator. func TestWebRequestAuthenticate(t *testing.T) {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Jul 22 07:04:48 UTC 2024 - 4.4K bytes - Viewed (0) -
internal/config/dns/operator_dns.go
return nil } claims := &jwt.StandardClaims{ ExpiresAt: int64(15 * time.Minute), Issuer: c.username, Subject: config.EnvDNSWebhook, } token := jwt.NewWithClaims(jwt.SigningMethodHS512, claims) ss, err := token.SignedString([]byte(c.password)) if err != nil { return err } r.Header.Set("Authorization", "Bearer "+ss) return nil }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Mar 06 16:56:10 UTC 2023 - 6.6K bytes - Viewed (0)