securityjwt

package module
v0.0.0-...-eb33cdb Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultJWKSOptions

func DefaultJWKSOptions(ctx context.Context) keyfunc.Options

func KeycloakClaimsFactory

func KeycloakClaimsFactory() jwt.Claims

func KeycloakUserMapper

func KeycloakUserMapper(claims *KeycloakClaims) principal.User

func New

func New[T jwt.Claims](keyfunc jwt.Keyfunc, claimFactory func() jwt.Claims, mapper func(T) principal.User) func(http.Handler) http.Handler

func NewKeycloak

func NewKeycloak(keyfunc jwt.Keyfunc) func(http.Handler) http.Handler

Types

type AudienceVerifier

type AudienceVerifier interface {
	VerifyAudience(cmp string, req bool) bool
}

type KeycloakClaims

type KeycloakClaims struct {
	jwt.RegisteredClaims
	Username       string         `json:"preferred_username"`
	Name           string         `json:"given_name"`
	LastName       string         `json:"family_name"`
	Email          string         `json:"email"`
	EmailVerified  bool           `json:"email_verified"`
	Scope          string         `json:"scope"`
	RealmAccess    ResourceRoles  `json:"realm_access"`
	ResourceAccess ResourceAccess `json:"resource_access"`
}

type ResourceAccess

type ResourceAccess map[string]ResourceRoles

type ResourceRoles

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

Jump to

Keyboard shortcuts

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