Documentation ¶
Overview ¶
Package token is used to manage the creation and validation of the credentials used for authenthication.
Index ¶
- Constants
- func CheckClaims(claims *TokenClaims) error
- func EncodeToken(ctx context.Context, referrer *url.URL, outhToken *oauth2.Token) error
- func NumberToInt(number interface{}) (int64, error)
- func ReadManagerFromContext(ctx context.Context) (*tokenManager, error)
- type AuthorizationPayload
- type JsonKeys
- type Manager
- type Permissions
- type PrivateKey
- type PublicKey
- type TokenClaims
Constants ¶
View Source
const (
ServiceAccountID = "8f558668-4db7-4280-8e65-408bcb95f9d9"
)
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
func EncodeToken ¶
EncodeToken encodes token
func NumberToInt ¶
NumberToInt convert interface{} to int64
func ReadManagerFromContext ¶
ReadManagerFromContext extracts the token manager
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) ParseTokenWithMapClaims(ctx context.Context, tokenString string) (jwt.MapClaims, error) PublicKey(keyID string) *rsa.PublicKey PublicKeys() []*rsa.PublicKey JsonWebKeys() JsonKeys PemKeys() JsonKeys ServiceAccountToken(req *goa.RequestData) (string, error) }
Manager generate and find auth token information
func NewManager ¶
NewManager returns a new token Manager for handling tokens
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 PrivateKey ¶
type PrivateKey struct { KeyID string Key *rsa.PrivateKey }
PrivateKey represents an RSA private key with a Key ID
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"` Approved bool `json:"approved"` Authorization *AuthorizationPayload `json:"authorization"` jwt.StandardClaims }
TokenClaims represents access token claims
Click to show internal directories.
Click to hide internal directories.