api

package
v0.0.0-...-64dd8ac Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AriesController

type AriesController interface {

	// GetIntroduceController returns an implementation of IntroduceController
	GetIntroduceController() (IntroduceController, error)

	// GetVerifiableController returns an implementation of VerifiableController
	GetVerifiableController() (VerifiableController, error)

	// GetIssueCredentialController returns an implementation of IssueCredentialController
	GetIssueCredentialController() (IssueCredentialController, error)

	// GetPresentProofController returns an implementation of PresentProofController
	GetPresentProofController() (PresentProofController, error)

	// GetDIDExchangeController returns an implementation of DIDExchangeController
	GetDIDExchangeController() (DIDExchangeController, error)

	// GetVDRController returns an implementation of VDRController
	GetVDRController() (VDRController, error)

	// GetMediatorController returns an implementation of MediatorController
	GetMediatorController() (MediatorController, error)

	// GetMessagingController returns an implementation of MessagingController
	GetMessagingController() (MessagingController, error)

	// GetOutOfBandController returns an implementation of OutOfBandController
	GetOutOfBandController() (OutOfBandController, error)

	// GetKMSController returns an implementation of KMSController
	GetKMSController() (KMSController, error)

	// GetLDController returns an implementation of LDController
	GetLDController() (LDController, error)

	// GetVCWalletController returns an implementation of VCWalletController
	GetVCWalletController() (VCWalletController, error)

	// RegisterHandler registers handler for handling notifications
	RegisterHandler(h Handler, topics string) string

	// UnregisterHandler unregisters handler
	UnregisterHandler(id string)
}

AriesController provides Aries agent protocols tailored to mobile platforms.

type DIDExchangeController

type DIDExchangeController interface {

	// CreateInvitation creates a new connection invitation.
	CreateInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// ReceiveInvitation receives a new connection invitation.
	ReceiveInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptInvitation accepts a stored connection invitation.
	AcceptInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// CreateImplicitInvitation creates implicit invitation using inviter DID.
	CreateImplicitInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptExchangeRequest accepts a stored connection request.
	AcceptExchangeRequest(request *models.RequestEnvelope) *models.ResponseEnvelope

	// QueryConnections queries agent to agent connections.
	QueryConnections(request *models.RequestEnvelope) *models.ResponseEnvelope

	// QueryConnectionByID fetches a single connection record by connection ID.
	QueryConnectionByID(request *models.RequestEnvelope) *models.ResponseEnvelope

	// CreateConnection creates a new connection record in completed state and returns the generated connectionID.
	CreateConnection(request *models.RequestEnvelope) *models.ResponseEnvelope

	// RemoveConnection removes given connection record.
	RemoveConnection(request *models.RequestEnvelope) *models.ResponseEnvelope
}

DIDExchangeController defines methods for the DIDExchange protocol controller.

type Handler

type Handler interface {
	Handle(topic string, message []byte) error
}

Handler handles notification from the framework USAGE: The client e.g (android, IOS) must implement this interface to be able to process the notifications from the framework. The handle method plays a callback function role.

type IntroduceController

