oidctestutil

package
v0.22.14 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJWKS

func NewJWKS(key *rsa.PrivateKey, keyID string) jose.JSONWebKeySet

func NewRSAKey

func NewRSAKey(t *testing.T) *rsa.PrivateKey

func NewSigner

func NewSigner(t *testing.T, key *rsa.PrivateKey, keyID string) jose.Signer

func SignToken

func SignToken(t *testing.T, signer jose.Signer, claims any) string

Types

type Option

type Option func(*providerConfig)

func WithClientID

func WithClientID(clientID string) Option

func WithSubject

func WithSubject(subject string) Option

func WithUserInfo

func WithUserInfo(userInfo oidc.UserInfo) Option

func WithUserInfoResponse

func WithUserInfoResponse(status int, body string) Option

type Provider

type Provider struct {
	Issuer           string
	ClientID         string
	Subject          string
	Token            string
	UserInfo         oidc.UserInfo
	UserinfoEndpoint string
	Server           *httptest.Server
	UserinfoCalls    int
	LastAuthHeader   string
	// contains filtered or unexported fields
}

func NewProvider

func NewProvider(t *testing.T, opts ...Option) *Provider

func (*Provider) SignAccessToken

func (p *Provider) SignAccessToken(t *testing.T, claims *oidc.AccessTokenClaims) string

Jump to

Keyboard shortcuts

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