Documentation
¶
Overview ¶
Package oauth is a generated GoMock package.
Index ¶
- Constants
- type AuthorizationServer
- type ErrorResponse
- type MockAuthorizationServer
- func (m *MockAuthorizationServer) Configure(clockSkewInMilliseconds int, secureMode bool) error
- func (m *MockAuthorizationServer) CreateAccessToken(ctx context.Context, request services.CreateAccessTokenRequest) (*services.AccessTokenResult, *ErrorResponse)
- func (m *MockAuthorizationServer) EXPECT() *MockAuthorizationServerMockRecorder
- func (m *MockAuthorizationServer) IntrospectAccessToken(ctx context.Context, token string) (*services.NutsAccessToken, error)
- type MockAuthorizationServerMockRecorder
- func (mr *MockAuthorizationServerMockRecorder) Configure(clockSkewInMilliseconds, secureMode interface{}) *gomock.Call
- func (mr *MockAuthorizationServerMockRecorder) CreateAccessToken(ctx, request interface{}) *gomock.Call
- func (mr *MockAuthorizationServerMockRecorder) IntrospectAccessToken(ctx, token interface{}) *gomock.Call
- type MockRelyingParty
- func (m *MockRelyingParty) CreateJwtGrant(ctx context.Context, request services.CreateJwtGrantRequest) (*services.JwtBearerTokenResult, error)
- func (m *MockRelyingParty) EXPECT() *MockRelyingPartyMockRecorder
- func (m *MockRelyingParty) RequestAccessToken(ctx context.Context, jwtGrantToken string, authServerEndpoint url.URL) (*services.AccessTokenResult, error)
- type MockRelyingPartyMockRecorder
- type RelyingParty
Constants ¶
const BearerTokenMaxValidity = 5
BearerTokenMaxValidity is the number of seconds that a bearer token is valid
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationServer ¶
type AuthorizationServer interface {
// Configure sets up the client. Enable secureMode to have it behave more safe (e.g., sanitize internal errors).
Configure(clockSkewInMilliseconds int, secureMode bool) error
// CreateAccessToken is called by remote Nuts nodes to create an access token,
// which can be used to access the local organization's XIS resources.
// It returns an oauth.ErrorResponse rather than a regular Go error, because the errors that may be returned are tightly specified.
CreateAccessToken(ctx context.Context, request services.CreateAccessTokenRequest) (*services.AccessTokenResult, *ErrorResponse)
IntrospectAccessToken(ctx context.Context, token string) (*services.NutsAccessToken, error)
}
AuthorizationServer implements the OAuth2 authorization server role.
func NewAuthorizationServer ¶
func NewAuthorizationServer( store didstore.Store, vcFinder vcr.Finder, vcVerifier verifier.Verifier, serviceResolver didman.CompoundServiceResolver, privateKeyStore nutsCrypto.KeyStore, contractNotary services.ContractNotary, jsonldManager jsonld.JSONLD, accessTokenLifeSpan time.Duration) AuthorizationServer
NewAuthorizationServer accepts a vendorID, and several Nuts engines and returns an implementation of services.AuthorizationServer
type ErrorResponse ¶
ErrorResponse models an error returned from an OAuth flow according to RFC6749 (https://tools.ietf.org/html/rfc6749#page-45)
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
Error returns the error detail, if any. If there's no detailed error message, it returns a generic error message. This aids hiding internal errors from clients.
type MockAuthorizationServer ¶
type MockAuthorizationServer struct {
// contains filtered or unexported fields
}
MockAuthorizationServer is a mock of AuthorizationServer interface.
func NewMockAuthorizationServer ¶
func NewMockAuthorizationServer(ctrl *gomock.Controller) *MockAuthorizationServer
NewMockAuthorizationServer creates a new mock instance.
func (*MockAuthorizationServer) Configure ¶
func (m *MockAuthorizationServer) Configure(clockSkewInMilliseconds int, secureMode bool) error
Configure mocks base method.
func (*MockAuthorizationServer) CreateAccessToken ¶
func (m *MockAuthorizationServer) CreateAccessToken(ctx context.Context, request services.CreateAccessTokenRequest) (*services.AccessTokenResult, *ErrorResponse)
CreateAccessToken mocks base method.
func (*MockAuthorizationServer) EXPECT ¶
func (m *MockAuthorizationServer) EXPECT() *MockAuthorizationServerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockAuthorizationServer) IntrospectAccessToken ¶
func (m *MockAuthorizationServer) IntrospectAccessToken(ctx context.Context, token string) (*services.NutsAccessToken, error)
IntrospectAccessToken mocks base method.
type MockAuthorizationServerMockRecorder ¶
type MockAuthorizationServerMockRecorder struct {
// contains filtered or unexported fields
}
MockAuthorizationServerMockRecorder is the mock recorder for MockAuthorizationServer.
func (*MockAuthorizationServerMockRecorder) Configure ¶
func (mr *MockAuthorizationServerMockRecorder) Configure(clockSkewInMilliseconds, secureMode interface{}) *gomock.Call
Configure indicates an expected call of Configure.
func (*MockAuthorizationServerMockRecorder) CreateAccessToken ¶
func (mr *MockAuthorizationServerMockRecorder) CreateAccessToken(ctx, request interface{}) *gomock.Call
CreateAccessToken indicates an expected call of CreateAccessToken.
func (*MockAuthorizationServerMockRecorder) IntrospectAccessToken ¶
func (mr *MockAuthorizationServerMockRecorder) IntrospectAccessToken(ctx, token interface{}) *gomock.Call
IntrospectAccessToken indicates an expected call of IntrospectAccessToken.
type MockRelyingParty ¶
type MockRelyingParty struct {
// contains filtered or unexported fields
}
MockRelyingParty is a mock of RelyingParty interface.
func NewMockRelyingParty ¶
func NewMockRelyingParty(ctrl *gomock.Controller) *MockRelyingParty
NewMockRelyingParty creates a new mock instance.
func (*MockRelyingParty) CreateJwtGrant ¶
func (m *MockRelyingParty) CreateJwtGrant(ctx context.Context, request services.CreateJwtGrantRequest) (*services.JwtBearerTokenResult, error)
CreateJwtGrant mocks base method.
func (*MockRelyingParty) EXPECT ¶
func (m *MockRelyingParty) EXPECT() *MockRelyingPartyMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRelyingParty) RequestAccessToken ¶
func (m *MockRelyingParty) RequestAccessToken(ctx context.Context, jwtGrantToken string, authServerEndpoint url.URL) (*services.AccessTokenResult, error)
RequestAccessToken mocks base method.
type MockRelyingPartyMockRecorder ¶
type MockRelyingPartyMockRecorder struct {
// contains filtered or unexported fields
}
MockRelyingPartyMockRecorder is the mock recorder for MockRelyingParty.
func (*MockRelyingPartyMockRecorder) CreateJwtGrant ¶
func (mr *MockRelyingPartyMockRecorder) CreateJwtGrant(ctx, request interface{}) *gomock.Call
CreateJwtGrant indicates an expected call of CreateJwtGrant.
func (*MockRelyingPartyMockRecorder) RequestAccessToken ¶
func (mr *MockRelyingPartyMockRecorder) RequestAccessToken(ctx, jwtGrantToken, authServerEndpoint interface{}) *gomock.Call
RequestAccessToken indicates an expected call of RequestAccessToken.
type RelyingParty ¶
type RelyingParty interface {
// RequestAccessToken is called by the local EHR node to request an access token from a remote Nuts node.
RequestAccessToken(ctx context.Context, jwtGrantToken string, authServerEndpoint url.URL) (*services.AccessTokenResult, error)
CreateJwtGrant(ctx context.Context, request services.CreateJwtGrantRequest) (*services.JwtBearerTokenResult, error)
}
RelyingParty implements the OAuth2 relying party role.
func NewRelyingParty ¶
func NewRelyingParty( store didstore.Store, serviceResolver didman.CompoundServiceResolver, privateKeyStore nutsCrypto.KeyStore, httpClientTimeout time.Duration, httpClientTLS *tls.Config) RelyingParty
NewRelyingParty returns an implementation of RelyingParty