jwt

package
v2.3.46 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJWT added in v2.2.128

func CreateJWT(clock clock.Clock, secret, site, customerNumber string) (string, error)

func GetJwk

func GetJwk(ctx context.Context, url string, httpClient *http.Client) (jwk.Set, error)

Types

type JwtStruct

type JwtStruct struct {
	UserName       string        `json:"user_name"`
	Uxid           string        `json:"uxid"`
	SessionID      string        `json:"sessionId"`
	CustomerNumber string        `json:"customerNumber"`
	Locale         string        `json:"locale"`
	DeviceID       string        `json:"deviceId"`
	Authorities    []interface{} `json:"authorities"`
	ClientID       string        `json:"client_id"`
	Site           string        `json:"site"`
	Scope          []interface{} `json:"scope"`
	GrantType      string        `json:"grant_type"`
}

func GetJwtToken added in v2.2.127

func GetJwtToken(authHeader string, options ...jwt.ParseOption) (*JwtStruct, error)

type MockService added in v2.2.67

type MockService struct {
	Jwt JwtStruct
}

func (*MockService) GetJwtToken added in v2.2.67

func (m *MockService) GetJwtToken(authHeader string) (*JwtStruct, error)

func (*MockService) GetJwtTokenFromRequest added in v2.2.67

func (m *MockService) GetJwtTokenFromRequest(req *http.Request) (*JwtStruct, error)

type Service added in v2.2.66

type Service interface {
	GetJwtToken(authHeader string) (*JwtStruct, error)
	GetJwtTokenFromRequest(req *http.Request) (*JwtStruct, error)
}

func NewJwtService

func NewJwtService(jwkResourceUrl string, clock clock.Clock) (Service, error)

Jump to

Keyboard shortcuts

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