Documentation ¶
Overview ¶
Package oidc is a generated GoMock package.
Index ¶
- Variables
- func DefaultJwksHandlerBehavior(t *testing.T, verificationPublicKey *rsa.PublicKey) func() jose.JSONWebKeySet
- func TokenHandlerBehaviorReturningPredefinedJWT(t *testing.T, rsaPrivateKey *rsa.PrivateKey, claims map[string]interface{}, ...) func() (Token, error)
- type JWKsHandler
- type MockJWKsHandler
- type MockJWKsHandlerMockRecorder
- type MockTokenHandler
- type MockTokenHandlerMockRecorder
- type TestServer
- type Token
- type TokenHandler
Constants ¶
This section is empty.
Variables ¶
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(t *testing.T, verificationPublicKey *rsa.PublicKey) 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 TokenHandlerBehaviorReturningPredefinedJWT ¶ added in v1.29.0
func TokenHandlerBehaviorReturningPredefinedJWT( t *testing.T, rsaPrivateKey *rsa.PrivateKey, claims map[string]interface{}, accessToken, refreshToken string, ) func() (Token, error)
TokenHandlerBehaviorReturningPredefinedJWT describes the scenario when signed JWT token is being created. This behavior should being applied to the MockTokenHandler.
Types ¶
type JWKsHandler ¶
type JWKsHandler interface {
KeySet() jose.JSONWebKeySet
}
type MockJWKsHandler ¶
type MockJWKsHandler struct {
// contains filtered or unexported fields
}
MockJWKsHandler is a mock of JWKsHandler interface.
func NewMockJWKsHandler ¶
func NewMockJWKsHandler(ctrl *gomock.Controller) *MockJWKsHandler
NewMockJWKsHandler creates a new mock instance.
func (*MockJWKsHandler) EXPECT ¶
func (m *MockJWKsHandler) EXPECT() *MockJWKsHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockJWKsHandler) KeySet ¶
func (m *MockJWKsHandler) KeySet() go_jose_v2.JSONWebKeySet
KeySet mocks base method.
type MockJWKsHandlerMockRecorder ¶
type MockJWKsHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockJWKsHandlerMockRecorder is the mock recorder for MockJWKsHandler.
func (*MockJWKsHandlerMockRecorder) KeySet ¶
func (mr *MockJWKsHandlerMockRecorder) KeySet() *gomock.Call
KeySet indicates an expected call of KeySet.
type MockTokenHandler ¶
type MockTokenHandler struct {
// contains filtered or unexported fields
}
MockTokenHandler is a mock of TokenHandler interface.
func NewMockTokenHandler ¶
func NewMockTokenHandler(ctrl *gomock.Controller) *MockTokenHandler
NewMockTokenHandler creates a new mock instance.
func (*MockTokenHandler) EXPECT ¶
func (m *MockTokenHandler) EXPECT() *MockTokenHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTokenHandler) Token ¶
func (m *MockTokenHandler) Token() (Token, error)
Token mocks base method.
type MockTokenHandlerMockRecorder ¶
type MockTokenHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockTokenHandlerMockRecorder is the mock recorder for MockTokenHandler.
func (*MockTokenHandlerMockRecorder) Token ¶
func (mr *MockTokenHandlerMockRecorder) Token() *gomock.Call
Token indicates an expected call of Token.
type TestServer ¶
type TestServer struct {
// contains filtered or unexported fields
}
func BuildAndRunTestServer ¶
func BuildAndRunTestServer(t *testing.T, caPath, caKeyPath string) *TestServer
BuildAndRunTestServer configures OIDC TLS server and its routing
func (*TestServer) JwksHandler ¶
func (ts *TestServer) JwksHandler() *MockJWKsHandler
JwksHandler is getter of JSON Web Key Sets handler
func (*TestServer) TokenHandler ¶
func (ts *TestServer) TokenHandler() *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