Documentation ¶
Index ¶
- type ScopeClaims
- func (c *ScopeClaims) HasScope(findScope string) bool
- func (c ScopeClaims) Valid() error
- func (c *ScopeClaims) VerifyAudience(cmp string, req bool) bool
- func (c *ScopeClaims) VerifyExpiresAt(cmp int64, req bool) bool
- func (c *ScopeClaims) VerifyIssuedAt(cmp int64, req bool) bool
- func (c *ScopeClaims) VerifyIssuer(cmp string, req bool) bool
- func (c *ScopeClaims) VerifyNotBefore(cmp int64, req bool) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ScopeClaims ¶
type ScopeClaims struct { Username string `json:"username,omitempty"` Audience []string `json:"aud,omitempty"` ExpiresAt int64 `json:"exp,omitempty"` Id string `json:"jti,omitempty"` IssuedAt int64 `json:"iat,omitempty"` Issuer string `json:"iss,omitempty"` NotBefore int64 `json:"nbf,omitempty"` Subject string `json:"sub,omitempty"` Scope []string `json:"scope,omitempty"` }
func (*ScopeClaims) HasScope ¶
func (c *ScopeClaims) HasScope(findScope string) bool
func (ScopeClaims) Valid ¶
func (c ScopeClaims) Valid() error
Valid validates time based claims "exp, iat, nbf". There is no accounting for clock skew. As well, if any of the above claims are not in the token, it will still be considered a valid claim.
func (*ScopeClaims) VerifyAudience ¶
func (c *ScopeClaims) VerifyAudience(cmp string, req bool) bool
VerifyAudience compares the aud claim against cmp. If required is false, this method will return true if the value matches or is unset
func (*ScopeClaims) VerifyExpiresAt ¶
func (c *ScopeClaims) VerifyExpiresAt(cmp int64, req bool) bool
VerifyExpiresAt compares the exp claim against cmp. If required is false, this method will return true if the value matches or is unset
func (*ScopeClaims) VerifyIssuedAt ¶
func (c *ScopeClaims) VerifyIssuedAt(cmp int64, req bool) bool
VerifyIssuedAt compares the iat claim against cmp. If required is false, this method will return true if the value matches or is unset
func (*ScopeClaims) VerifyIssuer ¶
func (c *ScopeClaims) VerifyIssuer(cmp string, req bool) bool
VerifyIssuer compares the iss claim against cmp. If required is false, this method will return true if the value matches or is unset
func (*ScopeClaims) VerifyNotBefore ¶
func (c *ScopeClaims) VerifyNotBefore(cmp int64, req bool) bool
VerifyNotBefore compares the nbf claim against cmp. If required is false, this method will return true if the value matches or is unset