vcr

package
v6.2.13 Latest Latest
Warning

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

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

Documentation

Overview

Package vcr is a generated GoMock package.

Index

Constants

View Source
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"
)
View Source
const ModuleName = "VCR"

ModuleName is the name of this module.

Variables

This section is empty.

Functions

func CologneTransformer

func CologneTransformer(scalar leia.Scalar) leia.Scalar

CologneTransformer is a go-leia compatible function for generating the phonetic representation of a string.

func NewTestVCRInstance

func NewTestVCRInstance(t *testing.T) *vcr

NewTestVCRInstance returns a new vcr instance to be used for integration tests. Any data is stored in the specified test directory.

func NewTestVCRInstanceInDir

func NewTestVCRInstanceInDir(t *testing.T, testDirectory string) *vcr

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.

func (*MockFinderMockRecorder) Search

func (mr *MockFinderMockRecorder) Search(ctx, searchTerms, allowUntrusted, resolveTime any) *gomock.Call

Search indicates an expected call of Search.

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

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.

func (*MockResolverMockRecorder) Resolve

func (mr *MockResolverMockRecorder) Resolve(ID, resolveTime any) *gomock.Call

Resolve indicates an expected call of Resolve.

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

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.

func (*MockTrustManager) Trusted

func (m *MockTrustManager) Trusted(credentialType ssi.URI) ([]ssi.URI, error)

Trusted mocks base method.

func (*MockTrustManager) Untrust

func (m *MockTrustManager) Untrust(credentialType, arg1 ssi.URI) error

Untrust mocks base method.

func (*MockTrustManager) Untrusted

func (m *MockTrustManager) Untrusted(credentialType ssi.URI) ([]ssi.URI, error)

Untrusted 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.

func (*MockTrustManagerMockRecorder) Untrust

func (mr *MockTrustManagerMockRecorder) Untrust(credentialType, arg1 any) *gomock.Call

Untrust indicates an expected call of Untrust.

func (*MockTrustManagerMockRecorder) Untrusted

func (mr *MockTrustManagerMockRecorder) Untrusted(credentialType any) *gomock.Call

Untrusted indicates an expected call of Untrusted.

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

func (m *MockVCR) GetOpenIDHolder(ctx context.Context, id did.DID) (holder.OpenIDHandler, error)

GetOpenIDHolder mocks base method.

func (*MockVCR) GetOpenIDIssuer

func (m *MockVCR) GetOpenIDIssuer(ctx context.Context, id did.DID) (issuer.OpenIDHandler, error)

GetOpenIDIssuer mocks base method.

func (*MockVCR) Issuer

func (m *MockVCR) Issuer() issuer.Issuer

Issuer mocks base method.

func (*MockVCR) OpenID4VCIEnabled

func (m *MockVCR) OpenID4VCIEnabled() bool

OpenID4VCIEnabled mocks base method.

func (*MockVCR) Resolve

func (m *MockVCR) Resolve(ID ssi.URI, resolveTime *time.Time) (*vc.VerifiableCredential, error)

Resolve 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

func (m *MockVCR) StoreCredential(arg0 vc.VerifiableCredential, validAt *time.Time) error

StoreCredential mocks base method.

func (*MockVCR) Trust

func (m *MockVCR) Trust(credentialType, arg1 ssi.URI) error

Trust mocks base method.

func (*MockVCR) Trusted

func (m *MockVCR) Trusted(credentialType ssi.URI) ([]ssi.URI, error)

Trusted mocks base method.

func (*MockVCR) Untrust

func (m *MockVCR) Untrust(credentialType, arg1 ssi.URI) error

Untrust mocks base method.

func (*MockVCR) Untrusted

func (m *MockVCR) Untrusted(credentialType ssi.URI) ([]ssi.URI, error)

Untrusted mocks base method.

func (*MockVCR) Verifier

func (m *MockVCR) Verifier() verifier.Verifier

Verifier mocks base method.

func (*MockVCR) Wallet

func (m *MockVCR) Wallet() holder.Wallet

Wallet 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

type SearchTerm struct {
	IRIPath []string
	Value   interface{}
	Type    string
}

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

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.
pe
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.

Jump to

Keyboard shortcuts

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