Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessClaims ¶
AccessClaims is the jwt claims implementation that keeps the accountID stored in given token.
func (*AccessClaims) GetAccount ¶
func (c *AccessClaims) GetAccount() auth.Account
GetAccount implements auth.AccessClaims interface.
type Claims ¶
type Claims struct { RevokedAt int64 `json:"revoked_at"` jwt.StandardClaims }
Claims is the common claims base for both AccessClaims and RefreshClaims. It's validation returns neuron errors, and allows to check if the token was revoked.
type StoreToken ¶
type StoreToken struct { MappedTokens []string `json:"mapped_tokens"` RevokedAt *time.Time `json:"is_revoked"` ExpiresAt time.Time `json:"expires_at"` }
StoreToken is the token's store value.
type Tokener ¶
type Tokener struct { Parser jwt.Parser Store store.Store Options auth.TokenerOptions // contains filtered or unexported fields }
Tokener is neuron auth.Tokener implementation for the jwt.Token. It allows to store and inspect token encrypted using HMAC, RSA and ECDSA algorithms. This structure requires store.Store to keep the revoked tokens values. For production ready services don't use in-memory default store.
func New ¶
func New(options ...auth.TokenerOption) (*Tokener, error)
New creates new Tokener with provided 'options'.
func (*Tokener) InspectToken ¶
InspectToken inspects given token string and returns provided claims.
func (*Tokener) RevokeToken ¶
RevokeToken invalidates provided 'token'.