type IntroduceController interface {

	// Actions returns unfinished actions for the async usage.
	Actions(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SendProposal sends a proposal to the introducees (the client has not published an out-of-band message)
	SendProposal(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SendProposalWithOOBInvitation sends a proposal to the introducee (the client has published an out-of-band request)
	SendProposalWithOOBInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SendRequest sends a request showing that the introducee is willing to share their own out-of-band message
	SendRequest(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptProposalWithOOBInvitation is used when introducee wants to provide an out-of-band request
	AcceptProposalWithOOBInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptProposal is used when introducee wants to accept a proposal without providing a OOBRequest
	AcceptProposal(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptRequestWithPublicOOBInvitation is used when introducer wants to provide a published out-of-band request
	AcceptRequestWithPublicOOBInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptRequestWithRecipients is used when the introducer does not have a published out-of-band message on hand
	// but they are willing to introduce agents to each other
	AcceptRequestWithRecipients(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclineProposal is used to reject the proposal
	DeclineProposal(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclineRequest is used to reject the request
	DeclineRequest(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptProblemReport is used for accepting problem report.
	AcceptProblemReport(request *models.RequestEnvelope) *models.ResponseEnvelope
}

IntroduceController defines methods for the introduce protocol controller.

type IssueCredentialController

type IssueCredentialController interface {

	// Actions returns pending actions that have not yet to be executed or canceled.
	Actions(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SendOffer is used by the Issuer to send an offer.
	SendOffer(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SendProposal is used by the Holder to send a proposal.
	SendProposal(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SendRequest is used by the Holder to send a request.
	SendRequest(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptProposal is used when the Issuer is willing to accept the proposal.
	AcceptProposal(request *models.RequestEnvelope) *models.ResponseEnvelope

	// NegotiateProposal is used when the Holder wants to negotiate about an offer he received.
	NegotiateProposal(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclineProposal is used when the Issuer does not want to accept the proposal.
	DeclineProposal(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptOffer is used when the Holder is willing to accept the offer.
	AcceptOffer(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptProblemReport is used for accepting problem report.
	AcceptProblemReport(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclineOffer is used when the Holder does not want to accept the offer.
	DeclineOffer(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptRequest is used when the Issuer is willing to accept the request.
	AcceptRequest(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclineRequest is used when the Issuer does not want to accept the request.
	DeclineRequest(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptCredential is used when the Holder is willing to accept the IssueCredential.
	AcceptCredential(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclineCredential is used when the Holder does not want to accept the IssueCredential.
	DeclineCredential(request *models.RequestEnvelope) *models.ResponseEnvelope
}

IssueCredentialController defines methods for the IssueCredential protocol controller.

type Iterator

type Iterator interface {
	// Next moves the pointer to the next entry in the iterator. It returns false if the iterator is exhausted.
	Next() (bool, error)

	// Key returns the key of the current entry.
	Key() (string, error)

	// Value returns the value of the current entry.
	Value() ([]byte, error)

	// Tags returns the tags associated with the key of the current entry.
	// The returned array of bytes is expected to be JSON that can be unmarshalled to an array of
	// aries-framework-go/spi/storage/Tag.
	Tags() ([]byte, error)

	// Close closes this iterator object, freeing resources.
	Close() error
}

Iterator allows for iteration over a collection of entries in a store.

type KMSController

type KMSController interface {

	// CreateKeySet create a new public/private encryption and signature key pairs set.
	CreateKeySet(request *models.RequestEnvelope) *models.ResponseEnvelope

	// ImportKey imports a key.
	ImportKey(request *models.RequestEnvelope) *models.ResponseEnvelope
}

KMSController defines methods for the KMS controller.

type LDController

type LDController interface {
	// AddContexts adds JSON-LD contexts to the underlying storage.
	AddContexts(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AddRemoteProvider adds remote provider and JSON-LD contexts from that provider.
	AddRemoteProvider(request *models.RequestEnvelope) *models.ResponseEnvelope

	// RefreshRemoteProvider updates contexts from the remote provider.
	RefreshRemoteProvider(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeleteRemoteProvider deletes remote provider and contexts from that provider.
	DeleteRemoteProvider(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GetAllRemoteProviders gets all remote providers.
	GetAllRemoteProviders(request *models.RequestEnvelope) *models.ResponseEnvelope

	// RefreshAllRemoteProviders updates contexts from all remote providers.
	RefreshAllRemoteProviders(request *models.RequestEnvelope) *models.ResponseEnvelope
}

LDController defines methods for the JSON-LD controller.

type Logger

type Logger interface {
	Fatal(msg string)
	Panic(msg string)
	Debug(msg string)
	Info(msg string)
	Warn(msg string)
	Error(msg string)
}

Logger - logger interface.

type LoggerProvider

type LoggerProvider interface {
	GetLogger(module string) Logger
}

LoggerProvider is a factory for moduled loggers.

type MediatorController

type MediatorController interface {

	// Register registers the agent with the router.
	Register(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Unregister unregisters the agent with the router.
	Unregister(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Connections returns router`s connections.
	Connections(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Reconnect sends noop message to given mediator connection to re-establish network connection
	Reconnect(request *models.RequestEnvelope) *models.ResponseEnvelope

	// ReconnectAll Reconnect sends noop message to all mediator connection to re-establish network connections.
	ReconnectAll(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Status returns details about pending messages for given connection.
	Status(request *models.RequestEnvelope) *models.ResponseEnvelope

	// BatchPickup dispatches pending messages for given connection.
	BatchPickup(request *models.RequestEnvelope) *models.ResponseEnvelope
}

MediatorController defines methods for the Mediator controller.

type MessagingController

type MessagingController interface {

	// RegisterService registers new message service to message handler registrar.
	RegisterService(request *models.RequestEnvelope) *models.ResponseEnvelope

	// UnregisterService unregisters given message service handler registrar.
	UnregisterService(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Services returns list of registered service names.
	Services(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Send sends new message to destination provided.
	Send(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Reply sends reply to existing message.
	Reply(request *models.RequestEnvelope) *models.ResponseEnvelope

	// RegisterHTTPService registers new http over didcomm service to message handler registrar.
	RegisterHTTPService(request *models.RequestEnvelope) *models.ResponseEnvelope
}

MessagingController defines methods for the Messaging controller.

type OutOfBandController

type OutOfBandController interface {
	// CreateInvitation creates and saves an out-of-band invitation.
	CreateInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptInvitation from another agent and return the ID of the new connection records.
	AcceptInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Actions returns pending actions that have not yet to be executed or canceled.
	Actions(request *models.RequestEnvelope) *models.ResponseEnvelope

	// ActionContinue allows continuing with the protocol after an action event was triggered.
	ActionContinue(request *models.RequestEnvelope) *models.ResponseEnvelope

	// ActionStop stops the protocol after an action event was triggered.
	ActionStop(request *models.RequestEnvelope) *models.ResponseEnvelope
}

OutOfBandController defines methods for the out-of-band protocol controller.

type OutOfBandV2Controller

type OutOfBandV2Controller interface {
	// CreateInvitation creates and saves an out-of-band invitation.
	CreateInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptInvitation from another agent and return the ID of the new connection records.
	AcceptInvitation(request *models.RequestEnvelope) *models.ResponseEnvelope
}

OutOfBandV2Controller defines methods for the out-of-band/2.0 protocol controller.

type PresentProofController

type PresentProofController interface {

	// Actions returns pending actions that have not yet to be executed or canceled.
	Actions(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SendRequestPresentation is used by the Verifier to send a request presentation.
	SendRequestPresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SendProposePresentation is used by the Prover to send a propose presentation.
	SendProposePresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptRequestPresentation is used by the Prover is to accept a presentation request.
	AcceptRequestPresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// NegotiateRequestPresentation is used by the Prover to counter a presentation request they received with a proposal.
	NegotiateRequestPresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclineRequestPresentation is used when the Prover does not want to accept the request presentation.
	DeclineRequestPresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptProposePresentation is used when the Verifier is willing to accept the propose presentation.
	AcceptProposePresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclineProposePresentation is used when the Verifier does not want to accept the propose presentation.
	DeclineProposePresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptPresentation is used by the Verifier to accept a presentation.
	AcceptPresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// AcceptProblemReport is used for accepting problem report.
	AcceptProblemReport(request *models.RequestEnvelope) *models.ResponseEnvelope

	// DeclinePresentation is used by the Verifier to decline a presentation.
	DeclinePresentation(request *models.RequestEnvelope) *models.ResponseEnvelope
}

PresentProofController defines methods for the PresentProof protocol controller.

type Provider

type Provider interface {
	// OpenStore opens a store with the given name and returns a handle.
	// If the store has never been opened before, then it is created.
	// Store names are not case-sensitive. If name is blank, then an error will be returned.
	OpenStore(name string) (Store, error)

	// SetStoreConfig sets the configuration on a store.
	// The "config" argument must be JSON representing a of aries-framework-go/spi/storage/StoreConfiguration.
	// The store must be created prior to calling this method.
	// If the store cannot be found, then an error wrapping ErrStoreNotFound will be returned.
	// If name is blank, then an error will be returned.
	SetStoreConfig(name string, config []byte) error

	// GetStoreConfig gets the current store configuration.
	// The store must be created prior to calling this method.
	// If the store cannot be found, then an error wrapping ErrStoreNotFound will be returned.
	// If name is blank, then an error will be returned.
	// The returned array of bytes is expected to be JSON that can be unmarshalled to a
	// aries-framework-go/spi/storage/StoreConfiguration.
	GetStoreConfig(name string) ([]byte, error)

	// Close closes all stores created under this store provider.
	// For persistent store implementations, this does not delete any data in the stores.
	Close() error
}

Provider represents a storage provider.

type Store

type Store interface {
	// Put stores the key + value pair along with the (optional) tags.
	// The "tags" argument is optional, but if present,
	// must be JSON representing an array of aries-framework-go/spi/storage/Tag.
	// If key is empty or value is nil, then an error will be returned.
	Put(key string, value, tags []byte) error

	// Get fetches the value associated with the given key.
	// If key cannot be found, then an error wrapping ErrDataNotFound will be returned.
	// If key is empty, then an error will be returned.
	Get(key string) ([]byte, error)

	// Get fetches all tags associated with the given key.
	// If key cannot be found, then an error wrapping ErrDataNotFound will be returned.
	// If key is empty, then an error will be returned.
	// The returned array of bytes is expected to be JSON that can be unmarshalled to an array of
	// aries-framework-go/spi/storage/Tag.
	GetTags(key string) ([]byte, error)

	// GetBulk fetches the values associated with the given keys.
	// If no data exists under a given key, then a nil []byte is returned for that value. It is not considered an error.
	// Depending on the implementation, this method may be faster than calling Get for each key individually.
	// The "keys" argument must be JSON representing an array of strings, one for each key.
	// If any of the given keys are empty, then an error will be returned.
	// The returned array of bytes is expected to be a JSON representation of the values, one for each key, that can
	// be unmarshalled to a [][]byte.
	GetBulk(keys []byte) ([]byte, error)

	// Query returns all data that satisfies the expression. Expression format: TagName:TagValue.
	// If TagValue is not provided, then all data associated with the TagName will be returned.
	// For now, expression can only be a single tag Name + Value pair.
	// PageSize sets the maximum page size for data retrievals done within the Iterator returned by the Query call.
	// Paging is handled internally by the Iterator. Higher values may reduce CPU time and the number of database calls at
	// the expense of higher memory usage.
	Query(expression string, pageSize int) (Iterator, error)

	// Delete deletes the key + value pair (and all tags) associated with key.
	// If key is empty, then an error will be returned.
	Delete(key string) error

	// Batch performs multiple Put and/or Delete operations in order.
	// Depending on the implementation, this method may be faster than repeated Put and/or Delete calls.
	// The "operations" argument must be JSON representing an array of aries-framework-go/spi/storage/Operation.
	// If any of the given keys are empty, then an error will be returned.
	Batch(operations []byte) error

	// Flush forces any queued up Put and/or Delete operations to execute.
	// If the Store implementation doesn't queue up operations, then this method is a no-op.
	Flush() error

	// Close closes this store object, freeing resources. For persistent store implementations, this does not delete
	// any data in the underlying databases.
	Close() error
}

Store represents a storage database.

type VCWalletController

type VCWalletController interface {

	// Creates new wallet profile and returns error if wallet profile is already created.
	CreateProfile(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Updates an existing wallet profile and returns error if profile doesn't exists.
	UpdateProfile(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Checks if profile exists for given wallet user.
	ProfileExists(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Unlocks given wallet's key manager instance & content store and
	// returns a authorization token to be used for performing wallet operations.
	Open(request *models.RequestEnvelope) *models.ResponseEnvelope

	// Expires token issued to this VC wallet, removes wallet's key manager instance and closes wallet content store.
	// returns response containing bool flag false if token is not found or already expired for this wallet user.
	Close(request *models.RequestEnvelope) *models.ResponseEnvelope

	// adds given data model to wallet content store.
	Add(request *models.RequestEnvelope) *models.ResponseEnvelope

	// removes given content from wallet content store.
	Remove(request *models.RequestEnvelope) *models.ResponseEnvelope

	// gets content from wallet content store.
	Get(request *models.RequestEnvelope) *models.ResponseEnvelope

	// gets all contents from wallet content store for given content type.
	GetAll(request *models.RequestEnvelope) *models.ResponseEnvelope

	// runs query against wallet credential contents and returns presentation containing credential results.
	Query(request *models.RequestEnvelope) *models.ResponseEnvelope

	// adds proof to a Verifiable Credential.
	Issue(request *models.RequestEnvelope) *models.ResponseEnvelope

	// produces a Verifiable Presentation.
	Prove(request *models.RequestEnvelope) *models.ResponseEnvelope

	// verifies a Verifiable Credential or a Verifiable Presentation.
	Verify(request *models.RequestEnvelope) *models.ResponseEnvelope

	// derives a Verifiable Credential.
	Derive(request *models.RequestEnvelope) *models.ResponseEnvelope

	// creates a key pair from wallet.
	CreateKeyPair(request *models.RequestEnvelope) *models.ResponseEnvelope

	// accepts out-of-band invitations and performs DID exchange.
	Connect(request *models.RequestEnvelope) *models.ResponseEnvelope

	// accepts out-of-band invitation and sends message proposing presentation
	// from wallet to relying party.
	ProposePresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// sends message present proof message from wallet to relying party.
	PresentProof(request *models.RequestEnvelope) *models.ResponseEnvelope
}

VCWalletController is a Verifiable Credential Wallet based on Universal Wallet 2020 https://w3c-ccg.github.io/universal-wallet-interop-spec/#interface.

type VDRController

type VDRController interface {

	// ResolveDID resolve did.
	ResolveDID(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SaveDID saves the did doc to the store.
	SaveDID(request *models.RequestEnvelope) *models.ResponseEnvelope

	// CreateDID create the did doc.
	CreateDID(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GetDID retrieves the did from the store.
	GetDID(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GetDIDRecords retrieves the did doc containing name and didID.
	GetDIDRecords(request *models.RequestEnvelope) *models.ResponseEnvelope
}

VDRController defines methods for the VDR controller.

type VerifiableController

type VerifiableController interface {

	// ValidateCredential validates the verifiable credential.
	ValidateCredential(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SaveCredential saves the verifiable credential to the store.
	SaveCredential(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SavePresentation saves the presentation to the store.
	SavePresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GetCredential retrieves the verifiable credential from the store.
	GetCredential(request *models.RequestEnvelope) *models.ResponseEnvelope

	// SignCredential adds proof to given verifiable credential.
	SignCredential(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GetPresentation retrieves the verifiable presentation from the store.
	GetPresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GetCredentialByName retrieves the verifiable credential by name from the store.
	GetCredentialByName(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GetCredentials retrieves the verifiable credential records containing name and fields of interest.
	GetCredentials(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GetPresentations retrieves the verifiable presentation records containing name and fields of interest.
	GetPresentations(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GeneratePresentation generates a verifiable presentation from a verifiable credential.
	GeneratePresentation(request *models.RequestEnvelope) *models.ResponseEnvelope

	// GeneratePresentationByID generates verifiable presentation from a stored verifiable credential.
	GeneratePresentationByID(request *models.RequestEnvelope) *models.ResponseEnvelope

	// RemoveCredentialByName will remove a VC that matches the specified name from the verifiable store.
	RemoveCredentialByName(request *models.RequestEnvelope) *models.ResponseEnvelope

	// RemovePresentationByName will remove a VP that matches the specified name from the verifiable store.
	RemovePresentationByName(request *models.RequestEnvelope) *models.ResponseEnvelope
}

VerifiableController defines methods for the verifiable controller.

Jump to

Keyboard shortcuts

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