Documentation ¶
Overview ¶
Package context creates a framework Provider context to add optional (non default) framework services and provides simple accessor methods to those same services.
Index ¶
- type InboundEnvelopeHandler
- type Provider
- func (p *Provider) AllServices() []dispatcher.ProtocolService
- func (p *Provider) AriesFrameworkID() string
- func (p *Provider) ConnectionLookup() *connection.Lookup
- func (p *Provider) Crypto() crypto.Crypto
- func (p *Provider) DIDConnectionStore() did.ConnectionStore
- func (p *Provider) DIDRotator() *middleware.DIDCommMessageMiddleware
- func (p *Provider) GetDIDsBackOffDuration() time.Duration
- func (p *Provider) GetDIDsMaxRetries() uint64
- func (p *Provider) InboundDIDCommMessageHandler() func() service.InboundHandler
- func (p *Provider) InboundMessageHandler() transport.InboundMessageHandler
- func (p *Provider) InboundMessenger() service.InboundMessenger
- func (p *Provider) JSONLDContextStore() ld.ContextStore
- func (p *Provider) JSONLDDocumentLoader() jsonld.DocumentLoader
- func (p *Provider) JSONLDRemoteProviderStore() ld.RemoteProviderStore
- func (p *Provider) KMS() kms.KeyManager
- func (p *Provider) KeyAgreementType() kms.KeyType
- func (p *Provider) KeyType() kms.KeyType
- func (p *Provider) MediaTypeProfiles() []string
- func (p *Provider) MessageServiceProvider() api.MessageServiceProvider
- func (p *Provider) Messenger() service.Messenger
- func (p *Provider) OutboundDispatcher() dispatcher.Outbound
- func (p *Provider) OutboundTransports() []transport.OutboundTransport
- func (p *Provider) Packager() transport.Packager
- func (p *Provider) Packers() []packer.Packer
- func (p *Provider) PrimaryPacker() packer.Packer
- func (p *Provider) ProtocolStateStorageProvider() storage.Provider
- func (p *Provider) RouterEndpoint() string
- func (p *Provider) SecretLock() secretlock.Service
- func (p *Provider) Service(id string) (interface{}, error)
- func (p *Provider) ServiceEndpoint() string
- func (p *Provider) ServiceMsgTypeTargets() []dispatcher.MessageTypeTarget
- func (p *Provider) StorageProvider() storage.Provider
- func (p *Provider) TransportReturnRoute() string
- func (p *Provider) VDRegistry() vdrapi.Registry
- func (p *Provider) VerifiableStore() verifiable.Store
- type ProviderOption
- func WithAriesFrameworkID(id string) ProviderOption
- func WithCrypto(c crypto.Crypto) ProviderOption
- func WithDIDConnectionStore(store did.ConnectionStore) ProviderOption
- func WithDIDRotator(didRotator *middleware.DIDCommMessageMiddleware) ProviderOption
- func WithGetDIDsBackOffDuration(duration time.Duration) ProviderOption
- func WithGetDIDsMaxRetries(retries uint64) ProviderOption
- func WithInboundEnvelopeHandler(handler InboundEnvelopeHandler) ProviderOption
- func WithJSONLDContextStore(store ld.ContextStore) ProviderOption
- func WithJSONLDDocumentLoader(loader jsonld.DocumentLoader) ProviderOption
- func WithJSONLDRemoteProviderStore(store ld.RemoteProviderStore) ProviderOption
- func WithKMS(k kms.KeyManager) ProviderOption
- func WithKeyAgreementType(keyAgreementType kms.KeyType) ProviderOption
- func WithKeyType(keyType kms.KeyType) ProviderOption
- func WithMediaTypeProfiles(mediaTypeProfiles []string) ProviderOption
- func WithMessageServiceProvider(msv api.MessageServiceProvider) ProviderOption
- func WithMessengerHandler(mh service.MessengerHandler) ProviderOption
- func WithOutboundDispatcher(outboundDispatcher dispatcher.Outbound) ProviderOption
- func WithOutboundTransports(transports ...transport.OutboundTransport) ProviderOption
- func WithPackager(p transport.Packager) ProviderOption
- func WithPacker(primary packer.Packer, additionalPackers ...packer.Packer) ProviderOption
- func WithProtocolServices(services ...dispatcher.ProtocolService) ProviderOption
- func WithProtocolStateStorageProvider(s storage.Provider) ProviderOption
- func WithRouterEndpoint(endpoint string) ProviderOption
- func WithSecretLock(s secretlock.Service) ProviderOption
- func WithServiceEndpoint(endpoint string) ProviderOption
- func WithServiceMsgTypeTargets(msgTypeTargets ...dispatcher.MessageTypeTarget) ProviderOption
- func WithStorageProvider(s storage.Provider) ProviderOption
- func WithTransportReturnRoute(transportReturnRoute string) ProviderOption
- func WithVDRegistry(vdr vdrapi.Registry) ProviderOption
- func WithVerifiableStore(store verifiable.Store) ProviderOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InboundEnvelopeHandler ¶ added in v0.1.8
type InboundEnvelopeHandler interface { // HandleInboundEnvelope handles an inbound envelope. HandleInboundEnvelope(envelope *transport.Envelope) error // HandlerFunc provides the transport.InboundMessageHandler of the given InboundEnvelopeHandler. HandlerFunc() transport.InboundMessageHandler }
InboundEnvelopeHandler handles inbound envelopes, processing then dispatching to a protocol service based on the message type.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider supplies the framework configuration to client objects.
func New ¶
func New(opts ...ProviderOption) (*Provider, error)
New instantiates a new context provider.
func (*Provider) AllServices ¶ added in v0.1.8
func (p *Provider) AllServices() []dispatcher.ProtocolService
AllServices returns a copy of the Provider's list of ProtocolServices.
func (*Provider) AriesFrameworkID ¶ added in v0.1.1
AriesFrameworkID returns an inbound transport endpoint.
func (*Provider) ConnectionLookup ¶ added in v0.1.8
func (p *Provider) ConnectionLookup() *connection.Lookup
ConnectionLookup returns a connection.Lookup initialized on this context's stores.
func (*Provider) DIDConnectionStore ¶ added in v0.1.7
func (p *Provider) DIDConnectionStore() did.ConnectionStore
DIDConnectionStore returns a DID connection store.
func (*Provider) DIDRotator ¶ added in v0.1.8
func (p *Provider) DIDRotator() *middleware.DIDCommMessageMiddleware
DIDRotator returns the didcomm/v2 connection DID rotation service.
func (*Provider) GetDIDsBackOffDuration ¶ added in v0.1.8
GetDIDsBackOffDuration returns get DIDs backoff duration.
func (*Provider) GetDIDsMaxRetries ¶ added in v0.1.8
GetDIDsMaxRetries returns get DIDs max retries.
func (*Provider) InboundDIDCommMessageHandler ¶ added in v0.1.7
func (p *Provider) InboundDIDCommMessageHandler() func() service.InboundHandler
InboundDIDCommMessageHandler provides a supplier of inbound handlers with all loaded protocol services.
func (*Provider) InboundMessageHandler ¶
func (p *Provider) InboundMessageHandler() transport.InboundMessageHandler
InboundMessageHandler return an inbound message handler.
func (*Provider) InboundMessenger ¶ added in v0.1.8
func (p *Provider) InboundMessenger() service.InboundMessenger
InboundMessenger returns inbound messenger.
func (*Provider) JSONLDContextStore ¶ added in v0.1.7
func (p *Provider) JSONLDContextStore() ld.ContextStore
JSONLDContextStore returns a JSON-LD context store.
func (*Provider) JSONLDDocumentLoader ¶ added in v0.1.7
func (p *Provider) JSONLDDocumentLoader() jsonld.DocumentLoader
JSONLDDocumentLoader returns a JSON-LD document loader.
func (*Provider) JSONLDRemoteProviderStore ¶ added in v0.1.7
func (p *Provider) JSONLDRemoteProviderStore() ld.RemoteProviderStore
JSONLDRemoteProviderStore returns a remote JSON-LD context provider store.
func (*Provider) KMS ¶
func (p *Provider) KMS() kms.KeyManager
KMS returns a Key Management Service.
func (*Provider) KeyAgreementType ¶ added in v0.1.7
KeyAgreementType returns the default Key type (encryption).
func (*Provider) KeyType ¶ added in v0.1.7
KeyType returns the default Key type (signing/authentication).
func (*Provider) MediaTypeProfiles ¶ added in v0.1.7
MediaTypeProfiles returns the default media types profile.
func (*Provider) MessageServiceProvider ¶ added in v0.1.8
func (p *Provider) MessageServiceProvider() api.MessageServiceProvider
MessageServiceProvider returns a provider of message services.
func (*Provider) OutboundDispatcher ¶
func (p *Provider) OutboundDispatcher() dispatcher.Outbound
OutboundDispatcher returns an outbound dispatcher.
func (*Provider) OutboundTransports ¶
func (p *Provider) OutboundTransports() []transport.OutboundTransport
OutboundTransports returns an outbound transports.
func (*Provider) PrimaryPacker ¶
PrimaryPacker returns the main inbound/outbound Packer service.
func (*Provider) ProtocolStateStorageProvider ¶ added in v0.1.4
ProtocolStateStorageProvider return a protocol state storage provider.
func (*Provider) RouterEndpoint ¶ added in v0.1.2
RouterEndpoint returns a router transport endpoint. The router gives this endpoint to the requester agent during route registration. The requester agent can use as it's service endpoint. The router checks the forward message to routes the message based on the recipient keys(if registered).
func (*Provider) SecretLock ¶ added in v0.1.2
func (p *Provider) SecretLock() secretlock.Service
SecretLock returns a secret lock service.
func (*Provider) ServiceEndpoint ¶ added in v0.1.2
ServiceEndpoint returns an service endpoint. This endpoint is used in Out-Of-Band messages, DID Exchange Invitations or DID Document service to send messages to the agent.
func (*Provider) ServiceMsgTypeTargets ¶ added in v0.1.8
func (p *Provider) ServiceMsgTypeTargets() []dispatcher.MessageTypeTarget
ServiceMsgTypeTargets returns list of service message types of context protocol services based mapping for the given targets.
func (*Provider) StorageProvider ¶
StorageProvider return a storage provider.
func (*Provider) TransportReturnRoute ¶ added in v0.1.1
TransportReturnRoute returns transport return route.
func (*Provider) VDRegistry ¶ added in v0.1.5
VDRegistry returns a vdr registry.
func (*Provider) VerifiableStore ¶ added in v0.1.4
func (p *Provider) VerifiableStore() verifiable.Store
VerifiableStore returns a verifiable credential store.
type ProviderOption ¶
ProviderOption configures the framework.
func WithAriesFrameworkID ¶ added in v0.1.1
func WithAriesFrameworkID(id string) ProviderOption
WithAriesFrameworkID injects the framework ID into the context. This is used to tie different framework components. The client can have multiple framework and with same instance of transport shared across it and this id is used by the framework to tie the inbound transport and outbound transports (in case of duplex communication).
func WithCrypto ¶ added in v0.1.1
func WithCrypto(c crypto.Crypto) ProviderOption
WithCrypto injects a Crypto service into the context.
func WithDIDConnectionStore ¶ added in v0.1.7
func WithDIDConnectionStore(store did.ConnectionStore) ProviderOption
WithDIDConnectionStore injects a DID connection store into the context.
func WithDIDRotator ¶ added in v0.1.8
func WithDIDRotator(didRotator *middleware.DIDCommMessageMiddleware) ProviderOption
WithDIDRotator injects a DID rotator into the context.
func WithGetDIDsBackOffDuration ¶ added in v0.1.7
func WithGetDIDsBackOffDuration(duration time.Duration) ProviderOption
WithGetDIDsBackOffDuration sets backoff duration.
func WithGetDIDsMaxRetries ¶ added in v0.1.7
func WithGetDIDsMaxRetries(retries uint64) ProviderOption
WithGetDIDsMaxRetries sets max retries.
func WithInboundEnvelopeHandler ¶ added in v0.1.8
func WithInboundEnvelopeHandler(handler InboundEnvelopeHandler) ProviderOption
WithInboundEnvelopeHandler injects a handler for inbound message envelopes.
func WithJSONLDContextStore ¶ added in v0.1.7
func WithJSONLDContextStore(store ld.ContextStore) ProviderOption
WithJSONLDContextStore injects a JSON-LD context store into the context.
func WithJSONLDDocumentLoader ¶ added in v0.1.7
func WithJSONLDDocumentLoader(loader jsonld.DocumentLoader) ProviderOption
WithJSONLDDocumentLoader injects a JSON-LD document loader into the context.
func WithJSONLDRemoteProviderStore ¶ added in v0.1.7
func WithJSONLDRemoteProviderStore(store ld.RemoteProviderStore) ProviderOption
WithJSONLDRemoteProviderStore injects a JSON-LD remote provider store into the context.
func WithKMS ¶
func WithKMS(k kms.KeyManager) ProviderOption
WithKMS injects a kms service into the context.
func WithKeyAgreementType ¶ added in v0.1.7
func WithKeyAgreementType(keyAgreementType kms.KeyType) ProviderOption
WithKeyAgreementType injects a keyType for KeyAgreement into the context.
func WithKeyType ¶ added in v0.1.7
func WithKeyType(keyType kms.KeyType) ProviderOption
WithKeyType injects a keyType for authentication (signing) into the context.
func WithMediaTypeProfiles ¶ added in v0.1.7
func WithMediaTypeProfiles(mediaTypeProfiles []string) ProviderOption
WithMediaTypeProfiles injects a media type profile into the context.
func WithMessageServiceProvider ¶ added in v0.1.1
func WithMessageServiceProvider(msv api.MessageServiceProvider) ProviderOption
WithMessageServiceProvider injects a message service provider into the context.
func WithMessengerHandler ¶ added in v0.1.1
func WithMessengerHandler(mh service.MessengerHandler) ProviderOption
WithMessengerHandler injects the messenger into the context.
func WithOutboundDispatcher ¶
func WithOutboundDispatcher(outboundDispatcher dispatcher.Outbound) ProviderOption
WithOutboundDispatcher injects an outbound dispatcher into the context.
func WithOutboundTransports ¶ added in v0.1.1
func WithOutboundTransports(transports ...transport.OutboundTransport) ProviderOption
WithOutboundTransports injects an outbound transports into the context.
func WithPackager ¶
func WithPackager(p transport.Packager) ProviderOption
WithPackager injects a packager into the context.
func WithPacker ¶
func WithPacker(primary packer.Packer, additionalPackers ...packer.Packer) ProviderOption
WithPacker injects at least one Packer into the context, with the primary Packer being used for inbound/outbound communication and the additional packers being available for unpacking inbound messages.
func WithProtocolServices ¶
func WithProtocolServices(services ...dispatcher.ProtocolService) ProviderOption
WithProtocolServices injects a protocol services into the context.
func WithProtocolStateStorageProvider ¶ added in v0.1.4
func WithProtocolStateStorageProvider(s storage.Provider) ProviderOption
WithProtocolStateStorageProvider injects a protocol state storage provider into the context.
func WithRouterEndpoint ¶ added in v0.1.2
func WithRouterEndpoint(endpoint string) ProviderOption
WithRouterEndpoint injects an router transport endpoint into the context.
func WithSecretLock ¶ added in v0.1.2
func WithSecretLock(s secretlock.Service) ProviderOption
WithSecretLock injects a secret lock service into the context.
func WithServiceEndpoint ¶ added in v0.1.2
func WithServiceEndpoint(endpoint string) ProviderOption
WithServiceEndpoint injects an service transport endpoint into the context.
func WithServiceMsgTypeTargets ¶ added in v0.1.8
func WithServiceMsgTypeTargets(msgTypeTargets ...dispatcher.MessageTypeTarget) ProviderOption
WithServiceMsgTypeTargets injects service msg type to target mappings in the context.
func WithStorageProvider ¶
func WithStorageProvider(s storage.Provider) ProviderOption
WithStorageProvider injects a storage provider into the context.
func WithTransportReturnRoute ¶ added in v0.1.1
func WithTransportReturnRoute(transportReturnRoute string) ProviderOption
WithTransportReturnRoute injects transport return route option to the Aries framework.
func WithVDRegistry ¶ added in v0.1.5
func WithVDRegistry(vdr vdrapi.Registry) ProviderOption
WithVDRegistry injects a vdr service into the context.
func WithVerifiableStore ¶ added in v0.1.4
func WithVerifiableStore(store verifiable.Store) ProviderOption
WithVerifiableStore injects a verifiable credential store.