Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseWithClaims ¶
ParseWithClaims - parse the token string, valid methods.
func ParseWithStandardClaims ¶
func ParseWithStandardClaims(tokenStr string, claims *StandardClaims, key []byte) error
ParseWithStandardClaims - parse the token string, valid methods.
Types ¶
type MapClaims ¶
MapClaims - implements custom unmarshaller
func (*MapClaims) MarshalJSON ¶
MarshalJSON marshals the MapClaims struct
func (*MapClaims) SetAccessKey ¶
SetAccessKey sets access key as jwt subject and custom "accessKey" field.
func (*MapClaims) Valid ¶
Valid - implements https://godoc.org/github.com/dgrijalva/jwt-go#Claims compatible claims interface, additionally validates "accessKey" fields.
type SigningMethodHMAC ¶
SigningMethodHMAC - Implements the HMAC-SHA family of signing methods signing methods Expects key type of []byte for both signing and validation
var ( SigningMethodHS256 *SigningMethodHMAC SigningMethodHS384 *SigningMethodHMAC SigningMethodHS512 *SigningMethodHMAC )
Specific instances for HS256, HS384, HS512
func ParseUnverifiedMapClaims ¶
func ParseUnverifiedMapClaims(tokenString string, claims *MapClaims, buf []byte) (*SigningMethodHMAC, error)
ParseUnverifiedMapClaims - WARNING: Don't use this method unless you know what you're doing
This method parses the token but doesn't validate the signature. It's only ever useful in cases where you know the signature is valid (because it has been checked previously in the stack) and you want to extract values from it.
func ParseUnverifiedStandardClaims ¶
func ParseUnverifiedStandardClaims(tokenString string, claims *StandardClaims, buf []byte) (*SigningMethodHMAC, error)
ParseUnverifiedStandardClaims - WARNING: Don't use this method unless you know what you're doing
This method parses the token but doesn't validate the signature. It's only ever useful in cases where you know the signature is valid (because it has been checked previously in the stack) and you want to extract values from it.
type StandardClaims ¶
type StandardClaims struct { AccessKey string `json:"accessKey,omitempty"` jwtgo.StandardClaims }
StandardClaims are basically standard claims with "accessKey"
func NewStandardClaims ¶
func NewStandardClaims() *StandardClaims
NewStandardClaims - initializes standard claims
func (*StandardClaims) SetAccessKey ¶
func (c *StandardClaims) SetAccessKey(accessKey string)
SetAccessKey sets access key as jwt subject and custom "accessKey" field.
func (*StandardClaims) SetAudience ¶
func (c *StandardClaims) SetAudience(aud string)
SetAudience sets audience for these claims
func (*StandardClaims) SetExpiry ¶
func (c *StandardClaims) SetExpiry(t time.Time)
SetExpiry sets expiry in unix epoch secs
func (*StandardClaims) SetIssuer ¶
func (c *StandardClaims) SetIssuer(issuer string)
SetIssuer sets issuer for these claims
func (*StandardClaims) Valid ¶
func (c *StandardClaims) Valid() error
Valid - implements https://godoc.org/github.com/dgrijalva/jwt-go#Claims compatible claims interface, additionally validates "accessKey" fields.