Documentation ¶
Overview ¶
Package token is used to manage the creation and validation of the credentials used for authenthication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckClaims ¶
func CheckClaims(claims *TokenClaims) error
CheckClaims checks if all the required claims are present in the access token
Types ¶
type AuthorizationPayload ¶
type AuthorizationPayload struct {
Permissions []Permissions `json:"permissions"`
}
AuthorizationPayload represents an authz payload in the rpt token
type Manager ¶
type Manager interface { Locate(ctx context.Context) (uuid.UUID, error) ParseToken(ctx context.Context, tokenString string) (*TokenClaims, error) PublicKey(kid string) *rsa.PublicKey PublicKeys() []*rsa.PublicKey IsServiceAccount(ctx context.Context, serviceName string) bool }
Manager generate and find auth token information
func NewManager ¶
NewManager returns a new token Manager for handling tokens
func NewManagerWithPublicKey ¶
NewManagerWithPublicKey returns a new token Manager for handling tokens with the only public key
type Permissions ¶
type Permissions struct { ResourceSetName *string `json:"resource_set_name"` ResourceSetID *string `json:"resource_set_id"` }
Permissions represents a "permissions" in the AuthorizationPayload
type TokenClaims ¶
type TokenClaims struct { Name string `json:"name"` Username string `json:"preferred_username"` GivenName string `json:"given_name"` FamilyName string `json:"family_name"` Email string `json:"email"` Company string `json:"company"` SessionState string `json:"session_state"` Authorization *AuthorizationPayload `json:"authorization"` jwt.StandardClaims }
TokenClaims represents access token claims
Click to show internal directories.
Click to hide internal directories.