Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for NewWithClaims (0.07 sec)

  1. 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 Sep 07 19:28:11 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 4.5K bytes
    - Viewed (0)
  2. 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) {
    	ctx, cancel := context.WithCancel(t.Context())
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 4.4K bytes
    - Viewed (0)
  3. cmd/server_test.go

    	s.testServer.Stop()
    }
    
    const (
    	defaultPrometheusJWTExpiry = 100 * 365 * 24 * time.Hour
    )
    
    func (s *TestSuiteCommon) TestMetricsV3Handler(c *check) {
    	jwt := jwtgo.NewWithClaims(jwtgo.SigningMethodHS512, jwtgo.StandardClaims{
    		ExpiresAt: time.Now().UTC().Add(defaultPrometheusJWTExpiry).Unix(),
    		Subject:   s.accessKey,
    		Issuer:    "prometheus",
    	})
    
    Registered: Sun Sep 07 19:28:11 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 118.1K bytes
    - Viewed (0)
Back to top