claims

package
v0.7.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Custom

type Custom struct {
	// AuthorizedParty tells which client was used to create token.
	AuthorizerParty string           `json:"azp,omitempty"`
	User            string           `json:"preferred_username,omitempty"`
	Scope           string           `json:"scope,omitempty"`
	RealmAccess     Roles            `json:"realm_access,omitempty"`
	ResourceAccess  map[string]Roles `json:"resource_access,omitempty"`
	// Roles usable for custom application.
	Roles []string `json:"roles,omitempty"`

	ScopeSet map[string]struct{} `json:"-"`
	RoleSet  map[string]struct{} `json:"-"`

	// Map claims
	Map map[string]interface{} `json:"-"`

	jwt.RegisteredClaims
}

Custom claims based on jwt.RegisteredClaims with additional Roles and Scope unmarshal.

func (*Custom) HasRole

func (c *Custom) HasRole(role string) bool

func (*Custom) HasScope added in v0.2.0

func (c *Custom) HasScope(scope string) bool

func (*Custom) UnmarshalJSON added in v0.2.0

func (c *Custom) UnmarshalJSON(b []byte) error

type Roles

type Roles struct {
	Roles []string `json:"roles,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL