Documentation
¶
Overview ¶
Package vcr is a generated GoMock package.
Index ¶
- Constants
- func CologneTransformer(scalar leia.Scalar) leia.Scalar
- func NewTestVCRInstance(t *testing.T) *vcr
- func NewTestVCRInstanceInDir(t *testing.T, testDirectory string) *vcr
- type Ambassador
- type Config
- type Finder
- type Index
- type IndexPart
- type MockFinder
- type MockFinderMockRecorder
- type MockResolver
- type MockResolverMockRecorder
- type MockTrustManager
- func (m *MockTrustManager) EXPECT() *MockTrustManagerMockRecorder
- func (m *MockTrustManager) Trust(credentialType, arg1 ssi.URI) error
- func (m *MockTrustManager) Trusted(credentialType ssi.URI) ([]ssi.URI, error)
- func (m *MockTrustManager) Untrust(credentialType, arg1 ssi.URI) error
- func (m *MockTrustManager) Untrusted(credentialType ssi.URI) ([]ssi.URI, error)
- type MockTrustManagerMockRecorder
- func (mr *MockTrustManagerMockRecorder) Trust(credentialType, arg1 any) *gomock.Call
- func (mr *MockTrustManagerMockRecorder) Trusted(credentialType any) *gomock.Call
- func (mr *MockTrustManagerMockRecorder) Untrust(credentialType, arg1 any) *gomock.Call
- func (mr *MockTrustManagerMockRecorder) Untrusted(credentialType any) *gomock.Call
- type MockVCR
- func (m *MockVCR) EXPECT() *MockVCRMockRecorder
- func (m *MockVCR) GetOpenIDHolder(ctx context.Context, id did.DID) (holder.OpenIDHandler, error)
- func (m *MockVCR) GetOpenIDIssuer(ctx context.Context, id did.DID) (issuer.OpenIDHandler, error)
- func (m *MockVCR) Issuer() issuer.Issuer
- func (m *MockVCR) OpenID4VCIEnabled() bool
- func (m *MockVCR) Resolve(ID ssi.URI, resolveTime *time.Time) (*vc.VerifiableCredential, error)
- func (m *MockVCR) Search(ctx context.Context, searchTerms []SearchTerm, allowUntrusted bool, ...) ([]vc.VerifiableCredential, error)
- func (m *MockVCR) StoreCredential(arg0 vc.VerifiableCredential, validAt *time.Time) error
- func (m *MockVCR) Trust(credentialType, arg1 ssi.URI) error
- func (m *MockVCR) Trusted(credentialType ssi.URI) ([]ssi.URI, error)
- func (m *MockVCR) Untrust(credentialType, arg1 ssi.URI) error
- func (m *MockVCR) Untrusted(credentialType ssi.URI) ([]ssi.URI, error)
- func (m *MockVCR) Verifier() verifier.Verifier
- func (m *MockVCR) Wallet() holder.Wallet
- type MockVCRMockRecorder
- func (mr *MockVCRMockRecorder) GetOpenIDHolder(ctx, id any) *gomock.Call
- func (mr *MockVCRMockRecorder) GetOpenIDIssuer(ctx, id any) *gomock.Call
- func (mr *MockVCRMockRecorder) Issuer() *gomock.Call
- func (mr *MockVCRMockRecorder) OpenID4VCIEnabled() *gomock.Call
- func (mr *MockVCRMockRecorder) Resolve(ID, resolveTime any) *gomock.Call
- func (mr *MockVCRMockRecorder) Search(ctx, searchTerms, allowUntrusted, resolveTime any) *gomock.Call
- func (mr *MockVCRMockRecorder) StoreCredential(arg0, validAt any) *gomock.Call
- func (mr *MockVCRMockRecorder) Trust(credentialType, arg1 any) *gomock.Call
- func (mr *MockVCRMockRecorder) Trusted(credentialType any) *gomock.Call
- func (mr *MockVCRMockRecorder) Untrust(credentialType, arg1 any) *gomock.Call
- func (mr *MockVCRMockRecorder) Untrusted(credentialType any) *gomock.Call
- func (mr *MockVCRMockRecorder) Verifier() *gomock.Call
- func (mr *MockVCRMockRecorder) Wallet() *gomock.Call
- type Resolver
- type SearchTerm
- type TestVCRContext
- type TrustManager
- type VCR
Constants ¶
const ( // Exact is the SearchTerm type that requires a search path to result in an exact match Exact = "exact" // NotNil is the SearchTerm type that requires a search path to result in a non nil value NotNil = "notNil" // Prefix is the SearchTerm type that does a prefix match Prefix = "prefix" )
const ModuleName = "VCR"
ModuleName is the name of this module.
Variables ¶
This section is empty.
Functions ¶
func CologneTransformer ¶
CologneTransformer is a go-leia compatible function for generating the phonetic representation of a string.
func NewTestVCRInstance ¶
NewTestVCRInstance returns a new vcr instance to be used for integration tests. Any data is stored in the specified test directory.
func NewTestVCRInstanceInDir ¶
Types ¶
type Ambassador ¶
type Ambassador interface {
// Configure instructs the ambassador to start receiving DID Documents from the network.
Configure() error
// Start the event subscriber for reprocessing transactions from the DAG when called
Start() error
}
Ambassador registers a callback with the network for processing received Verifiable Credentials.
func NewAmbassador ¶
func NewAmbassador(networkClient network.Transactions, writer types.Writer, verifier verifier.Verifier, eventManager events.Event) Ambassador
NewAmbassador creates a new listener for the network that listens to Verifiable Credential transactions.
type Config ¶
type Config struct {
// OpenID4VCI holds the config for the OpenID4VCI credential issuer and wallet
OpenID4VCI openid4vci.Config `koanf:"openid4vci"`
}
Config holds the config for the vcr engine
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a fresh Config filled with default values
type Finder ¶
type Finder interface {
// Search for matching VCs based upon a query. It returns an empty list if no matches have been found.
// It also returns untrusted credentials when allowUntrusted == true
// a context must be passed to prevent long-running queries
Search(ctx context.Context, searchTerms []SearchTerm, allowUntrusted bool, resolveTime *time.Time) ([]vc.VerifiableCredential, error)
}
Finder is the VCR interface for searching VCs
type Index ¶
type Index struct {
// Name identifies the index, must be unique per credential
Name string `yaml:"name"`
// Parts defines the individual index parts, the ordering is significant
Parts []IndexPart `yaml:"parts"`
}
Index for a credential
type IndexPart ¶
type IndexPart struct {
// IRIPath defines the JSON-LD search path
IRIPath []string `yaml:"iriPath"`
// Tokenizer defines an optional tokenizer. Possible values: [whitespace]
Tokenizer *string `yaml:"tokenizer"`
// Transformer defines an optional transformer. Possible values: [cologne, lowercase]
Transformer *string `yaml:"transformer"`
}
IndexPart defines the JSONPath and type of index for a partial index within a compound index
type MockFinder ¶
type MockFinder struct {
// contains filtered or unexported fields
}
MockFinder is a mock of Finder interface.
func NewMockFinder ¶
func NewMockFinder(ctrl *gomock.Controller) *MockFinder
NewMockFinder creates a new mock instance.
func (*MockFinder) EXPECT ¶
func (m *MockFinder) EXPECT() *MockFinderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockFinder) Search ¶
func (m *MockFinder) Search(ctx context.Context, searchTerms []SearchTerm, allowUntrusted bool, resolveTime *time.Time) ([]vc.VerifiableCredential, error)
Search mocks base method.
type MockFinderMockRecorder ¶
type MockFinderMockRecorder struct {
// contains filtered or unexported fields
}
MockFinderMockRecorder is the mock recorder for MockFinder.
type MockResolver ¶
type MockResolver struct {
// contains filtered or unexported fields
}
MockResolver is a mock of Resolver interface.
func NewMockResolver ¶
func NewMockResolver(ctrl *gomock.Controller) *MockResolver
NewMockResolver creates a new mock instance.
func (*MockResolver) EXPECT ¶
func (m *MockResolver) EXPECT() *MockResolverMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockResolver) Resolve ¶
func (m *MockResolver) Resolve(ID ssi.URI, resolveTime *time.Time) (*vc.VerifiableCredential, error)
Resolve mocks base method.
type MockResolverMockRecorder ¶
type MockResolverMockRecorder struct {
// contains filtered or unexported fields
}
MockResolverMockRecorder is the mock recorder for MockResolver.
type MockTrustManager ¶
type MockTrustManager struct {
// contains filtered or unexported fields
}
MockTrustManager is a mock of TrustManager interface.
func NewMockTrustManager ¶
func NewMockTrustManager(ctrl *gomock.Controller) *MockTrustManager
NewMockTrustManager creates a new mock instance.
func (*MockTrustManager) EXPECT ¶
func (m *MockTrustManager) EXPECT() *MockTrustManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockTrustManager) Trust ¶
func (m *MockTrustManager) Trust(credentialType, arg1 ssi.URI) error
Trust mocks base method.
type MockTrustManagerMockRecorder ¶
type MockTrustManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockTrustManagerMockRecorder is the mock recorder for MockTrustManager.
func (*MockTrustManagerMockRecorder) Trust ¶
func (mr *MockTrustManagerMockRecorder) Trust(credentialType, arg1 any) *gomock.Call
Trust indicates an expected call of Trust.
func (*MockTrustManagerMockRecorder) Trusted ¶
func (mr *MockTrustManagerMockRecorder) Trusted(credentialType any) *gomock.Call
Trusted indicates an expected call of Trusted.
type MockVCR ¶
type MockVCR struct {
// contains filtered or unexported fields
}
MockVCR is a mock of VCR interface.
func NewMockVCR ¶
func NewMockVCR(ctrl *gomock.Controller) *MockVCR
NewMockVCR creates a new mock instance.
func (*MockVCR) EXPECT ¶
func (m *MockVCR) EXPECT() *MockVCRMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockVCR) GetOpenIDHolder ¶
GetOpenIDHolder mocks base method.
func (*MockVCR) GetOpenIDIssuer ¶
GetOpenIDIssuer mocks base method.
func (*MockVCR) OpenID4VCIEnabled ¶
OpenID4VCIEnabled mocks base method.
func (*MockVCR) Search ¶
func (m *MockVCR) Search(ctx context.Context, searchTerms []SearchTerm, allowUntrusted bool, resolveTime *time.Time) ([]vc.VerifiableCredential, error)
Search mocks base method.
func (*MockVCR) StoreCredential ¶
StoreCredential mocks base method.
type MockVCRMockRecorder ¶
type MockVCRMockRecorder struct {
// contains filtered or unexported fields
}
MockVCRMockRecorder is the mock recorder for MockVCR.
func (*MockVCRMockRecorder) GetOpenIDHolder ¶
func (mr *MockVCRMockRecorder) GetOpenIDHolder(ctx, id any) *gomock.Call
GetOpenIDHolder indicates an expected call of GetOpenIDHolder.
func (*MockVCRMockRecorder) GetOpenIDIssuer ¶
func (mr *MockVCRMockRecorder) GetOpenIDIssuer(ctx, id any) *gomock.Call
GetOpenIDIssuer indicates an expected call of GetOpenIDIssuer.
func (*MockVCRMockRecorder) Issuer ¶
func (mr *MockVCRMockRecorder) Issuer() *gomock.Call
Issuer indicates an expected call of Issuer.
func (*MockVCRMockRecorder) OpenID4VCIEnabled ¶
func (mr *MockVCRMockRecorder) OpenID4VCIEnabled() *gomock.Call
OpenID4VCIEnabled indicates an expected call of OpenID4VCIEnabled.
func (*MockVCRMockRecorder) Resolve ¶
func (mr *MockVCRMockRecorder) Resolve(ID, resolveTime any) *gomock.Call
Resolve indicates an expected call of Resolve.
func (*MockVCRMockRecorder) Search ¶
func (mr *MockVCRMockRecorder) Search(ctx, searchTerms, allowUntrusted, resolveTime any) *gomock.Call
Search indicates an expected call of Search.
func (*MockVCRMockRecorder) StoreCredential ¶
func (mr *MockVCRMockRecorder) StoreCredential(arg0, validAt any) *gomock.Call
StoreCredential indicates an expected call of StoreCredential.
func (*MockVCRMockRecorder) Trust ¶
func (mr *MockVCRMockRecorder) Trust(credentialType, arg1 any) *gomock.Call
Trust indicates an expected call of Trust.
func (*MockVCRMockRecorder) Trusted ¶
func (mr *MockVCRMockRecorder) Trusted(credentialType any) *gomock.Call
Trusted indicates an expected call of Trusted.
func (*MockVCRMockRecorder) Untrust ¶
func (mr *MockVCRMockRecorder) Untrust(credentialType, arg1 any) *gomock.Call
Untrust indicates an expected call of Untrust.
func (*MockVCRMockRecorder) Untrusted ¶
func (mr *MockVCRMockRecorder) Untrusted(credentialType any) *gomock.Call
Untrusted indicates an expected call of Untrusted.
func (*MockVCRMockRecorder) Verifier ¶
func (mr *MockVCRMockRecorder) Verifier() *gomock.Call
Verifier indicates an expected call of Verifier.
func (*MockVCRMockRecorder) Wallet ¶
func (mr *MockVCRMockRecorder) Wallet() *gomock.Call
Wallet indicates an expected call of Wallet.
type Resolver ¶
type Resolver interface {
// Resolve returns a credential based on its ID.
// The optional resolveTime will resolve the credential at that point in time.
// The credential will still be returned in the case of ErrRevoked and ErrUntrusted.
// For other errors, nil is returned
Resolve(ID ssi.URI, resolveTime *time.Time) (*vc.VerifiableCredential, error)
}
Resolver binds all read type of operations into an interface
type SearchTerm ¶
SearchTerm is part of a JSON-LD query. Multiple terms are combined in an 'AND' manner.
type TestVCRContext ¶
type TestVCRContext struct {
DIDStore didstore.Store
KeyStore crypto.KeyStore
KeyResolver resolver.KeyResolver
VCR VCR
Storage storage.Engine
}
TestVCRContext contains a VCR and underlying services that can be used to do an integration test.
func NewTestVCRContext ¶
func NewTestVCRContext(t *testing.T, keyStore crypto.KeyStore) TestVCRContext
type TrustManager ¶
type TrustManager interface {
// Trust adds trust for a Issuer/CredentialType combination.
Trust(credentialType ssi.URI, issuer ssi.URI) error
// Untrust removes trust for a Issuer/CredentialType combination.
Untrust(credentialType ssi.URI, issuer ssi.URI) error
// Trusted returns a list of trusted issuers for given credentialType
Trusted(credentialType ssi.URI) ([]ssi.URI, error)
// Untrusted returns a list of untrusted issuers based on known credentials
Untrusted(credentialType ssi.URI) ([]ssi.URI, error)
}
TrustManager bundles all trust related methods in one interface
type VCR ¶
type VCR interface {
Issuer() issuer.Issuer
Wallet() holder.Wallet
Verifier() verifier.Verifier
GetOpenIDIssuer(ctx context.Context, id did.DID) (issuer.OpenIDHandler, error)
GetOpenIDHolder(ctx context.Context, id did.DID) (holder.OpenIDHandler, error)
OpenID4VCIEnabled() bool
Finder
Resolver
TrustManager
types.Writer
}
VCR is the interface that covers all functionality of the vcr store.
func NewVCRInstance ¶
func NewVCRInstance(keyStore crypto.KeyStore, vdrInstance vdr.VDR, network network.Transactions, jsonldManager jsonld.JSONLD, eventManager events.Event, storageClient storage.Engine, pkiProvider pki.Provider) VCR
NewVCRInstance creates a new vcr instance with default config and empty concept registry
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
api
|
|
|
openid4vci/v0
Package v0 provides primitives to interact with the openapi HTTP API.
|
Package v0 provides primitives to interact with the openapi HTTP API. |
|
vcr/v2
Package v2 provides primitives to interact with the openapi HTTP API.
|
Package v2 provides primitives to interact with the openapi HTTP API. |
|
Package holder is a generated GoMock package.
|
Package holder is a generated GoMock package. |
|
Package issuer is a generated GoMock package.
|
Package issuer is a generated GoMock package. |
|
Package openid4vci is a generated GoMock package.
|
Package openid4vci is a generated GoMock package. |
|
Package pe stands for Presentation Exchange which includes Presentation Definition and Presentation Submission
|
Package pe stands for Presentation Exchange which includes Presentation Definition and Presentation Submission |
|
schema/v2
Package v2 implements v2.0.0 of the Presentation Exchange specification
|
Package v2 implements v2.0.0 of the Presentation Exchange specification |
|
Package revocation is a generated GoMock package.
|
Package revocation is a generated GoMock package. |
|
Package signature is a generated GoMock package.
|
Package signature is a generated GoMock package. |
|
Package types is a generated GoMock package.
|
Package types is a generated GoMock package. |
|
Package verifier is a generated GoMock package.
|
Package verifier is a generated GoMock package. |