vdr

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: 29 Imported by: 0

Documentation

Overview

Package vdr is a generated GoMock package.

Package vdr contains a verifiable data registry to the w3c specification and provides primitives for storing and working with Nuts DID based identities. It provides an easy to work with web api and a command line interface. It provides underlying storage back ends to store, update and search for Nuts identities.

Index

Constants

View Source
const ModuleName = "VDR"

ModuleName is the name of the engine

Variables

View Source
var TestDIDA = did.MustParseDID("did:nuts:GvkzxsezHvEc8nGhgz6Xo3jbqkHwswLmWw3CYtCm7hAW")

TestDIDA is a testDID

View Source
var TestDIDB = did.MustParseDID("did:nuts:B8PUHs2AUHbFF1xLLK4eZjgErEcMXHxs68FteY7NDtCY")

TestDIDB is a testDID

View Source
var TestMethodDIDA = did.MustParseDIDURL(TestDIDA.String() + "#abc-method-1")

TestMethodDIDA is a test method DID for the TestDIDA

View Source
var TestMethodDIDB, _ = did.ParseDIDURL(TestDIDB.String() + "#abc-method-2")

TestMethodDIDB is a test method DID for the TestDIDB

Functions

func TestMethodDIDAPrivateKey

func TestMethodDIDAPrivateKey() crypto.TestKey

TestMethodDIDAPrivateKey returns the key for TestMethodDIDA

func TestMethodDIDBPrivateKey

func TestMethodDIDBPrivateKey() crypto.TestKey

TestMethodDIDBPrivateKey returns the key for TestMethodDIDB

Types

type DBDocumentOwner

type DBDocumentOwner struct {
	DB *gorm.DB
}

func (DBDocumentOwner) IsOwner

func (D DBDocumentOwner) IsOwner(_ context.Context, d did.DID) (bool, error)

func (DBDocumentOwner) ListOwned

func (D DBDocumentOwner) ListOwned(_ context.Context) ([]did.DID, error)

type MockVDR

type MockVDR struct {
	// contains filtered or unexported fields
}

MockVDR is a mock of VDR interface.

func NewMockVDR

func NewMockVDR(ctrl *gomock.Controller) *MockVDR

NewMockVDR creates a new mock instance.

func (*MockVDR) ConflictedDocuments

func (m *MockVDR) ConflictedDocuments() ([]did.Document, []resolver.DocumentMetadata, error)

ConflictedDocuments mocks base method.

func (*MockVDR) DocumentOwner

func (m *MockVDR) DocumentOwner() didsubject.DocumentOwner

DocumentOwner mocks base method.

func (*MockVDR) EXPECT

func (m *MockVDR) EXPECT() *MockVDRMockRecorder

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

func (*MockVDR) NutsDocumentManager

func (m *MockVDR) NutsDocumentManager() didsubject.DocumentManager

NutsDocumentManager mocks base method.

func (*MockVDR) PublicURL

func (m *MockVDR) PublicURL() *url.URL

PublicURL mocks base method.

func (*MockVDR) ResolveManaged

func (m *MockVDR) ResolveManaged(id did.DID) (*did.Document, error)

ResolveManaged mocks base method.

func (*MockVDR) Resolver

func (m *MockVDR) Resolver() resolver.DIDResolver

Resolver mocks base method.

type MockVDRMockRecorder

type MockVDRMockRecorder struct {
	// contains filtered or unexported fields
}

MockVDRMockRecorder is the mock recorder for MockVDR.

func (*MockVDRMockRecorder) ConflictedDocuments

func (mr *MockVDRMockRecorder) ConflictedDocuments() *gomock.Call

ConflictedDocuments indicates an expected call of ConflictedDocuments.

func (*MockVDRMockRecorder) DocumentOwner

func (mr *MockVDRMockRecorder) DocumentOwner() *gomock.Call

DocumentOwner indicates an expected call of DocumentOwner.

func (*MockVDRMockRecorder) NutsDocumentManager

func (mr *MockVDRMockRecorder) NutsDocumentManager() *gomock.Call

NutsDocumentManager indicates an expected call of NutsDocumentManager.

func (*MockVDRMockRecorder) PublicURL

func (mr *MockVDRMockRecorder) PublicURL() *gomock.Call

PublicURL indicates an expected call of PublicURL.

func (*MockVDRMockRecorder) ResolveManaged

func (mr *MockVDRMockRecorder) ResolveManaged(id any) *gomock.Call

ResolveManaged indicates an expected call of ResolveManaged.

func (*MockVDRMockRecorder) Resolver

