Documentation ¶
Index ¶
Constants ¶
View Source
const ( None = 0 Appliance = 1 + iota Session User )
state values
Variables ¶
This section is empty.
Functions ¶
func Protect ¶
func Protect(config *config.Config, handlerFunc func(w http.ResponseWriter, r *http.Request, token *JwtToken), allowedScopes []string, requireAdmin bool) func(w http.ResponseWriter, r *http.Request)
Protect authenticates and makes sure that caller is authorized to make the call before before invoking actual handler
Types ¶
type ExternalTypes ¶ added in v0.0.30
type ExternalTypes uint
ExternalTypes enumeration holds values for several types an Id can have
type JwtToken ¶
type JwtToken struct { // UserID is id of user matchimg the token UserID uuid.UUID `json:"user,omitempty"` UserName string `json:"name,omitempty"` TenantID uuid.UUID `json:"tenant,omitempty"` ExternalID uuid.UUID `json:"externalId,omitempty"` ExternalType uint `json:"externalType,omitempty"` Scopes []string `json:"scope,omitempty"` Admin bool `json:"admin,omitempty"` Raw string `json:"-"` jwt.StandardClaims }
JwtToken represents the parsed Token from Authentication Header
Click to show internal directories.
Click to hide internal directories.