Documentation ¶
Index ¶
- Variables
- func DefaultJwksHandlerBehavior[K JosePublicKey](t *testing.T, verificationPublicKey K) func() jose.JSONWebKeySet
- func GetSignatureAlgorithm[K JoseKey](key K) jose.SignatureAlgorithm
- func TokenHandlerBehaviorReturningPredefinedJWT[K JosePrivateKey](t *testing.T, privateKey K, claims map[string]interface{}, ...) func() (handlers.Token, error)
- type JoseKey
- type JosePrivateKey
- type JosePublicKey
- type TestServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRefreshTokenExpired = errors.New("refresh token is expired") ErrBadClientID = errors.New("client ID is bad") )
Functions ¶
func DefaultJwksHandlerBehavior ¶ added in v1.29.0
func DefaultJwksHandlerBehavior[K JosePublicKey](t *testing.T, verificationPublicKey K) func() jose.JSONWebKeySet
DefaultJwksHandlerBehavior describes the scenario when JSON Web Key Set token is being returned. This behavior should being applied to the MockJWKsHandler.
func GetSignatureAlgorithm ¶ added in v1.30.0
func GetSignatureAlgorithm[K JoseKey](key K) jose.SignatureAlgorithm
func TokenHandlerBehaviorReturningPredefinedJWT ¶ added in v1.29.0
func TokenHandlerBehaviorReturningPredefinedJWT[K JosePrivateKey]( t *testing.T, privateKey K, claims map[string]interface{}, accessToken, refreshToken string, ) func() (handlers.Token, error)
TokenHandlerBehaviorReturningPredefinedJWT describes the scenario when signed JWT token is being created. This behavior should being applied to the MockTokenHandler.
Types ¶
type JoseKey ¶ added in v1.30.0
type JoseKey interface{ JosePrivateKey | JosePublicKey }
type JosePrivateKey ¶ added in v1.30.0
type JosePrivateKey interface { *rsa.PrivateKey | *ecdsa.PrivateKey }
type JosePublicKey ¶ added in v1.30.0
type TestServer ¶
type TestServer struct {
// contains filtered or unexported fields
}
func BuildAndRunTestServer ¶
func BuildAndRunTestServer(t *testing.T, caPath, caKeyPath, issuerOverride string) *TestServer
BuildAndRunTestServer configures OIDC TLS server and its routing
func (*TestServer) JwksHandler ¶
func (ts *TestServer) JwksHandler() *handlers.MockJWKsHandler
JwksHandler is getter of JSON Web Key Sets handler
func (*TestServer) TokenHandler ¶
func (ts *TestServer) TokenHandler() *handlers.MockTokenHandler
TokenHandler is getter of JWT token handler
func (*TestServer) TokenURL ¶
func (ts *TestServer) TokenURL() (string, error)
TokenURL returns the public URL of JWT token endpoint
Click to show internal directories.
Click to hide internal directories.