Documentation
¶
Overview ¶
Package services is a generated GoMock package.
Index ¶
- Constants
- Variables
- type ContractFormat
- type ContractNotary
- type ContractValidationResult
- type CreateAccessTokenRequest
- type CreateJwtGrantRequest
- type CreateSessionRequest
- type CreateSessionResult
- type InvalidContractRequestError
- type JwtBearerTokenResult
- type MockContractNotary
- func (m *MockContractNotary) Configure() error
- func (m *MockContractNotary) CreateSigningSession(sessionRequest CreateSessionRequest) (contract.SessionPointer, error)
- func (m *MockContractNotary) DrawUpContract(ctx context.Context, template contract.Template, orgID did.DID, ...) (*contract.Contract, error)
- func (m *MockContractNotary) EXPECT() *MockContractNotaryMockRecorder
- func (m *MockContractNotary) Routes(router core.EchoRouter)
- func (m *MockContractNotary) SigningSessionStatus(ctx context.Context, sessionID string) (contract.SigningSessionResult, error)
- func (m *MockContractNotary) VerifyVP(vp vc.VerifiablePresentation, checkTime *time.Time) (contract.VPVerificationResult, error)
- type MockContractNotaryMockRecorder
- func (mr *MockContractNotaryMockRecorder) Configure() *gomock.Call
- func (mr *MockContractNotaryMockRecorder) CreateSigningSession(sessionRequest any) *gomock.Call
- func (mr *MockContractNotaryMockRecorder) DrawUpContract(ctx, template, orgID, validFrom, validDuration, organizationCredential any) *gomock.Call
- func (mr *MockContractNotaryMockRecorder) Routes(router any) *gomock.Call
- func (mr *MockContractNotaryMockRecorder) SigningSessionStatus(ctx, sessionID any) *gomock.Call
- func (mr *MockContractNotaryMockRecorder) VerifyVP(vp, checkTime any) *gomock.Call
- type MockSignedToken
- type MockSignedTokenMockRecorder
- type MockVPProofValueParser
- type MockVPProofValueParserMockRecorder
- type NutsAccessToken
- type NutsIdentityToken
- type SessionID
- type SignedToken
- type TestVPVerificationResult
- func (t TestVPVerificationResult) ContractAttribute(key string) string
- func (t TestVPVerificationResult) ContractAttributes() map[string]string
- func (t TestVPVerificationResult) DisclosedAttribute(key string) string
- func (t TestVPVerificationResult) DisclosedAttributes() map[string]string
- func (t TestVPVerificationResult) Reason() string
- func (t TestVPVerificationResult) VPType() string
- func (t TestVPVerificationResult) Validity() contract.State
- type VPProofValueParser
- type ValidationState
Constants ¶
const ( // IrmaFormat is used to indicate a contract is in he form of a base64 encoded IRMA signature IrmaFormat ContractFormat = "irma" // Valid is used to indicate a contract was valid on the time of testing Valid ValidationState = "VALID" // Invalid is used to indicate a contract was invalid on the time of testing Invalid ValidationState = "INVALID" )
const AssuranceLevelClaim = "assurance_level"
AssuranceLevelClaim is the identity assurance level claim: Low - High
const EmailTokenClaim = "email"
EmailTokenClaim is the JWT claim for email
const FamilyNameTokenClaim = "familyname"
FamilyNameTokenClaim is the JWT claim for the family name
const InitialsTokenClaim = "initials"
InitialsTokenClaim is the JWT claim for initials
const OAuthEndpointType = "oauth"
OAuthEndpointType defines the type identifier for oauth endpoints (RFCtodo)
const PrefixTokenClaim = "prefix"
PrefixTokenClaim is the JWT claim for the name prefix
const UserRoleClaim = "user_role"
UserRoleClaim is the JWT claim for the user role which can be anything, depending on the authorizer's IAM system.
const UsernameClaim = "username"
UsernameClaim is the JWT claim for the username. This may be an identifier or email depending on the means used. The claim is a default claim according to RFC 7662 (https://www.rfc-editor.org/rfc/rfc7662)
Variables ¶
var ErrSessionNotFound = errors.New("session not found")
ErrSessionNotFound is returned when there is no contract signing session found for a certain SessionID
Functions ¶
This section is empty.
Types ¶
type ContractFormat ¶
type ContractFormat string
ContractFormat describes the format of a signed contract. Based on the format an appropriate validator can be selected.
type ContractNotary ¶
type ContractNotary interface {
contract.VPVerifier
// DrawUpContract draws up a contract from a template and returns a Contract which than can be signed by the user.
DrawUpContract(ctx context.Context, template contract.Template, orgID did.DID, validFrom time.Time, validDuration time.Duration, organizationCredential *vc.VerifiableCredential) (*contract.Contract, error)
// CreateSigningSession creates a signing session for the requested contract and means
CreateSigningSession(sessionRequest CreateSessionRequest) (contract.SessionPointer, error)
// SigningSessionStatus returns the status of the current signing session or ErrSessionNotFound is sessionID is unknown
// context is used to pass audit context when using crypto library
SigningSessionStatus(ctx context.Context, sessionID string) (contract.SigningSessionResult, error)
Configure() error
core.Routable
}
ContractNotary defines the functions for creating, validating verifiable credentials and draw up a contract.
type ContractValidationResult ¶
type ContractValidationResult struct {
ValidationResult ValidationState `json:"validation_result"`
FailureReason string `json:"failure_reason"`
ContractFormat ContractFormat `json:"contract_format"`
// DisclosedAttributes contain the attributes used to sign this contract
DisclosedAttributes map[string]string `json:"disclosed_attributes"`
// ContractAttributes contain the attributes used to fill the contract
ContractAttributes map[string]string `json:"contract_attributes"`
}
ContractValidationResult contains the result of a contract validation
type CreateAccessTokenRequest ¶
type CreateAccessTokenRequest struct {
RawJwtBearerToken string
}
CreateAccessTokenRequest contains all information to create an access token from a JwtBearerToken
type CreateJwtGrantRequest ¶
type CreateJwtGrantRequest struct {
Requester string
Authorizer string
IdentityVP *vc.VerifiablePresentation
Service string
Credentials []vc.VerifiableCredential
}
CreateJwtGrantRequest contains all information to create a JwtBearerToken
type CreateSessionRequest ¶
type CreateSessionRequest struct {
SigningMeans string
// Message to sign
Message string
// Params contain means specific parameters
Params map[string]interface{}
}
CreateSessionRequest is used to create a contract signing session.
type CreateSessionResult ¶
CreateSessionResult contains the results needed to setup an irma flow
type InvalidContractRequestError ¶
type InvalidContractRequestError struct {
Message interface{}
}
InvalidContractRequestError is returned when the contract request is invalid
func (InvalidContractRequestError) Error ¶
func (e InvalidContractRequestError) Error() string
func (InvalidContractRequestError) Is ¶
func (e InvalidContractRequestError) Is(target error) bool
type JwtBearerTokenResult ¶
JwtBearerTokenResult defines the return value back to the api for the createJwtBearerToken method
type MockContractNotary ¶
type MockContractNotary struct {
// contains filtered or unexported fields
}
MockContractNotary is a mock of ContractNotary interface.
func NewMockContractNotary ¶
func NewMockContractNotary(ctrl *gomock.Controller) *MockContractNotary
NewMockContractNotary creates a new mock instance.
func (*MockContractNotary) Configure ¶
func (m *MockContractNotary) Configure() error
Configure mocks base method.
func (*MockContractNotary) CreateSigningSession ¶
func (m *MockContractNotary) CreateSigningSession(sessionRequest CreateSessionRequest) (contract.SessionPointer, error)
CreateSigningSession mocks base method.
func (*MockContractNotary) DrawUpContract ¶
func (m *MockContractNotary) DrawUpContract(ctx context.Context, template contract.Template, orgID did.DID, validFrom time.Time, validDuration time.Duration, organizationCredential *vc.VerifiableCredential) (*contract.Contract, error)
DrawUpContract mocks base method.
func (*MockContractNotary) EXPECT ¶
func (m *MockContractNotary) EXPECT() *MockContractNotaryMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockContractNotary) Routes ¶
func (m *MockContractNotary) Routes(router core.EchoRouter)
Routes mocks base method.
func (*MockContractNotary) SigningSessionStatus ¶
func (m *MockContractNotary) SigningSessionStatus(ctx context.Context, sessionID string) (contract.SigningSessionResult, error)
SigningSessionStatus mocks base method.
func (*MockContractNotary) VerifyVP ¶
func (m *MockContractNotary) VerifyVP(vp vc.VerifiablePresentation, checkTime *time.Time) (contract.VPVerificationResult, error)
VerifyVP mocks base method.
type MockContractNotaryMockRecorder ¶
type MockContractNotaryMockRecorder struct {
// contains filtered or unexported fields
}
MockContractNotaryMockRecorder is the mock recorder for MockContractNotary.
func (*MockContractNotaryMockRecorder) Configure ¶
func (mr *MockContractNotaryMockRecorder) Configure() *gomock.Call
Configure indicates an expected call of Configure.
func (*MockContractNotaryMockRecorder) CreateSigningSession ¶
func (mr *MockContractNotaryMockRecorder) CreateSigningSession(sessionRequest any) *gomock.Call
CreateSigningSession indicates an expected call of CreateSigningSession.
func (*MockContractNotaryMockRecorder) DrawUpContract ¶
func (mr *MockContractNotaryMockRecorder) DrawUpContract(ctx, template, orgID, validFrom, validDuration, organizationCredential any) *gomock.Call
DrawUpContract indicates an expected call of DrawUpContract.
func (*MockContractNotaryMockRecorder) Routes ¶
func (mr *MockContractNotaryMockRecorder) Routes(router any) *gomock.Call
Routes indicates an expected call of Routes.
func (*MockContractNotaryMockRecorder) SigningSessionStatus ¶
func (mr *MockContractNotaryMockRecorder) SigningSessionStatus(ctx, sessionID any) *gomock.Call
SigningSessionStatus indicates an expected call of SigningSessionStatus.
type MockSignedToken ¶
type MockSignedToken struct {
// contains filtered or unexported fields
}
MockSignedToken is a mock of SignedToken interface.
func NewMockSignedToken ¶
func NewMockSignedToken(ctrl *gomock.Controller) *MockSignedToken
NewMockSignedToken creates a new mock instance.
func (*MockSignedToken) Contract ¶
func (m *MockSignedToken) Contract() contract.Contract
Contract mocks base method.
func (*MockSignedToken) EXPECT ¶
func (m *MockSignedToken) EXPECT() *MockSignedTokenMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockSignedToken) SignerAttributes ¶
func (m *MockSignedToken) SignerAttributes() (map[string]string, error)
SignerAttributes mocks base method.
type MockSignedTokenMockRecorder ¶
type MockSignedTokenMockRecorder struct {
// contains filtered or unexported fields
}
MockSignedTokenMockRecorder is the mock recorder for MockSignedToken.
func (*MockSignedTokenMockRecorder) Contract ¶
func (mr *MockSignedTokenMockRecorder) Contract() *gomock.Call
Contract indicates an expected call of Contract.
func (*MockSignedTokenMockRecorder) SignerAttributes ¶
func (mr *MockSignedTokenMockRecorder) SignerAttributes() *gomock.Call
SignerAttributes indicates an expected call of SignerAttributes.
type MockVPProofValueParser ¶
type MockVPProofValueParser struct {
// contains filtered or unexported fields
}
MockVPProofValueParser is a mock of VPProofValueParser interface.
func NewMockVPProofValueParser ¶
func NewMockVPProofValueParser(ctrl *gomock.Controller) *MockVPProofValueParser
NewMockVPProofValueParser creates a new mock instance.
func (*MockVPProofValueParser) EXPECT ¶
func (m *MockVPProofValueParser) EXPECT() *MockVPProofValueParserMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockVPProofValueParser) Parse ¶
func (m *MockVPProofValueParser) Parse(rawAuthToken string) (SignedToken, error)
Parse mocks base method.
func (*MockVPProofValueParser) Verify ¶
func (m *MockVPProofValueParser) Verify(token SignedToken) error
Verify mocks base method.
type MockVPProofValueParserMockRecorder ¶
type MockVPProofValueParserMockRecorder struct {
// contains filtered or unexported fields
}
MockVPProofValueParserMockRecorder is the mock recorder for MockVPProofValueParser.
type NutsAccessToken ¶
type NutsAccessToken struct {
Service string `json:"service"`
Initials *string `json:"initials,omitempty"`
Prefix *string `json:"prefix,omitempty"`
FamilyName *string `json:"family_name,omitempty"`
Email *string `json:"email,omitempty"`
AssuranceLevel *string `json:"assurance_level,omitempty"`
Username *string `json:"username,omitempty"`
UserRole *string `json:"user_role,omitempty"`
KeyID string `json:"-"`
Expiration int64 `json:"exp"`
IssuedAt int64 `json:"iat"`
Issuer string `json:"iss"`
Subject string `json:"sub"`
Audience string `json:"aud"`
Credentials []string `json:"vcs,omitempty"`
}
NutsAccessToken is a OAuth 2.0 access token which provides context to a request. Its contents are derived from a Jwt Bearer token. The Jwt Bearer token is verified by the authorization server and stripped from the proof to make it compact.
func (*NutsAccessToken) FromMap ¶
func (t *NutsAccessToken) FromMap(m map[string]interface{}) error
FromMap sets the values of the token from the given map.
type NutsIdentityToken ¶
type NutsIdentityToken struct {
// KeyID identifies the key that was used to sign the token
KeyID string `json:"kid"`
// What kind of signature? Currently only IRMA is supported
Type ContractFormat `json:"type"`
// The base64 encoded signature
Signature string `json:"sig"`
}
NutsIdentityToken contains the signed identity of the user performing the request
func (*NutsIdentityToken) FromMap ¶
func (t *NutsIdentityToken) FromMap(m map[string]interface{}) error
FromMap sets the values of the token from the given map.
type SessionID ¶
type SessionID string
SessionID contains a number to uniquely identify a contract signing session
type SignedToken ¶
type SignedToken interface {
// SignerAttributes extracts a map of attribute names and their values from the signature
SignerAttributes() (map[string]string, error)
// Contract extracts the Contract from the SignedToken
Contract() contract.Contract
}
SignedToken defines the uniform interface to crypto specific implementations such as Irma or x509 tokens.
type TestVPVerificationResult ¶
type TestVPVerificationResult struct {
Val contract.State
FailureReason string
Type string
DAttributes map[string]string
CAttributes map[string]string
}
func (TestVPVerificationResult) ContractAttribute ¶
func (t TestVPVerificationResult) ContractAttribute(key string) string
func (TestVPVerificationResult) ContractAttributes ¶
func (t TestVPVerificationResult) ContractAttributes() map[string]string
func (TestVPVerificationResult) DisclosedAttribute ¶
func (t TestVPVerificationResult) DisclosedAttribute(key string) string
func (TestVPVerificationResult) DisclosedAttributes ¶
func (t TestVPVerificationResult) DisclosedAttributes() map[string]string
func (TestVPVerificationResult) Reason ¶
func (t TestVPVerificationResult) Reason() string
func (TestVPVerificationResult) VPType ¶
func (t TestVPVerificationResult) VPType() string
func (TestVPVerificationResult) Validity ¶
func (t TestVPVerificationResult) Validity() contract.State
type VPProofValueParser ¶
type VPProofValueParser interface {
// Parse accepts a raw ProofValue from the VP as a string. The parser tries to parse the value into a SignedToken.
Parse(rawAuthToken string) (SignedToken, error)
// Verify accepts a SignedToken and verifies the signature using the crypto for the specific implementation of this interface.
Verify(token SignedToken) error
}
VPProofValueParser provides a uniform interface for Authentication services like IRMA or x509 signed tokens
type ValidationState ¶
type ValidationState string
ValidationState contains the outcome of the validation. It van be VALID or INVALID. This makes it human readable.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package oauth is a generated GoMock package.
|
Package oauth is a generated GoMock package. |
|
types
Package types is a generated GoMock package.
|
Package types is a generated GoMock package. |
|
web
Package web provides primitives to interact with the openapi HTTP API.
|
Package web provides primitives to interact with the openapi HTTP API. |