Documentation ¶
Overview ¶
Package tok provides AuthN token (structure and methods) for validation by AIS gateways
- Copyright (c) 2018-2022, NVIDIA CORPORATION. All rights reserved.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoPermissions = errors.New("insufficient permissions") ErrInvalidToken = errors.New("invalid token") ErrNoToken = errors.New("token required") ErrNoBearerToken = errors.New("invalid token: no bearer") ErrTokenExpired = errors.New("token expired") ErrTokenRevoked = errors.New("token revoked") )
Functions ¶
func ExtractToken ¶
Header format: 'Authorization: Bearer <token>'
Types ¶
type Token ¶
type Token struct { UserID string `json:"username"` Expires time.Time `json:"expires"` Token string `json:"token"` ClusterACLs []*authn.CluACL `json:"clusters"` BucketACLs []*authn.BckACL `json:"buckets,omitempty"` IsAdmin bool `json:"admin"` }
func DecryptToken ¶
func (*Token) CheckPermissions ¶
Click to show internal directories.
Click to hide internal directories.