Documentation ¶
Overview ¶
Package role represents the processing logic of role token.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRoleTokenInvalid "Access denied due to invalid RoleToken" ErrRoleTokenInvalid = errors.New("Access denied due to invalid RoleToken") // ErrRoleTokenExpired "Access denied due to expired RoleToken" ErrRoleTokenExpired = errors.New("Access denied due to expired RoleToken") )
Functions ¶
This section is empty.
Types ¶
type Claim ¶
type Claim struct { Domain string `json:"d"` Email string `json:"email"` KeyID string `json:"k"` MFA string `json:"mfa"` Role string `json:"r"` Salt string `json:"a"` UserID string `json:"u"` UserName string `json:"n"` Version string `json:"v"` jwt.StandardClaims }
Claim represents role jwt claim data.
type Option ¶
type Option func(*rtp)
Option represents a functional options pattern interface
func WithJWKProvider ¶
WithJWKProvider represents set pubkey provider functional option
func WithPubkeyProvider ¶
WithPubkeyProvider represents set pubkey provider functional option
type Processor ¶
type Processor interface { ParseAndValidateRoleToken(tok string) (*Token, error) ParseAndValidateRoleJWT(cred string) (*Claim, error) }
Processor represents the role token parser interface.
type Token ¶
type Token struct { // Version string // required Domain string // required Roles []string // required // Principal string // required // Host string // Salt string // required // TimeStamp time.Time // required ExpiryTime time.Time // required KeyID string // required // IP string // ProxyUser string Signature string // required UnsignedToken string }
Token represents role token data.
Click to show internal directories.
Click to hide internal directories.