Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for SetAudience (0.3 sec)

  1. cmd/jwt.go

    func authenticateNode(accessKey, secretKey, audience string) (string, error) {
    	claims := xjwt.NewStandardClaims()
    	claims.SetExpiry(UTCNow().Add(defaultInterNodeJWTExpiry))
    	claims.SetAccessKey(accessKey)
    	claims.SetAudience(audience)
    
    	jwt := jwtgo.NewWithClaims(jwtgo.SigningMethodHS512, claims)
    	return jwt.SignedString([]byte(secretKey))
    }
    
    // Check if the request is authenticated.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 16:45:14 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  2. internal/jwt/parser.go

    	return &StandardClaims{}
    }
    
    // SetIssuer sets issuer for these claims
    func (c *StandardClaims) SetIssuer(issuer string) {
    	c.Issuer = issuer
    }
    
    // SetAudience sets audience for these claims
    func (c *StandardClaims) SetAudience(aud string) {
    	c.Audience = aud
    }
    
    // SetExpiry sets expiry in unix epoch secs
    func (c *StandardClaims) SetExpiry(t time.Time) {
    	c.ExpiresAt = t.Unix()
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue May 09 07:53:08 GMT 2023
    - 13.9K bytes
    - Viewed (0)
Back to top