Documentation
¶
Index ¶
Constants ¶
View Source
const ( // AccountIDSuffix suffix for the account id claim AccountIDSuffix = "wt_account_id" // DomainIDSuffix suffix for the domain id claim DomainIDSuffix = "wt_account_domain" // DomainCategorySuffix suffix for the domain category claim DomainCategorySuffix = "wt_account_domain_category" // UserIDClaim claim for the user id UserIDClaim = "sub" // LastLoginSuffix claim for the last login LastLoginSuffix = "nb_last_login" // Invited claim indicates that an incoming JWT is from a user that just accepted an invitation Invited = "nb_invited" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClaimsExtractor ¶
type ClaimsExtractor struct {
// contains filtered or unexported fields
}
ClaimsExtractor struct that holds the extract function
func NewClaimsExtractor ¶
func NewClaimsExtractor(options ...ClaimsExtractorOption) *ClaimsExtractor
NewClaimsExtractor returns an extractor, and if provided with a function with ExtractClaims signature, then it will use that logic. Uses ExtractClaimsFromRequestContext by default
func (*ClaimsExtractor) ToGroups ¶
func (c *ClaimsExtractor) ToGroups(token *jwt.Token, claimName string) []string
func (*ClaimsExtractor) ToUserAuth ¶
type ClaimsExtractorOption ¶
type ClaimsExtractorOption func(*ClaimsExtractor)
ClaimsExtractorOption is a function that configures the ClaimsExtractor
func WithAudience ¶
func WithAudience(audience string) ClaimsExtractorOption
WithAudience sets the audience for the extractor
func WithUserIDClaim ¶
func WithUserIDClaim(userIDClaim string) ClaimsExtractorOption
WithUserIDClaim sets the user id claim for the extractor
type JSONWebKey ¶
type JSONWebKey struct { Kty string `json:"kty"` Kid string `json:"kid"` Use string `json:"use"` N string `json:"n"` E string `json:"e"` Crv string `json:"crv"` X string `json:"x"` Y string `json:"y"` X5c []string `json:"x5c"` }
JSONWebKey is a representation of a Jason Web Key
type Jwks ¶
type Jwks struct { Keys []JSONWebKey `json:"keys"` // contains filtered or unexported fields }
Jwks is a collection of JSONWebKey obtained from Config.HttpServerConfig.AuthKeysLocation
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
Click to show internal directories.
Click to hide internal directories.