func (mr *MockVDRMockRecorder) Resolver() *gomock.Call

Resolver indicates an expected call of Resolver.

type Module

type Module struct {

	// new style DID management
	didsubject.Manager
	// contains filtered or unexported fields
}

Module implements VDR, which stands for the Verifiable Data Registry. It is the public entrypoint to work with W3C DID documents. It connects the Resolve, Create and Update DID methods to the network, and receives events back from the network which are processed in the store. It is also a Runnable, Diagnosable and Configurable Nuts Engine.

func NewVDR

func NewVDR(cryptoClient crypto.KeyStore, networkClient network.Transactions,
	didStore didnutsStore.Store, eventManager events.Event, storageInstance storage.Engine, pkiValidator pki.Validator) *Module

NewVDR creates a new Module with provided params

func (*Module) Configure

func (r *Module) Configure(config core.ServerConfig) error

Configure configures the Module engine.

func (*Module) ConflictedDocuments

func (r *Module) ConflictedDocuments() ([]did.Document, []resolver.DocumentMetadata, error)

func (*Module) Diagnostics

func (r *Module) Diagnostics() []core.DiagnosticResult

Diagnostics returns the diagnostics for this engine

func (*Module) DocumentOwner

func (r *Module) DocumentOwner() didsubject.DocumentOwner

func (*Module) Migrate

func (r *Module) Migrate() error

func (*Module) Name

func (r *Module) Name() string

func (*Module) NutsDocumentManager

func (r *Module) NutsDocumentManager() didsubject.DocumentManager

NutsDocumentManager returns the nuts document manager Deprecated

func (*Module) PublicURL

func (r *Module) PublicURL() *url.URL

func (*Module) Resolve

func (r *Module) Resolve(id did.DID, metadata *resolver.ResolveMetadata) (*did.Document, *resolver.DocumentMetadata, error)

Resolve resolves any DID document which DID method is supported. To only resolve DID documents managed by the local node, use ResolveManaged().

func (*Module) ResolveManaged

func (r *Module) ResolveManaged(id did.DID) (*did.Document, error)

ResolveManaged resolves a DID document that is managed by the local node.

func (*Module) Resolver

func (r *Module) Resolver() resolver.DIDResolver

func (*Module) Shutdown

func (r *Module) Shutdown() error

func (*Module) Start

func (r *Module) Start() error

type MultiDocumentOwner

type MultiDocumentOwner struct {
	DocumentOwners []didsubject.DocumentOwner
}

MultiDocumentOwner check ownage via multiple DocumentOwners. This is to overcome VDR v1 API which can only manipulate did:nuts VDR V1 API does not change the SQL DB state so it has to check private keys.

func (*MultiDocumentOwner) IsOwner

func (m *MultiDocumentOwner) IsOwner(ctx context.Context, d did.DID) (bool, error)

func (*MultiDocumentOwner) ListOwned

func (m *MultiDocumentOwner) ListOwned(ctx context.Context) ([]did.DID, error)

type VDR

type VDR interface {
	// NutsDocumentManager returns the nuts document manager.
	// Deprecated
	NutsDocumentManager() didsubject.DocumentManager
	// DocumentOwner returns the document owner.
	DocumentOwner() didsubject.DocumentOwner

	// ResolveManaged resolves a DID document that is managed by the local node.
	ResolveManaged(id did.DID) (*did.Document, error)
	// Resolver returns the resolver for getting the DID document for a DID.
	Resolver() resolver.DIDResolver
	// ConflictedDocuments returns the DID Document and metadata of all documents with a conflict.
	ConflictedDocuments() ([]did.Document, []resolver.DocumentMetadata, error)
	// PublicURL returns the public URL of the Nuts node, which is used as base URL for web-based DIDs.
	PublicURL() *url.URL
}

VDR defines the public end facing methods for the Verifiable Data Registry.

Directories

Path Synopsis
api
v1
Package v1 provides primitives to interact with the openapi HTTP API.
Package v1 provides primitives to interact with the openapi HTTP API.
v2
Package v2 provides primitives to interact with the openapi HTTP API.
Package v2 provides primitives to interact with the openapi HTTP API.
Package didnuts is a generated GoMock package.
Package didnuts is a generated GoMock package.
didstore
Package didstore is a generated GoMock package.
Package didstore is a generated GoMock package.
Package didsubject is a generated GoMock package.
Package didsubject is a generated GoMock package.
Package resolver is a generated GoMock package.
Package resolver is a generated GoMock package.

Jump to

Keyboard shortcuts

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