oauth

package
v6.2.12 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package oauth is a generated GoMock package.

Index

Constants

View Source
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) (*oauth.TokenResponse, *oauth.OAuth2Error)
	IntrospectAccessToken(ctx context.Context, token string) (*services.NutsAccessToken, error)
}

AuthorizationServer implements the OAuth2 authorization server role. (V1 API)

func NewAuthorizationServer

func NewAuthorizationServer(
	didResolver resolver.DIDResolver, 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.OAuthAuthorizationServer

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

CreateAccessToken mocks base method.

func (*MockAuthorizationServer) EXPECT

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 any) *gomock.Call

Configure indicates an expected call of Configure.

func (*MockAuthorizationServerMockRecorder) CreateAccessToken

func (mr *MockAuthorizationServerMockRecorder) CreateAccessToken(ctx, request any) *gomock.Call

CreateAccessToken indicates an expected call of CreateAccessToken.

func (*MockAuthorizationServerMockRecorder) IntrospectAccessToken

func (mr *MockAuthorizationServerMockRecorder) IntrospectAccessToken(ctx, token any) *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

CreateJwtGrant mocks base method.

func (*MockRelyingParty) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRelyingParty) RequestRFC003AccessToken

func (m *MockRelyingParty) RequestRFC003AccessToken(ctx context.Context, jwtGrantToken string, authServerEndpoint url.URL) (*oauth.TokenResponse, error)

RequestRFC003AccessToken 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 any) *gomock.Call

CreateJwtGrant indicates an expected call of CreateJwtGrant.

func (*MockRelyingPartyMockRecorder) RequestRFC003AccessToken

func (mr *MockRelyingPartyMockRecorder) RequestRFC003AccessToken(ctx, jwtGrantToken, authServerEndpoint any) *gomock.Call

RequestRFC003AccessToken indicates an expected call of RequestRFC003AccessToken.

type RelyingParty

type RelyingParty interface {
	// CreateJwtGrant creates a JWT grant token that can be used to request an access token.
	CreateJwtGrant(ctx context.Context, request services.CreateJwtGrantRequest) (*services.JwtBearerTokenResult, error)
	// RequestRFC003AccessToken is called by the local EHR node to request an access token from a remote Nuts node using Nuts RFC003.
	RequestRFC003AccessToken(ctx context.Context, jwtGrantToken string, authServerEndpoint url.URL) (*oauth.TokenResponse, error)
}

RelyingParty implements the OAuth2 relying party role. (V1 API)

func NewRelyingParty

func NewRelyingParty(
	didResolver resolver.DIDResolver, serviceResolver didman.CompoundServiceResolver, privateKeyStore nutsCrypto.KeyStore,
	wallet holder.Wallet, httpClientTimeout time.Duration, httpClientTLS *tls.Config, strictMode bool, pkiValidator pki.Validator) RelyingParty

NewRelyingParty returns an implementation of RelyingParty

Jump to

Keyboard shortcuts

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