Aries Cloud Agent Python Documentation¶
aries_cloudagent package¶
Aries Cloud Agent.
Subpackages¶
aries_cloudagent.admin package¶
Subpackages¶
aries_cloudagent.admin.tests package¶
-
class
aries_cloudagent.admin.tests.test_admin_server.
TestAdminServerApp
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Submodules¶
aries_cloudagent.admin.base_server module¶
Abstract admin server interface.
-
class
aries_cloudagent.admin.base_server.
BaseAdminServer
[source]¶ Bases:
abc.ABC
Admin HTTP server class.
-
add_webhook_target
(target_url: str, topic_filter: Sequence[str] = None, retries: int = None)[source]¶ Add a webhook target.
-
send_webhook
(topic: str, payload: dict)[source]¶ Add a webhook to the queue, to send to all registered targets.
-
aries_cloudagent.admin.error module¶
Admin error classes.
-
exception
aries_cloudagent.admin.error.
AdminError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Base class for Admin-related errors.
-
exception
aries_cloudagent.admin.error.
AdminSetupError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.admin.error.AdminError
Admin server setup or configuration error.
aries_cloudagent.admin.routes module¶
Register default routes.
aries_cloudagent.admin.server module¶
Admin server classes.
-
class
aries_cloudagent.admin.server.
AdminModulesSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Schema for the modules endpoint.
-
result
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.admin.server.
AdminResponder
(send: Coroutine[T_co, T_contra, V_co], webhook: Coroutine[T_co, T_contra, V_co], **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.responder.BaseResponder
Handle outgoing messages from message handlers.
-
class
aries_cloudagent.admin.server.
AdminServer
(host: str, port: int, context: aries_cloudagent.config.injection_context.InjectionContext, outbound_message_router: Coroutine[T_co, T_contra, V_co])[source]¶ Bases:
aries_cloudagent.admin.base_server.BaseAdminServer
Admin HTTP server class.
-
add_webhook_target
(target_url: str, topic_filter: Sequence[str] = None, retries: int = None)[source]¶ Add a webhook target.
-
make_application
() → <sphinx.ext.autodoc.importer._MockObject object at 0x7fef353a65c0>[source]¶ Get the aiohttp application instance.
-
modules_handler
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef353a65c0>)[source]¶ Request handler for the loaded modules list.
Parameters: request – aiohttp request object Returns: The module list response
-
on_startup
(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef353a65c0>)[source]¶ Perform webserver startup actions.
-
redirect_handler
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef353a65c0>)[source]¶ Perform redirect to documentation.
-
send_webhook
(topic: str, payload: dict)[source]¶ Add a webhook to the queue, to send to all registered targets.
-
start
() → None[source]¶ Start the webserver.
Raises: AdminSetupError
– If there was an error starting the webserver
-
status_handler
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef353a65c0>)[source]¶ Request handler for the server status information.
Parameters: request – aiohttp request object Returns: The web response
-
aries_cloudagent.cache package¶
Subpackages¶
Submodules¶
aries_cloudagent.cache.base module¶
Abstract base classes for cache.
-
class
aries_cloudagent.cache.base.
BaseCache
[source]¶ Bases:
abc.ABC
Abstract cache interface.
-
clear
(key: str)[source]¶ Remove an item from the cache, if present.
Parameters: key – the key to remove
-
aries_cloudagent.cache.basic module¶
Basic in-memory cache implementation.
-
class
aries_cloudagent.cache.basic.
BasicCache
[source]¶ Bases:
aries_cloudagent.cache.base.BaseCache
Basic in-memory cache class.
-
clear
(key: str)[source]¶ Remove an item from the cache, if present.
Parameters: key – the key to remove
-
aries_cloudagent.config package¶
Subpackages¶
aries_cloudagent.config.tests package¶
-
class
aries_cloudagent.config.tests.test_injector.
MockInstance
(value, **kwargs)[source]¶ Bases:
object
Submodules¶
aries_cloudagent.config.base module¶
Configuration base classes.
-
class
aries_cloudagent.config.base.
BaseInjector
[source]¶ Bases:
abc.ABC
Base injector class.
-
copy
() → aries_cloudagent.config.base.BaseInjector[source]¶ Produce a copy of the injector instance.
-
inject
(base_cls: type, settings: Mapping[str, object] = None, *, required: bool = True) → object[source]¶ Get the provided instance of a given class identifier.
Parameters: - cls – The base class to retrieve an instance of
- settings – An optional mapping providing configuration to the provider
Returns: An instance of the base class, or None
-
-
class
aries_cloudagent.config.base.
BaseSettings
[source]¶ Bases:
collections.abc.Mapping
,typing.Generic
Base settings class.
-
copy
() → aries_cloudagent.config.base.BaseSettings[source]¶ Produce a copy of the settings instance.
-
extend
(other: Mapping[str, object]) → aries_cloudagent.config.base.BaseSettings[source]¶ Merge another mapping to produce a new settings instance.
-
get_bool
(*var_names, default=None) → bool[source]¶ Fetch a setting as a boolean value.
Parameters: - var_names – A list of variable name alternatives
- default – The default value to return if none are defined
-
get_int
(*var_names, default=None) → int[source]¶ Fetch a setting as an integer value.
Parameters: - var_names – A list of variable name alternatives
- default – The default value to return if none are defined
-
-
exception
aries_cloudagent.config.base.
ConfigError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
A base exception for all configuration errors.
-
exception
aries_cloudagent.config.base.
InjectorError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.config.base.ConfigError
The base exception raised by BaseInjector implementations.
-
exception
aries_cloudagent.config.base.
ProviderError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.config.base.ConfigError
The base exception raised by BaseProvider implementations.
-
exception
aries_cloudagent.config.base.
SettingsError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.config.base.ConfigError
The base exception raised by BaseSettings implementations.
aries_cloudagent.config.injection_context module¶
Injection context implementation.
-
class
aries_cloudagent.config.injection_context.
InjectionContext
(*, settings: Mapping[str, object] = None, enforce_typing: bool = True)[source]¶ Bases:
aries_cloudagent.config.base.BaseInjector
Manager for configuration settings and class providers.
-
ROOT_SCOPE
= 'application'¶
-
copy
() → aries_cloudagent.config.injection_context.InjectionContext[source]¶ Produce a copy of the injector instance.
-
inject
(base_cls: type, settings: Mapping[str, object] = None, *, required: bool = True) → object[source]¶ Get the provided instance of a given class identifier.
Parameters: - cls – The base class to retrieve an instance of
- settings – An optional mapping providing configuration to the provider
Returns: An instance of the base class, or None
-
injector
¶ Accessor for scope-specific injector.
-
injector_for_scope
(scope_name: str) → aries_cloudagent.config.injector.Injector[source]¶ Fetch the injector for a specific scope.
Parameters: scope_name – The unique scope identifier
-
scope_name
¶ Accessor for the current scope name.
-
settings
¶ Accessor for scope-specific settings.
-
start_scope
(scope_name: str, settings: Mapping[str, object] = None) → aries_cloudagent.config.injection_context.InjectionContext[source]¶ Begin a new named scope.
Parameters: - scope_name – The unique name for the scope being entered
- settings – An optional mapping of additional settings to apply
Returns: A new injection context representing the scope
-
-
exception
aries_cloudagent.config.injection_context.
InjectionContextError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.config.base.InjectorError
Base class for issues in the injection context.
aries_cloudagent.config.injector module¶
Standard Injector implementation.
-
class
aries_cloudagent.config.injector.
Injector
(settings: Mapping[str, object] = None, enforce_typing: bool = True)[source]¶ Bases:
aries_cloudagent.config.base.BaseInjector
Injector implementation with static and dynamic bindings.
-
bind_provider
(base_cls: type, provider: aries_cloudagent.config.base.BaseProvider, *, cache: bool = False)[source]¶ Add a dynamic instance resolver as a class binding.
-
copy
() → aries_cloudagent.config.base.BaseInjector[source]¶ Produce a copy of the injector instance.
-
inject
(base_cls: type, settings: Mapping[str, object] = None, *, required: bool = True)[source]¶ Get the provided instance of a given class identifier.
Parameters: - cls – The base class to retrieve an instance of
- params – An optional dict providing configuration to the provider
Returns: An instance of the base class, or None
-
settings
¶ Accessor for scope-specific settings.
-
aries_cloudagent.config.provider module¶
Service provider implementations.
-
class
aries_cloudagent.config.provider.
CachedProvider
(provider: aries_cloudagent.config.base.BaseProvider)[source]¶ Bases:
aries_cloudagent.config.base.BaseProvider
Cache the result of another provider.
-
class
aries_cloudagent.config.provider.
ClassProvider
(instance_cls: Union[str, type], *ctor_args, async_init: str = None, **ctor_kwargs)[source]¶ Bases:
aries_cloudagent.config.base.BaseProvider
Provider for a particular class.
-
class
aries_cloudagent.config.provider.
InstanceProvider
(instance)[source]¶ Bases:
aries_cloudagent.config.base.BaseProvider
Provider for a previously-created instance.
-
class
aries_cloudagent.config.provider.
StatsProvider
(provider: aries_cloudagent.config.base.BaseProvider, methods: Sequence[str], *, ignore_missing: bool = True)[source]¶ Bases:
aries_cloudagent.config.base.BaseProvider
Add statistics to the results of another provider.
aries_cloudagent.config.settings module¶
Settings implementation.
-
class
aries_cloudagent.config.settings.
Settings
(values: Mapping[str, object] = None)[source]¶ Bases:
aries_cloudagent.config.base.BaseSettings
Mutable settings implementation.
-
copy
() → aries_cloudagent.config.base.BaseSettings[source]¶ Produce a copy of the settings instance.
-
extend
(other: Mapping[str, object]) → aries_cloudagent.config.base.BaseSettings[source]¶ Merge another settings instance to produce a new instance.
-
get_value
(*var_names, default=None)[source]¶ Fetch a setting.
Parameters: - var_names – A list of variable name alternatives
- default – The default value to return if none are defined
-
aries_cloudagent.holder package¶
Subpackages¶
Submodules¶
aries_cloudagent.holder.base module¶
Base holder class.
aries_cloudagent.holder.indy module¶
Indy issuer implementation.
-
class
aries_cloudagent.holder.indy.
IndyHolder
(wallet)[source]¶ Bases:
aries_cloudagent.holder.base.BaseHolder
Indy holder class.
-
create_credential_request
(credential_offer, credential_definition, did)[source]¶ Create a credential offer for the given credential definition id.
Parameters: - credential_offer – The credential offer to create request for
- credential_definition – The credential definition to create an offer for
Returns: A credential request
-
create_presentation
(presentation_request: dict, requested_credentials: dict, schemas: dict, credential_definitions: dict)[source]¶ Get credentials stored in the wallet.
Parameters: - presentation_request – Valid indy format presentation request
- requested_credentials – Indy format requested_credentials
- schemas – Indy formatted schemas_json
- credential_definitions – Indy formatted schemas_json
-
delete_credential
(credential_id: str)[source]¶ Remove a credential stored in the wallet.
Parameters: credential_id – Credential id to remove
-
get_credential
(credential_id: str)[source]¶ Get a credential stored in the wallet.
Parameters: credential_id – Credential id to retrieve
-
get_credentials
(start: int, count: int, wql: dict)[source]¶ Get credentials stored in the wallet.
Parameters: - start – Starting index
- count – Number of records to return
- wql – wql query dict
-
get_credentials_for_presentation_request_by_referent
(presentation_request: dict, referents: Sequence[str], start: int, count: int, extra_query: dict = {})[source]¶ Get credentials stored in the wallet.
Parameters: - presentation_request – Valid presentation request from issuer
- referents – Presentation request referents to use to search for creds
- start – Starting index
- count – Maximum number of records to return
- extra_query – wql query dict
-
aries_cloudagent.issuer package¶
Submodules¶
aries_cloudagent.issuer.base module¶
Ledger issuer class.
aries_cloudagent.issuer.indy module¶
Indy issuer implementation.
-
class
aries_cloudagent.issuer.indy.
IndyIssuer
(wallet)[source]¶ Bases:
aries_cloudagent.issuer.base.BaseIssuer
Indy issuer class.
-
create_credential
(schema, credential_offer, credential_request, credential_values)[source]¶ Create a credential.
- Args
- schema: Schema to create credential for credential_offer: Credential Offer to create credential for credential_request: Credential request to create credential for credential_values: Values to go in credential
Returns: A tuple of created credential, revocation id
-
-
exception
aries_cloudagent.issuer.indy.
IssuerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Generic issuer error.
aries_cloudagent.issuer.util module¶
Issuer utils.
-
aries_cloudagent.issuer.util.
encode
(orig: Any) → str[source]¶ Encode a credential value as an int.
Encode credential attribute value, purely stringifying any int32 and leaving numeric int32 strings alone, but mapping any other input to a stringified 256-bit (but not 32-bit) integer. Predicates in indy-sdk operate on int32 values properly only when their encoded values match their raw values.
Parameters: orig – original value to encode Returns: encoded value
aries_cloudagent.ledger package¶
Subpackages¶
Submodules¶
aries_cloudagent.ledger.base module¶
Ledger base class.
-
class
aries_cloudagent.ledger.base.
BaseLedger
[source]¶ Bases:
abc.ABC
Base class for ledger.
-
LEDGER_TYPE
= None¶
-
get_endpoint_for_did
(did: str) → str[source]¶ Fetch the endpoint for a ledger DID.
Parameters: did – The DID to look up on the ledger or in the cache
-
aries_cloudagent.ledger.error module¶
Ledger related errors.
-
exception
aries_cloudagent.ledger.error.
BadLedgerRequestError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerError
The current request cannot proceed.
-
exception
aries_cloudagent.ledger.error.
ClosedPoolError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerError
Indy pool is closed.
-
exception
aries_cloudagent.ledger.error.
LedgerConfigError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerError
Base class for ledger configuration errors.
-
exception
aries_cloudagent.ledger.error.
LedgerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Base class for ledger errors.
-
exception
aries_cloudagent.ledger.error.
LedgerTransactionError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.ledger.error.LedgerError
The ledger rejected the transaction.
aries_cloudagent.ledger.indy module¶
Indy ledger implementation.
-
class
aries_cloudagent.ledger.indy.
IndyErrorHandler
(message: str = None, error_cls: Type[aries_cloudagent.ledger.error.LedgerError] = <class 'aries_cloudagent.ledger.error.LedgerError'>)[source]¶ Bases:
object
Trap IndyError and raise an appropriate LedgerError instead.
-
class
aries_cloudagent.ledger.indy.
IndyLedger
(pool_name: str, wallet: aries_cloudagent.wallet.base.BaseWallet, *, keepalive: int = 0, cache: aries_cloudagent.cache.base.BaseCache = None, cache_duration: int = 600)[source]¶ Bases:
aries_cloudagent.ledger.base.BaseLedger
Indy ledger class.
-
LEDGER_TYPE
= 'indy'¶
-
TAA_ACCEPTED_RECORD_TYPE
= 'taa_accepted'¶
Save a new record recording the acceptance of the TAA.
-
check_existing_schema
(public_did: str, schema_name: str, schema_version: str, attribute_names: Sequence[str]) → str[source]¶ Check if a schema has already been published.
-
create_pool_config
(genesis_transactions: str, recreate: bool = False)[source]¶ Create the pool ledger configuration.
-
fetch_credential_definition
(credential_definition_id: str)[source]¶ Get a credential definition from the ledger by id.
Parameters: credential_definition_id – The schema id of the schema to fetch cred def for
-
fetch_schema
(schema_id: str)[source]¶ Get schema from ledger.
Parameters: schema_id – The schema id to retrieve
Fetch the current AML and TAA from the ledger.
-
get_credential_definition
(credential_definition_id: str)[source]¶ Get a credential definition from the cache if available, otherwise the ledger.
Parameters: credential_definition_id – The schema id of the schema to fetch cred def for
-
get_endpoint_for_did
(did: str) → str[source]¶ Fetch the endpoint for a ledger DID.
Parameters: did – The DID to look up on the ledger or in the cache
-
get_indy_storage
() → aries_cloudagent.storage.indy.IndyStorage[source]¶ Get an IndyStorage instance for the current wallet.
-
get_key_for_did
(did: str) → str[source]¶ Fetch the verkey for a ledger DID.
Parameters: did – The DID to look up on the ledger or in the cache
Look up the latest TAA acceptance.
-
get_schema
(schema_id: str)[source]¶ Get a schema from the cache if available, otherwise fetch from the ledger.
Parameters: schema_id – The schema id to retrieve
Get the current transaction author agreement, fetching it if necessary.
-
send_credential_definition
(schema_id: str, tag: str = 'default')[source]¶ Send credential definition to ledger and store relevant key matter in wallet.
Parameters: - schema_id – The schema id of the schema to create cred def for
- tag – Option tag to distinguish multiple credential definitions
-
aries_cloudagent.ledger.provider module¶
Default ledger provider classes.
-
class
aries_cloudagent.ledger.provider.
LedgerProvider
[source]¶ Bases:
aries_cloudagent.config.base.BaseProvider
Provider for the default ledger implementation.
-
LEDGER_CLASSES
= {'indy': 'aries_cloudagent.ledger.indy.IndyLedger'}¶
-
aries_cloudagent.logging package¶
aries_cloudagent.messaging package¶
Subpackages¶
aries_cloudagent.messaging.basicmessage package¶
Basic message handler.
-
class
aries_cloudagent.messaging.basicmessage.handlers.basicmessage_handler.
BasicMessageHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for basic messages.
Basic message.
-
class
aries_cloudagent.messaging.basicmessage.messages.basicmessage.
BasicMessage
(*, sent_time: Union[str, datetime.datetime] = None, content: str = None, localization: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class defining the structure of a basic message.
-
class
aries_cloudagent.messaging.basicmessage.messages.basicmessage.
BasicMessageSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Basic message schema class.
-
class
Meta
[source]¶ Bases:
object
Basic message schema metadata.
-
model_class
¶ alias of
BasicMessage
-
-
content
¶ Used by autodoc_mock_imports.
-
localization
¶ Used by autodoc_mock_imports.
-
sent_time
¶ Used by autodoc_mock_imports.
-
class
Message type identifiers for Connections.
Basic message admin routes.
-
class
aries_cloudagent.messaging.basicmessage.routes.
SendMessageSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for sending a message.
-
content
¶ Used by autodoc_mock_imports.
-
-
aries_cloudagent.messaging.basicmessage.routes.
connections_expire_message
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3518bf98>)[source]¶ Request handler for sending a basic message to a connection.
Parameters: request – aiohttp request object
aries_cloudagent.messaging.connections package¶
Connect invitation handler.
-
class
aries_cloudagent.messaging.connections.handlers.connection_invitation_handler.
ConnectionInvitationHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler class for connection invitations.
Connection request handler.
-
class
aries_cloudagent.messaging.connections.handlers.connection_request_handler.
ConnectionRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler class for connection requests.
Connection response handler.
-
class
aries_cloudagent.messaging.connections.handlers.connection_response_handler.
ConnectionResponseHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler class for connection responses.
-
class
aries_cloudagent.messaging.connections.messages.tests.test_connection_invitation.
TestConnectionInvitation
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
did
= 'did:sov:QmWbsNYhMrjHiqZDTUTEJs'¶
-
endpoint_did
= 'did:sov:A2wBhNYhMrjHiqZDTUYH7u'¶
-
endpoint_url
= 'https://example.com/endpoint'¶
-
image_url
= 'https://example.com/image.jpg'¶
-
key
= '8HH5gYEeNc3z7PYXmd54d4x6qAfCNrqQqEB3nS7Zfu7K'¶
-
label
= 'Label'¶
-
-
class
aries_cloudagent.messaging.connections.messages.tests.test_connection_invitation.
TestConnectionInvitationSchema
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
connection_invitation
= <ConnectionInvitation(_message_id='04a98a91-1667-4bbf-81e1-d0fe3b1b2dd9', _message_new_id=True, _message_decorators=<DecoratorSet{}>, label='label', did='did:sov:QmWbsNYhMrjHiqZDTUTEJs', recipient_keys=None, endpoint=None, routing_keys=None)>¶
-
-
class
aries_cloudagent.messaging.connections.messages.tests.test_connection_request.
TestConfig
[source]¶ Bases:
object
-
test_did
= '55GkHamhTU1ZbTbV2ab9DE'¶
-
test_endpoint
= 'http://localhost'¶
-
test_label
= 'Label'¶
-
test_seed
= 'testseed000000000000000000000001'¶
-
test_verkey
= '3Dn1SJNPaCXcvvJvSbsFWP2xaCjMom3can8CQNhWrTRx'¶
-
-
class
aries_cloudagent.messaging.connections.messages.tests.test_connection_request.
TestConnectionRequest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
,aries_cloudagent.messaging.connections.messages.tests.test_connection_request.TestConfig
-
class
aries_cloudagent.messaging.connections.messages.tests.test_connection_request.
TestConnectionRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
,aries_cloudagent.messaging.connections.messages.tests.test_connection_request.TestConfig
Test connection request schema.
-
class
aries_cloudagent.messaging.connections.messages.tests.test_connection_response.
TestConfig
[source]¶ Bases:
object
-
test_did
= '55GkHamhTU1ZbTbV2ab9DE'¶
-
test_endpoint
= 'http://localhost'¶
-
test_seed
= 'testseed000000000000000000000001'¶
-
test_verkey
= '3Dn1SJNPaCXcvvJvSbsFWP2xaCjMom3can8CQNhWrTRx'¶
-
-
class
aries_cloudagent.messaging.connections.messages.tests.test_connection_response.
TestConnectionResponse
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
,aries_cloudagent.messaging.connections.messages.tests.test_connection_response.TestConfig
-
class
aries_cloudagent.messaging.connections.messages.tests.test_connection_response.
TestConnectionResponseSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
,aries_cloudagent.messaging.connections.messages.tests.test_connection_response.TestConfig
Represents an invitation message for establishing connection.
-
class
aries_cloudagent.messaging.connections.messages.connection_invitation.
ConnectionInvitation
(*, label: str = None, did: str = None, recipient_keys: Sequence[str] = None, endpoint: str = None, routing_keys: Sequence[str] = None, image_url: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a connection invitation.
-
class
Meta
[source]¶ Bases:
object
Metadata for a connection invitation.
-
handler_class
= 'aries_cloudagent.messaging.connections.handlers.connection_invitation_handler.ConnectionInvitationHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation'¶
-
schema_class
= 'ConnectionInvitationSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.connections.messages.connection_invitation.
ConnectionInvitationSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Connection invitation schema class.
-
class
Meta
[source]¶ Bases:
object
Connection invitation schema metadata.
-
model_class
¶ alias of
ConnectionInvitation
-
-
did
¶ Used by autodoc_mock_imports.
-
endpoint
¶ Used by autodoc_mock_imports.
-
image_url
¶ Used by autodoc_mock_imports.
-
label
¶ Used by autodoc_mock_imports.
-
recipient_keys
¶ Used by autodoc_mock_imports.
-
routing_keys
¶ Used by autodoc_mock_imports.
-
class
Represents a connection request message.
-
class
aries_cloudagent.messaging.connections.messages.connection_request.
ConnectionRequest
(*, connection: aries_cloudagent.messaging.connections.models.connection_detail.ConnectionDetail = None, label: str = None, image_url: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a connection request.
-
class
Meta
[source]¶ Bases:
object
Metadata for a connection request.
-
handler_class
= 'aries_cloudagent.messaging.connections.handlers.connection_request_handler.ConnectionRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/request'¶
-
schema_class
= 'ConnectionRequestSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.connections.messages.connection_request.
ConnectionRequestSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Connection request schema class.
-
class
Meta
[source]¶ Bases:
object
Connection request schema metadata.
-
model_class
¶ alias of
ConnectionRequest
-
-
connection
¶ Used by autodoc_mock_imports.
-
image_url
¶ Used by autodoc_mock_imports.
-
label
¶ Used by autodoc_mock_imports.
-
class
Represents a connection response message.
-
class
aries_cloudagent.messaging.connections.messages.connection_response.
ConnectionResponse
(*, connection: aries_cloudagent.messaging.connections.models.connection_detail.ConnectionDetail = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a connection response.
-
class
Meta
[source]¶ Bases:
object
Metadata for a connection response.
-
handler_class
= 'aries_cloudagent.messaging.connections.handlers.connection_response_handler.ConnectionResponseHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/response'¶
-
schema_class
= 'ConnectionResponseSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.connections.messages.connection_response.
ConnectionResponseSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Connection response schema class.
-
class
Meta
[source]¶ Bases:
object
Connection response schema metadata.
-
model_class
¶ alias of
ConnectionResponse
-
signed_fields
= ('connection',)¶
-
-
connection
¶ Used by autodoc_mock_imports.
-
class
Represents a connection problem report message.
-
class
aries_cloudagent.messaging.connections.messages.problem_report.
ProblemReport
(*, problem_code: str = None, explain: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Base class representing a connection problem report message.
-
class
aries_cloudagent.messaging.connections.messages.problem_report.
ProblemReportReason
[source]¶ -
Supported reason codes.
-
INVITATION_NOT_ACCEPTED
= 'invitation_not_accepted'¶
-
REQUEST_NOT_ACCEPTED
= 'request_not_accepted'¶
-
REQUEST_PROCESSING_ERROR
= 'request_processing_error'¶
-
RESPONSE_NOT_ACCEPTED
= 'response_not_accepted'¶
-
RESPONSE_PROCESSING_ERROR
= 'response_processing_error'¶
-
-
class
aries_cloudagent.messaging.connections.messages.problem_report.
ProblemReportSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Schema for ProblemReport base class.
-
class
Meta
[source]¶ Bases:
object
Metadata for problem report schema.
-
model_class
¶ alias of
ProblemReport
-
-
explain
¶ Used by autodoc_mock_imports.
-
problem_code
¶ Used by autodoc_mock_imports.
-
class
DID Document model support.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
aries_cloudagent.messaging.connections.models.diddoc.
DIDDoc
(did: str = None)[source]¶ Bases:
object
DID document, grouping a DID with verification keys and services.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
-
CONTEXT
= 'https://w3id.org/did/v1'¶
-
add_service_pubkeys
(service: dict, tags: Union[Sequence[str], str]) → List[aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKey][source]¶ Add public keys specified in service. Return public keys so discovered.
Parameters: - service – service from DID document
- tags – potential tags marking public keys of type of interest (the standard is still coalescing)
Raises: ValueError
– for public key reference not present in DID document.Returns: list of public keys from the document service specification
-
authnkey
¶ Accessor for public keys marked as authentication keys, by identifier.
-
classmethod
deserialize
(did_doc: dict) → aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc[source]¶ Construct DIDDoc object from dict representation.
Parameters: did_doc – DIDDoc dict representation Raises: ValueError
– for bad DID or missing mandatory item.Returns: DIDDoc from input json
-
did
¶ Accessor for DID.
-
classmethod
from_json
(did_doc_json: str) → aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc[source]¶ Construct DIDDoc object from json representation.
Parameters: did_doc_json – DIDDoc json representation Returns: DIDDoc from input json
-
pubkey
¶ Accessor for public keys by identifier.
-
serialize
() → str[source]¶ Dump current object to a JSON-compatible dictionary.
Returns: dict representation of current DIDDoc
-
service
¶ Accessor for services by identifier.
-
set
(item: Union[aries_cloudagent.messaging.connections.models.diddoc.service.Service, aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKey]) → aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc[source]¶ Add or replace service or public key; return current DIDDoc.
Raises: ValueError
– if input item is neither service nor public key.Parameters: item – service or public key to set Returns: the current DIDDoc
-
-
class
aries_cloudagent.messaging.connections.models.diddoc.
LinkedDataKeySpec
(ver_type, authn_type, specifier)¶ Bases:
tuple
-
authn_type
¶ Alias for field number 1
-
specifier
¶ Alias for field number 2
-
ver_type
¶ Alias for field number 0
-
-
class
aries_cloudagent.messaging.connections.models.diddoc.
PublicKey
(did: str, ident: str, value: str, pk_type: aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKeyType = None, controller: str = None, authn: bool = False)[source]¶ Bases:
object
Public key specification to embed in DID document.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
-
authn
¶ Accessor for the authentication marker.
Returns: whether public key is marked as having DID authentication privilege
-
controller
¶ Accessor for the controller DID.
-
did
¶ Accessor for the DID.
-
id
¶ Accessor for the public key identifier.
-
type
¶ Accessor for the public key type.
-
value
¶ Accessor for the public key value.
-
-
class
aries_cloudagent.messaging.connections.models.diddoc.
PublicKeyType
[source]¶ Bases:
enum.Enum
Class encapsulating public key types.
-
ED25519_SIG_2018
= LinkedDataKeySpec(ver_type='Ed25519VerificationKey2018', authn_type='Ed25519SignatureAuthentication2018', specifier='publicKeyBase58')¶
-
EDDSA_SA_SIG_SECP256K1
= LinkedDataKeySpec(ver_type='Secp256k1VerificationKey2018', authn_type='Secp256k1SignatureAuthenticationKey2018', specifier='publicKeyHex')¶
-
RSA_SIG_2018
= LinkedDataKeySpec(ver_type='RsaVerificationKey2018', authn_type='RsaSignatureAuthentication2018', specifier='publicKeyPem')¶
-
authn_type
¶ Accessor for the authentication type identifier.
-
specification
(val: str) → str[source]¶ Return specifier and input value for use in public key specification.
Parameters: val – value of public key Returns: dict mapping applicable specifier to input value
-
specifier
¶ Accessor for the value specifier.
-
ver_type
¶ Accessor for the verification type identifier.
-
-
class
aries_cloudagent.messaging.connections.models.diddoc.
Service
(did: str, ident: str, typ: str, recip_keys: Union[Sequence[T_co], aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKey], routing_keys: Union[Sequence[T_co], aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKey], endpoint: str, priority: int = 0)[source]¶ Bases:
object
Service specification to embed in DID document.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
-
did
¶ Accessor for the DID value.
-
endpoint
¶ Accessor for the endpoint value.
-
id
¶ Accessor for the service identifier.
-
priority
¶ Accessor for the priority value.
-
recip_keys
¶ Accessor for the recipient keys.
-
routing_keys
¶ Accessor for the routing keys.
-
type
¶ Accessor for the service type.
-
DID Document classes.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
aries_cloudagent.messaging.connections.models.diddoc.diddoc.
DIDDoc
(did: str = None)[source]¶ Bases:
object
DID document, grouping a DID with verification keys and services.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
-
CONTEXT
= 'https://w3id.org/did/v1'¶
-
add_service_pubkeys
(service: dict, tags: Union[Sequence[str], str]) → List[aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKey][source]¶ Add public keys specified in service. Return public keys so discovered.
Parameters: - service – service from DID document
- tags – potential tags marking public keys of type of interest (the standard is still coalescing)
Raises: ValueError
– for public key reference not present in DID document.Returns: list of public keys from the document service specification
-
authnkey
¶ Accessor for public keys marked as authentication keys, by identifier.
-
classmethod
deserialize
(did_doc: dict) → aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc[source]¶ Construct DIDDoc object from dict representation.
Parameters: did_doc – DIDDoc dict representation Raises: ValueError
– for bad DID or missing mandatory item.Returns: DIDDoc from input json
-
did
¶ Accessor for DID.
-
classmethod
from_json
(did_doc_json: str) → aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc[source]¶ Construct DIDDoc object from json representation.
Parameters: did_doc_json – DIDDoc json representation Returns: DIDDoc from input json
-
pubkey
¶ Accessor for public keys by identifier.
-
serialize
() → str[source]¶ Dump current object to a JSON-compatible dictionary.
Returns: dict representation of current DIDDoc
-
service
¶ Accessor for services by identifier.
-
set
(item: Union[aries_cloudagent.messaging.connections.models.diddoc.service.Service, aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKey]) → aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc[source]¶ Add or replace service or public key; return current DIDDoc.
Raises: ValueError
– if input item is neither service nor public key.Parameters: item – service or public key to set Returns: the current DIDDoc
-
DID Document Public Key classes.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
aries_cloudagent.messaging.connections.models.diddoc.publickey.
LinkedDataKeySpec
(ver_type, authn_type, specifier)¶ Bases:
tuple
-
authn_type
¶ Alias for field number 1
-
specifier
¶ Alias for field number 2
-
ver_type
¶ Alias for field number 0
-
-
class
aries_cloudagent.messaging.connections.models.diddoc.publickey.
PublicKey
(did: str, ident: str, value: str, pk_type: aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKeyType = None, controller: str = None, authn: bool = False)[source]¶ Bases:
object
Public key specification to embed in DID document.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
-
authn
¶ Accessor for the authentication marker.
Returns: whether public key is marked as having DID authentication privilege
-
controller
¶ Accessor for the controller DID.
-
did
¶ Accessor for the DID.
-
id
¶ Accessor for the public key identifier.
-
type
¶ Accessor for the public key type.
-
value
¶ Accessor for the public key value.
-
-
class
aries_cloudagent.messaging.connections.models.diddoc.publickey.
PublicKeyType
[source]¶ Bases:
enum.Enum
Class encapsulating public key types.
-
ED25519_SIG_2018
= LinkedDataKeySpec(ver_type='Ed25519VerificationKey2018', authn_type='Ed25519SignatureAuthentication2018', specifier='publicKeyBase58')¶
-
EDDSA_SA_SIG_SECP256K1
= LinkedDataKeySpec(ver_type='Secp256k1VerificationKey2018', authn_type='Secp256k1SignatureAuthenticationKey2018', specifier='publicKeyHex')¶
-
RSA_SIG_2018
= LinkedDataKeySpec(ver_type='RsaVerificationKey2018', authn_type='RsaSignatureAuthentication2018', specifier='publicKeyPem')¶
-
authn_type
¶ Accessor for the authentication type identifier.
-
specification
(val: str) → str[source]¶ Return specifier and input value for use in public key specification.
Parameters: val – value of public key Returns: dict mapping applicable specifier to input value
-
specifier
¶ Accessor for the value specifier.
-
ver_type
¶ Accessor for the verification type identifier.
-
DID Document Service classes.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
class
aries_cloudagent.messaging.connections.models.diddoc.service.
Service
(did: str, ident: str, typ: str, recip_keys: Union[Sequence[T_co], aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKey], routing_keys: Union[Sequence[T_co], aries_cloudagent.messaging.connections.models.diddoc.publickey.PublicKey], endpoint: str, priority: int = 0)[source]¶ Bases:
object
Service specification to embed in DID document.
Retains DIDs as raw values (orientated toward indy-facing operations), everything else as URIs (oriented toward W3C-facing operations).
-
did
¶ Accessor for the DID value.
-
endpoint
¶ Accessor for the endpoint value.
-
id
¶ Accessor for the service identifier.
-
priority
¶ Accessor for the priority value.
-
recip_keys
¶ Accessor for the recipient keys.
-
routing_keys
¶ Accessor for the routing keys.
-
type
¶ Accessor for the service type.
-
DIDDoc utility methods.
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
-
aries_cloudagent.messaging.connections.models.diddoc.util.
canon_did
(uri: str) → str[source]¶ Convert a URI into a DID if need be, left-stripping ‘did:sov:’ if present.
Parameters: uri – input URI or DID Raises: ValueError
– for invalid input.
-
aries_cloudagent.messaging.connections.models.diddoc.util.
canon_ref
(did: str, ref: str, delimiter: str = None)[source]¶ Given a reference in a DID document, return it in its canonical form of a URI.
Parameters: - did – DID acting as the identifier of the DID document
- ref – reference to canonicalize, either a DID or a fragment pointing to a location in the DID doc
- delimiter – delimiter character marking fragment (default ‘#’) or introducing identifier (‘;’) against DID resource
-
aries_cloudagent.messaging.connections.models.diddoc.util.
ok_did
(token: str) → bool[source]¶ Whether input token looks like a valid distributed identifier.
Parameters: token – candidate string Returns: whether input token looks like a valid schema identifier
-
aries_cloudagent.messaging.connections.models.diddoc.util.
resource
(ref: str, delimiter: str = None) → str[source]¶ Extract the resource for an identifier.
Given a (URI) reference, return up to its delimiter (exclusively), or all of it if there is none.
Parameters: - ref – reference
- delimiter – delimiter character (default None maps to ‘#’, or ‘;’ introduces identifiers)
An object for containing the connection request/response DID information.
-
class
aries_cloudagent.messaging.connections.models.connection_detail.
ConnectionDetail
(*, did: str = None, did_doc: aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing the details of a connection.
-
class
Meta
[source]¶ Bases:
object
ConnectionDetail metadata.
-
schema_class
= 'ConnectionDetailSchema'¶
-
-
did
¶ Accessor for the connection DID.
Returns: The DID for this connection
-
did_doc
¶ Accessor for the connection DID Document.
Returns: The DIDDoc for this connection
-
class
-
class
aries_cloudagent.messaging.connections.models.connection_detail.
ConnectionDetailSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
ConnectionDetail schema.
-
class
Meta
[source]¶ Bases:
object
ConnectionDetailSchema metadata.
-
model_class
= 'ConnectionDetail'¶
-
-
did
¶ Used by autodoc_mock_imports.
-
did_doc
¶ Field that loads and serializes DIDDoc.
-
class
Handle connection information interface with non-secrets storage.
-
class
aries_cloudagent.messaging.connections.models.connection_record.
ConnectionRecord
(*, connection_id: str = None, my_did: str = None, their_did: str = None, their_label: str = None, their_role: str = None, initiator: str = None, invitation_key: str = None, request_id: str = None, state: str = None, inbound_connection_id: str = None, error_msg: str = None, routing_state: str = None, accept: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecord
Represents a single pairwise connection.
-
ACCEPT_AUTO
= 'auto'¶
-
ACCEPT_MANUAL
= 'manual'¶
-
CACHE_ENABLED
= True¶
-
DIRECTION_RECEIVED
= 'received'¶
-
DIRECTION_SENT
= 'sent'¶
-
INITIATOR_EXTERNAL
= 'external'¶
-
INITIATOR_SELF
= 'self'¶
-
LOG_STATE_FLAG
= 'debug.connections'¶
-
class
Meta
[source]¶ Bases:
object
ConnectionRecord metadata.
-
schema_class
= 'ConnectionRecordSchema'¶
-
-
RECORD_ID_NAME
= 'connection_id'¶
-
RECORD_TYPE
= 'connection'¶
-
RECORD_TYPE_ACTIVITY
= 'connection_activity'¶
-
RECORD_TYPE_INVITATION
= 'connection_invitation'¶
-
RECORD_TYPE_REQUEST
= 'connection_request'¶
-
ROUTING_STATE_ACTIVE
= 'active'¶
-
ROUTING_STATE_ERROR
= 'error'¶
-
ROUTING_STATE_NONE
= 'none'¶
-
ROUTING_STATE_REQUEST
= 'request'¶
-
STATE_ACTIVE
= 'active'¶
-
STATE_ERROR
= 'error'¶
-
STATE_INACTIVE
= 'inactive'¶
-
STATE_INIT
= 'init'¶
-
STATE_INVITATION
= 'invitation'¶
-
STATE_REQUEST
= 'request'¶
-
STATE_RESPONSE
= 'response'¶
-
WEBHOOK_TOPIC
= 'connections'¶
-
WEBHOOK_TOPIC_ACTIVITY
= 'connections_activity'¶
-
attach_invitation
(context: aries_cloudagent.config.injection_context.InjectionContext, invitation: aries_cloudagent.messaging.connections.messages.connection_invitation.ConnectionInvitation)[source]¶ Persist the related connection invitation to storage.
Parameters: - context – The injection context to use
- invitation – The invitation to relate to this connection record
-
attach_request
(context: aries_cloudagent.config.injection_context.InjectionContext, request: aries_cloudagent.messaging.connections.messages.connection_request.ConnectionRequest)[source]¶ Persist the related connection request to storage.
Parameters: - context – The injection context to use
- request – The request to relate to this connection record
-
connection_id
¶ Accessor for the ID associated with this connection.
-
fetch_activity
(context: aries_cloudagent.config.injection_context.InjectionContext, activity_type: str = None, direction: str = None) → Sequence[dict][source]¶ Fetch all activity logs for this connection record.
Parameters: - context – The injection context to use
- activity_type – An optional activity type filter
- direction – An optional direction filter
-
is_ready
¶ Accessor for connection readiness.
-
log_activity
(context: aries_cloudagent.config.injection_context.InjectionContext, activity_type: str, direction: str, meta: dict = None)[source]¶ Log an event against this connection record.
Parameters: - context – The injection context to use
- activity_type – The activity type identifier
- direction – The direction of the activity (sent or received)
- meta – Optional metadata for the activity
-
post_save
(context: aries_cloudagent.config.injection_context.InjectionContext, *args, **kwargs)[source]¶ Perform post-save actions.
Parameters: context – The injection context to use
Accessor for the record tags generated for this connection.
-
record_value
¶ Accessor to for the JSON record value properties for this connection.
-
retrieve_activity
(context: aries_cloudagent.config.injection_context.InjectionContext, activity_id: str) → Sequence[dict][source]¶ Retrieve a single activity record.
Parameters: - context – The injection context to use
- activity_id – The ID of the activity entry
-
classmethod
retrieve_by_did
(context: aries_cloudagent.config.injection_context.InjectionContext, their_did: str = None, my_did: str = None, initiator: str = None) → aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord[source]¶ Retrieve a connection record by target DID.
Parameters: - context – The injection context to use
- their_did – The target DID to filter by
- my_did – One of our DIDs to filter by
- initiator – Filter connections by the initiator value
-
classmethod
retrieve_by_invitation_key
(context: aries_cloudagent.config.injection_context.InjectionContext, invitation_key: str, initiator: str = None) → aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord[source]¶ Retrieve a connection record by invitation key.
Parameters: - context – The injection context to use
- invitation_key – The key on the originating invitation
- initiator – Filter by the initiator value
-
classmethod
retrieve_by_request_id
(context: aries_cloudagent.config.injection_context.InjectionContext, request_id: str) → aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord[source]¶ Retrieve a connection record from our previous request ID.
Parameters: - context – The injection context to use
- request_id – The ID of the originating connection request
-
retrieve_invitation
(context: aries_cloudagent.config.injection_context.InjectionContext) → aries_cloudagent.messaging.connections.messages.connection_invitation.ConnectionInvitation[source]¶ Retrieve the related connection invitation.
Parameters: context – The injection context to use
-
retrieve_request
(context: aries_cloudagent.config.injection_context.InjectionContext) → aries_cloudagent.messaging.connections.messages.connection_request.ConnectionRequest[source]¶ Retrieve the related connection invitation.
Parameters: context – The injection context to use
-
update_activity_meta
(context: aries_cloudagent.config.injection_context.InjectionContext, activity_id: str, meta: dict) → Sequence[dict][source]¶ Update metadata for an activity entry.
Parameters: - context – The injection context to use
- activity_id – The ID of the activity entry
- meta – The metadata stored on the activity
-
-
class
aries_cloudagent.messaging.connections.models.connection_record.
ConnectionRecordSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecordSchema
Schema to allow serialization/deserialization of connection records.
-
class
Meta
[source]¶ Bases:
object
ConnectionRecordSchema metadata.
-
model_class
¶ alias of
ConnectionRecord
-
-
accept
¶ Used by autodoc_mock_imports.
-
connection_id
¶ Used by autodoc_mock_imports.
-
error_msg
¶ Used by autodoc_mock_imports.
-
inbound_connection_id
¶ Used by autodoc_mock_imports.
-
initiator
¶ Used by autodoc_mock_imports.
-
invitation_key
¶ Used by autodoc_mock_imports.
-
my_did
¶ Used by autodoc_mock_imports.
-
request_id
¶ Used by autodoc_mock_imports.
-
routing_state
¶ Used by autodoc_mock_imports.
-
their_did
¶ Used by autodoc_mock_imports.
-
their_label
¶ Used by autodoc_mock_imports.
-
their_role
¶ Used by autodoc_mock_imports.
-
class
Record used to handle routing of messages to another agent.
-
class
aries_cloudagent.messaging.connections.models.connection_target.
ConnectionTarget
(*, did: str = None, endpoint: str = None, label: str = None, recipient_keys: Sequence[str] = None, routing_keys: Sequence[str] = None, sender_key: str = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Record used to handle routing of messages to another agent.
-
class
aries_cloudagent.messaging.connections.models.connection_target.
ConnectionTargetSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
ConnectionTarget schema.
-
class
Meta
[source]¶ Bases:
object
ConnectionTargetSchema metadata.
-
model_class
¶ alias of
ConnectionTarget
-
-
did
¶ Used by autodoc_mock_imports.
-
endpoint
¶ Used by autodoc_mock_imports.
-
label
¶ Used by autodoc_mock_imports.
-
recipient_keys
¶ Used by autodoc_mock_imports.
-
routing_keys
¶ Used by autodoc_mock_imports.
-
sender_key
¶ Used by autodoc_mock_imports.
-
class
-
class
aries_cloudagent.messaging.connections.tests.test_connection_record.
TestConfig
[source]¶ Bases:
object
-
test_did
= '55GkHamhTU1ZbTbV2ab9DE'¶
-
test_endpoint
= 'http://localhost'¶
-
test_seed
= 'testseed000000000000000000000001'¶
-
test_target_did
= 'GbuDUYXaUZRfHD2jeDuQuP'¶
-
test_target_verkey
= '9WCgWKUaAJj3VWxxtzvvMQN3AoFxoBtBDo9ntwJnVVCC'¶
-
test_verkey
= '3Dn1SJNPaCXcvvJvSbsFWP2xaCjMom3can8CQNhWrTRx'¶
-
-
class
aries_cloudagent.messaging.connections.tests.test_connection_record.
TestConnectionRecord
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
,aries_cloudagent.messaging.connections.tests.test_connection_record.TestConfig
Copyright 2017-2019 Government of Canada Public Services and Procurement Canada - buyandsell.gc.ca
Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Classes to manage connections.
-
class
aries_cloudagent.messaging.connections.manager.
ConnectionManager
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Bases:
object
Class for managing connections.
-
RECORD_TYPE_DID_DOC
= 'did_doc'¶
-
RECORD_TYPE_DID_KEY
= 'did_key'¶
-
accept_response
(response: aries_cloudagent.messaging.connections.messages.connection_response.ConnectionResponse, delivery: aries_cloudagent.messaging.message_delivery.MessageDelivery) → aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord[source]¶ Accept a connection response.
Process a ConnectionResponse message by looking up the connection request and setting up the pairwise connection.
Parameters: - response – The ConnectionResponse to accept
- delivery – The message delivery metadata
Returns: The updated ConnectionRecord representing the connection
Raises: ConnectionManagerError
– If there is no DID associated with the connection responseConnectionManagerError
– If the corresponding connection is not at the request or response stage
-
add_key_for_did
(did: str, key: str)[source]¶ Store a verkey for lookup against a DID.
Parameters: - did – The DID to associate with this key
- key – The verkey to be added
-
context
¶ Accessor for the current injection context.
Returns: The injection context for this connection manager
-
create_did_document
(my_info: aries_cloudagent.wallet.base.DIDInfo, inbound_connection_id: str = None, my_endpoint: str = None) → aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc[source]¶ Create our DID document for a given DID.
Parameters: - my_info – The DID I am using in this connection
- inbound_connection_id – The DID of the inbound routing connection to use
- my_endpoint – A custom endpoint for the DID Document
Returns: The prepared DIDDoc instance
-
create_invitation
(my_label: str = None, my_endpoint: str = None, their_role: str = None, accept: str = None, public: bool = False) → Tuple[aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord, aries_cloudagent.messaging.connections.messages.connection_invitation.ConnectionInvitation][source]¶ Generate new connection invitation.
This interaction represents an out-of-band communication channel. In the future and in practice, these sort of invitations will be received over any number of channels such as SMS, Email, QR Code, NFC, etc.
Structure of an invite message: ```json {
“@type”: “did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation”, “label”: “Alice”, “did”: “did:sov:QmWbsNYhMrjHiqZDTUTEJs”}```
Or, in the case of a peer DID: ```json {
“@type”: “did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation”, “label”: “Alice”, “did”: “did:peer:oiSqsNYhMrjHiqZDTUthsw”, “recipientKeys”: [“8HH5gYEeNc3z7PYXmd54d4x6qAfCNrqQqEB3nS7Zfu7K”], “serviceEndpoint”: “https://example.com/endpoint”}```
Currently, only peer DID is supported.
Parameters: - my_label – label for this connection
- my_endpoint – endpoint where other party can reach me
- their_role – a role to assign the connection
- accept – set to ‘auto’ to auto-accept a corresponding connection request
- public – set to True to create an invitation from the public DID
Returns: A tuple of the new ConnectionRecord and ConnectionInvitation instances
-
create_request
(connection: aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord, my_label: str = None, my_endpoint: str = None) → aries_cloudagent.messaging.connections.messages.connection_request.ConnectionRequest[source]¶ Create a new connection request for a previously-received invitation.
Parameters: - connection – The ConnectionRecord representing the invitation to accept
- my_label – My label
- my_endpoint – My endpoint
Returns: A new ConnectionRequest message to send to the other agent
-
create_response
(connection: aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord, my_endpoint: str = None) → aries_cloudagent.messaging.connections.messages.connection_response.ConnectionResponse[source]¶ Create a connection response for a received connection request.
Parameters: - connection – The ConnectionRecord with a pending connection request
- my_endpoint – The endpoint I can be reached at
Returns: A tuple of the updated ConnectionRecord new ConnectionResponse message
-
diddoc_connection_target
(doc: aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc, sender_verkey: str, their_label: str = None) → aries_cloudagent.messaging.connections.models.connection_target.ConnectionTarget[source]¶ Create a connection target from a DID Document.
Parameters: - doc – The DID Document to create the target from
- sender_verkey – The verkey we are using
- their_label – The connection label they are using
-
establish_inbound
(connection: aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord, inbound_connection_id: str, outbound_handler) → str[source]¶ Assign the inbound routing connection for a connection record.
Returns: the current routing state (request or done)
-
fetch_did_document
(did: str) → aries_cloudagent.messaging.connections.models.diddoc.diddoc.DIDDoc[source]¶ Retrieve a DID Document for a given DID.
Parameters: did – The DID to search for
-
find_connection
(their_did: str, my_did: str = None, my_verkey: str = None, auto_complete=False) → aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord[source]¶ Look up existing connection information for a sender verkey.
Parameters: - their_did – Their DID
- my_did – My DID
- my_verkey – My verkey
- auto_complete – Should this connection automatically be promoted to active
Returns: The located ConnectionRecord, if any
-
find_did_for_key
(key: str) → str[source]¶ Find the DID previously associated with a key.
Parameters: key – The verkey to look up
-
find_message_connection
(delivery: aries_cloudagent.messaging.message_delivery.MessageDelivery) → aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord[source]¶ Deserialize an incoming message and further populate the request context.
Parameters: delivery – The message delivery details Returns: The ConnectionRecord associated with the expanded message, if any
-
get_connection_target
(connection: aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord) → aries_cloudagent.messaging.connections.models.connection_target.ConnectionTarget[source]¶ Create a connection target from a ConnectionRecord.
Parameters: connection – The connection record (with associated DIDDoc) used to generate the connection target
-
log_activity
(connection: aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord, activity_type: str, direction: str, meta: dict = None)[source]¶ Log activity against a connection record and send webhook.
-
receive_invitation
(invitation: aries_cloudagent.messaging.connections.messages.connection_invitation.ConnectionInvitation, their_role: str = None, accept: str = None) → aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord[source]¶ Create a new connection record to track a received invitation.
Parameters: - invitation – The ConnectionInvitation to store
- their_role – The role assigned to this connection
- accept – set to ‘auto’ to auto-accept the invitation
Returns: The new ConnectionRecord instance
-
receive_request
(request: aries_cloudagent.messaging.connections.messages.connection_request.ConnectionRequest, delivery: aries_cloudagent.messaging.message_delivery.MessageDelivery) → aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord[source]¶ Receive and store a connection request.
Parameters: - request – The ConnectionRequest to accept
- delivery – The message delivery metadata
Returns: The new or updated ConnectionRecord instance
-
remove_keys_for_did
(did: str)[source]¶ Remove all keys associated with a DID.
Parameters: did – The DID to remove keys for
-
-
exception
aries_cloudagent.messaging.connections.manager.
ConnectionManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Connection error.
Message type identifiers for Connections.
Connection handling admin routes.
-
class
aries_cloudagent.messaging.connections.routes.
ConnectionListSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for connection list.
-
results
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.connections.routes.
InvitationResultSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for a new connection invitation.
-
connection_id
¶ Used by autodoc_mock_imports.
-
invitation
¶ Used by autodoc_mock_imports.
-
invitation_url
¶ Used by autodoc_mock_imports.
-
-
aries_cloudagent.messaging.connections.routes.
connection_sort_key
(conn)[source]¶ Get the sorting key for a particular connection.
-
aries_cloudagent.messaging.connections.routes.
connections_accept_invitation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3521a518>)[source]¶ Request handler for accepting a stored connection invitation.
Parameters: request – aiohttp request object Returns: The resulting connection record details
-
aries_cloudagent.messaging.connections.routes.
connections_accept_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3521a518>)[source]¶ Request handler for accepting a stored connection request.
Parameters: request – aiohttp request object Returns: The resulting connection record details
-
aries_cloudagent.messaging.connections.routes.
connections_create_invitation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3521a518>)[source]¶ Request handler for creating a new connection invitation.
Parameters: request – aiohttp request object Returns: The connection invitation details
-
aries_cloudagent.messaging.connections.routes.
connections_establish_inbound
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3521a518>)[source]¶ Request handler for setting the inbound connection on a connection record.
Parameters: request – aiohttp request object
-
aries_cloudagent.messaging.connections.routes.
connections_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3521a518>)[source]¶ Request handler for searching connection records.
Parameters: request – aiohttp request object Returns: The connection list response
-
aries_cloudagent.messaging.connections.routes.
connections_receive_invitation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3521a518>)[source]¶ Request handler for receiving a new connection invitation.
Parameters: request – aiohttp request object Returns: The resulting connection record details
-
aries_cloudagent.messaging.connections.routes.
connections_remove
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3521a518>)[source]¶ Request handler for removing a connection record.
Parameters: request – aiohttp request object
aries_cloudagent.messaging.credential_definitions package¶
Credential definition admin routes.
-
class
aries_cloudagent.messaging.credential_definitions.routes.
CredentialDefinitionGetResultsSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Results schema for schema get request.
-
credential_definition
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credential_definitions.routes.
CredentialDefinitionSendRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for schema send request.
-
schema_id
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credential_definitions.routes.
CredentialDefinitionSendResultsSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Results schema for schema send request.
-
credential_definition_id
¶ Used by autodoc_mock_imports.
-
-
aries_cloudagent.messaging.credential_definitions.routes.
credential_definitions_get_credential_definition
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3518b9e8>)[source]¶ Request handler for getting a credential definition from the ledger.
Parameters: request – aiohttp request object Returns: The credential offer details.
-
aries_cloudagent.messaging.credential_definitions.routes.
credential_definitions_send_credential_definition
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3518b9e8>)[source]¶ Request handler for sending a credential definition to the ledger.
Parameters: request – aiohttp request object Returns: The credential offer details.
aries_cloudagent.messaging.credentials package¶
Basic message handler.
-
class
aries_cloudagent.messaging.credentials.handlers.credential_issue_handler.
CredentialIssueHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential offers.
Basic message handler.
-
class
aries_cloudagent.messaging.credentials.handlers.credential_offer_handler.
CredentialOfferHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential offers.
Credential request handler.
-
class
aries_cloudagent.messaging.credentials.handlers.credential_request_handler.
CredentialRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential requests.
A credential content message.
-
class
aries_cloudagent.messaging.credentials.messages.credential_issue.
CredentialIssue
(*, issue: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a credential.
-
class
Meta
[source]¶ Bases:
object
Credential metadata.
-
handler_class
= 'aries_cloudagent.messaging.credentials.handlers.credential_issue_handler.CredentialIssueHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/credential-issuance/0.1/credential-issue'¶
-
schema_class
= 'CredentialIssueSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.credentials.messages.credential_issue.
CredentialIssueSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Credential schema.
-
class
Meta
[source]¶ Bases:
object
Credential schema metadata.
-
model_class
¶ alias of
CredentialIssue
-
-
issue
¶ Used by autodoc_mock_imports.
-
class
A credential offer content message.
-
class
aries_cloudagent.messaging.credentials.messages.credential_offer.
CredentialOffer
(*, offer_json: str = None, credential_preview: dict = None, comment: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a credential offer.
-
class
Meta
[source]¶ Bases:
object
CredentialOffer metadata.
-
handler_class
= 'aries_cloudagent.messaging.credentials.handlers.credential_offer_handler.CredentialOfferHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/credential-issuance/0.1/credential-offer'¶
-
schema_class
= 'CredentialOfferSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.credentials.messages.credential_offer.
CredentialOfferSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Credential offer schema.
-
class
Meta
[source]¶ Bases:
object
Credential offer schema metadata.
-
model_class
¶ alias of
CredentialOffer
-
-
comment
¶ Used by autodoc_mock_imports.
-
credential_preview
¶ Used by autodoc_mock_imports.
-
offer_json
¶ Used by autodoc_mock_imports.
-
class
A credential request content message.
-
class
aries_cloudagent.messaging.credentials.messages.credential_request.
CredentialRequest
(*, request: str = None, comment: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a credential request.
-
class
Meta
[source]¶ Bases:
object
CredentialRequest metadata.
-
handler_class
= 'aries_cloudagent.messaging.credentials.handlers.credential_request_handler.CredentialRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/credential-issuance/0.1/credential-request'¶
-
schema_class
= 'CredentialRequestSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.credentials.messages.credential_request.
CredentialRequestSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Credential request schema.
-
class
Meta
[source]¶ Bases:
object
Credential request schema metadata.
-
model_class
¶ alias of
CredentialRequest
-
-
comment
¶ Used by autodoc_mock_imports.
-
request
¶ Used by autodoc_mock_imports.
-
class
Handle credential exchange information interface with non-secrets storage.
-
class
aries_cloudagent.messaging.credentials.models.credential_exchange.
CredentialExchange
(*, credential_exchange_id: str = None, connection_id: str = None, thread_id: str = None, parent_thread_id: str = None, initiator: str = None, state: str = None, credential_definition_id: str = None, schema_id: str = None, credential_offer: dict = None, credential_request: dict = None, credential_request_metadata: dict = None, credential_id: str = None, raw_credential: dict = None, credential: dict = None, credential_values: dict = None, auto_issue: bool = False, error_msg: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecord
Represents a credential exchange.
-
INITIATOR_EXTERNAL
= 'external'¶
-
INITIATOR_SELF
= 'self'¶
-
LOG_STATE_FLAG
= 'debug.credentials'¶
-
class
Meta
[source]¶ Bases:
object
CredentialExchange metadata.
-
schema_class
= 'CredentialExchangeSchema'¶
-
-
RECORD_ID_NAME
= 'credential_exchange_id'¶
-
RECORD_TYPE
= 'credential_exchange'¶
-
STATE_CREDENTIAL_RECEIVED
= 'credential_received'¶
-
STATE_ISSUED
= 'issued'¶
-
STATE_OFFER_RECEIVED
= 'offer_received'¶
-
STATE_OFFER_SENT
= 'offer_sent'¶
-
STATE_REQUEST_RECEIVED
= 'request_received'¶
-
STATE_REQUEST_SENT
= 'request_sent'¶
-
STATE_STORED
= 'stored'¶
-
WEBHOOK_TOPIC
= 'credentials'¶
-
credential_exchange_id
¶ Accessor for the ID associated with this exchange.
Accessor for the record tags generated for this credential exchange.
-
record_value
¶ Accessor to for the JSON record value props for this credential exchange.
-
-
class
aries_cloudagent.messaging.credentials.models.credential_exchange.
CredentialExchangeSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecordSchema
Schema to allow serialization/deserialization of credential exchange records.
-
class
Meta
[source]¶ Bases:
object
CredentialExchangeSchema metadata.
-
model_class
¶ alias of
CredentialExchange
-
-
auto_issue
¶ Used by autodoc_mock_imports.
-
connection_id
¶ Used by autodoc_mock_imports.
-
credential
¶ Used by autodoc_mock_imports.
-
credential_definition_id
¶ Used by autodoc_mock_imports.
-
credential_exchange_id
¶ Used by autodoc_mock_imports.
-
credential_id
¶ Used by autodoc_mock_imports.
-
credential_offer
¶ Used by autodoc_mock_imports.
-
credential_request
¶ Used by autodoc_mock_imports.
-
credential_request_metadata
¶ Used by autodoc_mock_imports.
-
credential_values
¶ Used by autodoc_mock_imports.
-
error_msg
¶ Used by autodoc_mock_imports.
-
initiator
¶ Used by autodoc_mock_imports.
-
parent_thread_id
¶ Used by autodoc_mock_imports.
-
raw_credential
¶ Used by autodoc_mock_imports.
-
schema_id
¶ Used by autodoc_mock_imports.
-
state
¶ Used by autodoc_mock_imports.
-
thread_id
¶ Used by autodoc_mock_imports.
-
class
Classes to manage credentials.
-
class
aries_cloudagent.messaging.credentials.manager.
CredentialManager
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Bases:
object
Class for managing credentials.
-
cache_credential_exchange
(credential_exchange_record: aries_cloudagent.messaging.credentials.models.credential_exchange.CredentialExchange)[source]¶ Cache a credential exchange to avoid redundant credential requests.
-
context
¶ Accessor for the current injection context.
Returns: The injection context for this credential manager
-
create_offer
(credential_definition_id: str, connection_id: str, auto_issue: bool = None, credential_values: dict = None)[source]¶ Create a new credential exchange representing an offer.
Parameters: - credential_definition_id – Credential definition id for offer
- connection_id – Connection to create offer for
Returns: A new credential exchange record
-
create_request
(credential_exchange_record: aries_cloudagent.messaging.credentials.models.credential_exchange.CredentialExchange, connection_record: aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord)[source]¶ Create a credential request.
Parameters: - credential_exchange_record – Credential exchange to create request for
- connection_record – Connection to create the request for
Returns: A tuple (credential_exchange_record, credential_request_message)
-
credential_stored
(credential_stored_message: aries_cloudagent.messaging.credentials.messages.credential_stored.CredentialStored)[source]¶ Receive confirmation that holder stored credential.
Parameters: credential_message – credential to store
-
issue_credential
(credential_exchange_record: aries_cloudagent.messaging.credentials.models.credential_exchange.CredentialExchange)[source]¶ Issue a credential.
Parameters: credential_exchange_record – The credential exchange we are issuing a credential for Returns: (Updated credential exchange record, credential message obj) Return type: Tuple
-
offer_credential
(credential_exchange: aries_cloudagent.messaging.credentials.models.credential_exchange.CredentialExchange)[source]¶ Offer a credential.
Parameters: credential_exchange_record – The credential exchange we are creating the credential offer for Returns: (Updated credential exchange record, credential offer message) Return type: Tuple
-
perform_send
(credential_exchange: aries_cloudagent.messaging.credentials.models.credential_exchange.CredentialExchange, outbound_handler)[source]¶ Send the first message in a credential exchange.
-
prepare_send
(credential_definition_id: str, connection_id: str, credential_values: dict) → aries_cloudagent.messaging.credentials.models.credential_exchange.CredentialExchange[source]¶ Set up a new credential exchange for an automated send.
Parameters: - credential_definition_id – Credential definition id for offer
- connection_id – Connection to create offer for
- credential_values – The credential values to use if auto_issue is enabled
Returns: A new CredentialExchange record
-
receive_credential
(credential_message: aries_cloudagent.messaging.credentials.messages.credential_issue.CredentialIssue)[source]¶ Receive a credential a credential from an issuer.
Hold in storage to be potentially processed by controller before storing.
Parameters: credential_message – credential to store
-
receive_offer
(credential_offer_message: aries_cloudagent.messaging.credentials.messages.credential_offer.CredentialOffer, connection_id: str)[source]¶ Receive a credential offer.
Parameters: - credential_offer – Credential offer to receive
- connection_id – Connection to receive offer on
Returns: The credential_exchange_record
-
-
exception
aries_cloudagent.messaging.credentials.manager.
CredentialManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Credential error.
Message type identifiers for Connections.
Connection handling admin routes.
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialExchangeListSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for a credential exchange query.
-
results
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialIssueRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for sending a credential issue admin message.
-
credential_values
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialIssueResultSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for sending a credential issue admin message.
-
credential_id
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialListSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for a credential query.
-
results
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialOfferRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for sending a credential offer admin message.
-
connection_id
¶ Used by autodoc_mock_imports.
-
credential_definition_id
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialOfferResultSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for sending a credential offer admin message.
-
credential_id
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialProblemReportRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for sending a problem report.
-
explain_ltxt
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialRequestResultSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for sending a credential request admin message.
-
credential_id
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for a credential query.
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialSendRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for sending a credential offer admin message.
-
connection_id
¶ Used by autodoc_mock_imports.
-
credential_definition_id
¶ Used by autodoc_mock_imports.
-
credential_values
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.credentials.routes.
CredentialSendResultSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for sending a credential offer admin message.
-
credential_id
¶ Used by autodoc_mock_imports.
-
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_issue
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for sending a credential.
Parameters: request – aiohttp request object Returns: The credential details.
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for searching credential exchange records.
Parameters: request – aiohttp request object Returns: The credential exchange list response
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_problem_report
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for sending a problem report.
Parameters: request – aiohttp request object
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_remove
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for removing a credential exchange record.
Parameters: request – aiohttp request object
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_retrieve
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for fetching a single credential exchange record.
Parameters: request – aiohttp request object Returns: The credential exchange record response
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_send
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for sending a credential.
Parameters: request – aiohttp request object Returns: The credential offer details.
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_send_offer
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for sending a credential offer.
Parameters: request – aiohttp request object Returns: The credential offer details.
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_send_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for sending a credential request.
Parameters: request – aiohttp request object Returns: The credential request details.
-
aries_cloudagent.messaging.credentials.routes.
credential_exchange_store
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for storing a credential request.
Parameters: request – aiohttp request object Returns: The credential request details.
-
aries_cloudagent.messaging.credentials.routes.
credentials_get
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for retrieving a credential.
Parameters: request – aiohttp request object Returns: The credential response
-
aries_cloudagent.messaging.credentials.routes.
credentials_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef351d2198>)[source]¶ Request handler for searching credential records.
Parameters: request – aiohttp request object Returns: The credential list response
aries_cloudagent.messaging.decorators package¶
-
class
aries_cloudagent.messaging.decorators.tests.test_decorator_set.
SimpleModel
(*, value: str = None, handled_decorator: str = None, **kwargs)[source]¶
-
class
aries_cloudagent.messaging.decorators.tests.test_decorator_set.
SimpleModelSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
-
class
Meta
[source]¶ Bases:
object
-
model_class
¶ alias of
SimpleModel
-
-
handled_decorator
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
value
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
class
Classes for managing a collection of decorators.
-
class
aries_cloudagent.messaging.decorators.base.
BaseDecoratorSet
(models: dict = None)[source]¶ Bases:
collections.OrderedDict
Collection of decorators.
-
add_model
(key: str, model: Type[aries_cloudagent.messaging.models.base.BaseModel])[source]¶ Add a registered decorator model.
-
copy
() → aries_cloudagent.messaging.decorators.base.BaseDecoratorSet[source]¶ Return a copy of the decorator set.
-
extract_decorators
(message: Mapping[KT, VT_co], schema: Type[<sphinx.ext.autodoc.importer._MockObject object at 0x7fef352a5518>] = None, serialized: bool = True, skip_attrs: Sequence[str] = None) → collections.OrderedDict[source]¶ Extract decorators and return the remaining properties.
-
field
(name: str) → aries_cloudagent.messaging.decorators.base.BaseDecoratorSet[source]¶ Access a named decorated field.
-
fields
¶ Acessor for the set of currently defined fields.
-
load_decorator
(key: str, value, serialized=False)[source]¶ Convert a decorator value to its loaded representation.
-
models
¶ Accessor for the models dictionary.
-
prefix
¶ Accessor for the decorator prefix.
-
-
exception
aries_cloudagent.messaging.decorators.base.
DecoratorError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Base error for decorator issues.
Default decorator set implementation.
-
class
aries_cloudagent.messaging.decorators.default.
DecoratorSet
(models: dict = None)[source]¶ Bases:
aries_cloudagent.messaging.decorators.base.BaseDecoratorSet
Default decorator set implementation.
The localization decorator (~l10n) for message localization information.
-
class
aries_cloudagent.messaging.decorators.localization_decorator.
LocalizationDecorator
(*, locale: str = None, localizable: Sequence[str] = None, catalogs: Sequence[str] = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing the localization decorator.
-
class
aries_cloudagent.messaging.decorators.localization_decorator.
LocalizationDecoratorSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Localization decorator schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
LocalizationDecoratorSchema metadata.
-
model_class
¶ alias of
LocalizationDecorator
-
-
catalogs
¶ Used by autodoc_mock_imports.
-
locale
¶ Used by autodoc_mock_imports.
-
localizable
¶ Used by autodoc_mock_imports.
-
class
Model and schema for working with field signatures within message bodies.
-
class
aries_cloudagent.messaging.decorators.signature_decorator.
SignatureDecorator
(*, signature_type: str = None, signature: str = None, sig_data: str = None, signer: str = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing a field value signed by a known verkey.
-
class
Meta
[source]¶ Bases:
object
SignatureDecorator metadata.
-
schema_class
= 'SignatureDecoratorSchema'¶
-
-
TYPE_ED25519SHA512
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/signature/1.0/ed25519Sha512_single'¶
-
classmethod
create
(value, signer: str, wallet: aries_cloudagent.wallet.base.BaseWallet, timestamp=None) → aries_cloudagent.messaging.decorators.signature_decorator.SignatureDecorator[source]¶ Create a Signature.
Sign a field value and return a newly constructed SignatureDecorator representing the resulting signature.
Parameters: - value – Value to sign
- signer – Verkey of the signing party
- wallet – The wallet to use for the signature
Returns: The created SignatureDecorator object
-
class
-
class
aries_cloudagent.messaging.decorators.signature_decorator.
SignatureDecoratorSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
SignatureDecorator schema.
-
class
Meta
[source]¶ Bases:
object
SignatureDecoratorSchema metadata.
-
model_class
¶ alias of
SignatureDecorator
-
-
sig_data
¶ Used by autodoc_mock_imports.
-
signature
¶ Used by autodoc_mock_imports.
-
signature_type
¶ Used by autodoc_mock_imports.
-
signer
¶ Used by autodoc_mock_imports.
-
class
A message decorator for threads.
A thread decorator identifies a message that may require additional context from previous messages.
-
class
aries_cloudagent.messaging.decorators.thread_decorator.
ThreadDecorator
(*, thid: str = None, pthid: str = None, sender_order: int = None, received_orders: Mapping[KT, VT_co] = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing thread decorator.
-
pthid
¶ Accessor for parent thread identifier.
Returns: This thread’s pthid
-
received_orders
¶ Get received orders.
Returns: The highest sender_order value that the sender has seen from other sender(s) on the thread.
-
sender_order
¶ Get sender order.
Returns: A number that tells where this message fits in the sequence of all messages that the current sender has contributed to this thread
-
thid
¶ Accessor for thread identifier.
Returns: This thread’s thid
-
-
class
aries_cloudagent.messaging.decorators.thread_decorator.
ThreadDecoratorSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Thread decorator schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
ThreadDecoratorSchema metadata.
-
model_class
¶ alias of
ThreadDecorator
-
-
pthid
¶ Used by autodoc_mock_imports.
-
received_orders
¶ Used by autodoc_mock_imports.
-
sender_order
¶ Used by autodoc_mock_imports.
-
thid
¶ Used by autodoc_mock_imports.
-
class
The timing decorator (~timing).
This decorator allows the timing of agent messages to be communicated and constrained.
-
class
aries_cloudagent.messaging.decorators.timing_decorator.
TimingDecorator
(*, in_time: Union[str, datetime.datetime] = None, out_time: Union[str, datetime.datetime] = None, stale_time: Union[str, datetime.datetime] = None, expires_time: Union[str, datetime.datetime] = None, delay_milli: int = None, wait_until_time: Union[str, datetime.datetime] = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing the timing decorator.
-
class
aries_cloudagent.messaging.decorators.timing_decorator.
TimingDecoratorSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Timing decorator schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
TimingDecoratorSchema metadata.
-
model_class
¶ alias of
TimingDecorator
-
-
delay_milli
¶ Used by autodoc_mock_imports.
-
expires_time
¶ Used by autodoc_mock_imports.
-
in_time
¶ Used by autodoc_mock_imports.
-
out_time
¶ Used by autodoc_mock_imports.
-
stale_time
¶ Used by autodoc_mock_imports.
-
wait_until_time
¶ Used by autodoc_mock_imports.
-
class
The transport decorator (~transport).
This decorator allows changes to agent response behaviour and queue status updates.
-
class
aries_cloudagent.messaging.decorators.transport_decorator.
TransportDecorator
(*, return_route: str = None, return_route_thread: str = None, queued_message_count: int = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing the transport decorator.
-
class
aries_cloudagent.messaging.decorators.transport_decorator.
TransportDecoratorSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Transport decorator schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
TransportDecoratorSchema metadata.
-
model_class
¶ alias of
TransportDecorator
-
-
queued_message_count
¶ Used by autodoc_mock_imports.
-
return_route
¶ Used by autodoc_mock_imports.
-
return_route_thread
¶ Used by autodoc_mock_imports.
-
class
aries_cloudagent.messaging.discovery package¶
Handler for incoming disclose messages.
-
class
aries_cloudagent.messaging.discovery.handlers.disclose_handler.
DiscloseHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming disclose messages.
Handler for incoming query messages.
-
class
aries_cloudagent.messaging.discovery.handlers.query_handler.
QueryHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming query messages.
-
class
aries_cloudagent.messaging.discovery.messages.tests.test_disclose.
TestDisclose
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
test_protocols
= [{'pid': 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/basicmessage/1.0/message', 'roles': []}]¶
-
-
class
aries_cloudagent.messaging.discovery.messages.tests.test_disclose.
TestDiscloseSchema
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
disclose
= <Disclose(_message_id='8e7cf3a1-dae6-44ae-b4fc-b5c5b67776e7', _message_new_id=True, _message_decorators=<DecoratorSet{}>, protocols=[])>¶
-
-
class
aries_cloudagent.messaging.discovery.messages.tests.test_query.
TestQuery
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
test_comment
= 'comment'¶
-
test_query
= '*'¶
-
-
class
aries_cloudagent.messaging.discovery.messages.tests.test_query.
TestQuerySchema
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
query
= <Query(_message_id='a1b8ef28-5884-46f4-a5f3-eb258bdc44b2', _message_new_id=True, _message_decorators=<DecoratorSet{}>, query='*', comment='comment')>¶
-
Represents a protocol discovery disclosure message.
-
class
aries_cloudagent.messaging.discovery.messages.disclose.
Disclose
(*, protocols: Mapping[str, Mapping[KT, VT_co]] = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Represents a protocol discovery disclosure, the response to a query message.
-
class
aries_cloudagent.messaging.discovery.messages.disclose.
DiscloseSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Disclose message schema used in serialization/deserialization.
-
protocols
= <fields.List(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid list.'})>¶
-
-
class
aries_cloudagent.messaging.discovery.messages.disclose.
ProtocolDescriptorSchema
(only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Schema for an entry in the protocols list.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
Represents a protocol discovery query message.
-
class
aries_cloudagent.messaging.discovery.messages.query.
Query
(*, query: str = None, comment: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Represents a protocol discovery query.
Used for inspecting what message types are supported by the agent.
-
class
aries_cloudagent.messaging.discovery.messages.query.
QuerySchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Query message schema used in serialization/deserialization.
-
comment
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
query
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
Message type identifiers for Protocol Discovery.
Protocol discovery admin routes.
-
class
aries_cloudagent.messaging.discovery.routes.
QueryResultSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for connection list.
-
results
¶ Used by autodoc_mock_imports.
-
aries_cloudagent.messaging.introduction package¶
Handler for incoming forward invitation messages.
-
class
aries_cloudagent.messaging.introduction.handlers.forward_invitation_handler.
ForwardInvitationHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming forward invitation messages.
Handler for incoming invitation messages.
-
class
aries_cloudagent.messaging.introduction.handlers.invitation_handler.
InvitationHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming invitation messages.
Handler for incoming invitation request messages.
-
class
aries_cloudagent.messaging.introduction.handlers.invitation_request_handler.
InvitationRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming invitation request messages.
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_forward_invitation.
TestConfig
[source]¶ Bases:
object
-
did
= 'did:sov:QmWbsNYhMrjHiqZDTUTEJs'¶
-
endpoint_did
= 'did:sov:A2wBhNYhMrjHiqZDTUYH7u'¶
-
endpoint_url
= 'https://example.com/endpoint'¶
-
key
= '8HH5gYEeNc3z7PYXmd54d4x6qAfCNrqQqEB3nS7Zfu7K'¶
-
label
= 'Label'¶
-
test_message
= 'test message'¶
-
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_forward_invitation.
TestForwardInvitation
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
,aries_cloudagent.messaging.introduction.messages.tests.test_forward_invitation.TestConfig
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_forward_invitation.
TestForwardInvitationSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
,aries_cloudagent.messaging.introduction.messages.tests.test_forward_invitation.TestConfig
Test forward invitation schema.
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_invitation.
TestConfig
[source]¶ Bases:
object
-
did
= 'did:sov:QmWbsNYhMrjHiqZDTUTEJs'¶
-
endpoint_did
= 'did:sov:A2wBhNYhMrjHiqZDTUYH7u'¶
-
endpoint_url
= 'https://example.com/endpoint'¶
-
key
= '8HH5gYEeNc3z7PYXmd54d4x6qAfCNrqQqEB3nS7Zfu7K'¶
-
label
= 'Label'¶
-
test_message
= 'test message'¶
-
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_invitation.
TestInvitation
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
,aries_cloudagent.messaging.introduction.messages.tests.test_invitation.TestConfig
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_invitation.
TestInvitationSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
,aries_cloudagent.messaging.introduction.messages.tests.test_invitation.TestConfig
Test invitation schema.
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_invitation_request.
TestConfig
[source]¶ Bases:
object
-
test_message
= 'MESSAGE'¶
-
test_responder
= 'RESPONDER'¶
-
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_invitation_request.
TestInvitationRequest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
,aries_cloudagent.messaging.introduction.messages.tests.test_invitation_request.TestConfig
-
class
aries_cloudagent.messaging.introduction.messages.tests.test_invitation_request.
TestInvitationRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
,aries_cloudagent.messaging.introduction.messages.tests.test_invitation_request.TestConfig
Test invitation request schema.
Represents a forwarded invitation from another agent.
-
class
aries_cloudagent.messaging.introduction.messages.forward_invitation.
ForwardInvitation
(*, invitation: aries_cloudagent.messaging.connections.messages.connection_invitation.ConnectionInvitation = None, message: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing an invitation to be forwarded.
-
class
Meta
[source]¶ Bases:
object
Metadata for a forwarded invitation.
-
handler_class
= 'aries_cloudagent.messaging.introduction.handlers.forward_invitation_handler.ForwardInvitationHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/0.1/forward-invitation'¶
-
schema_class
= 'ForwardInvitationSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.introduction.messages.forward_invitation.
ForwardInvitationSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
ForwardInvitation request schema class.
-
class
Meta
[source]¶ Bases:
object
ForwardInvitation request schema metadata.
-
model_class
¶ alias of
ForwardInvitation
-
-
invitation
¶ Used by autodoc_mock_imports.
-
message
¶ Used by autodoc_mock_imports.
-
class
Represents an invitation returned to the introduction service.
-
class
aries_cloudagent.messaging.introduction.messages.invitation.
Invitation
(*, invitation: aries_cloudagent.messaging.connections.messages.connection_invitation.ConnectionInvitation = None, message: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing an invitation returned to the introduction service.
-
class
aries_cloudagent.messaging.introduction.messages.invitation.
InvitationSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Invitation request schema class.
-
class
Meta
[source]¶ Bases:
object
Invitation request schema metadata.
-
model_class
¶ alias of
Invitation
-
-
invitation
¶ Used by autodoc_mock_imports.
-
message
¶ Used by autodoc_mock_imports.
-
class
Represents an request for an invitation from the introduction service.
-
class
aries_cloudagent.messaging.introduction.messages.invitation_request.
InvitationRequest
(*, responder: str = None, message: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing an invitation request.
-
class
Meta
[source]¶ Bases:
object
Metadata for an invitation request.
-
handler_class
= 'aries_cloudagent.messaging.introduction.handlers.invitation_request_handler.InvitationRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/introduction-service/0.1/invitation-request'¶
-
schema_class
= 'InvitationRequestSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.introduction.messages.invitation_request.
InvitationRequestSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Invitation request schema class.
-
class
Meta
[source]¶ Bases:
object
Invitation request schema metadata.
-
model_class
¶ alias of
InvitationRequest
-
-
message
¶ Used by autodoc_mock_imports.
-
responder
¶ Used by autodoc_mock_imports.
-
class
Introduction service base classes.
-
class
aries_cloudagent.messaging.introduction.base_service.
BaseIntroductionService
(context: aries_cloudagent.messaging.base_context.BaseRequestContext)[source]¶ Bases:
abc.ABC
Service handler for allowing connections to exchange invitations.
-
return_invitation
(target_connection_id: str, invitation: aries_cloudagent.messaging.introduction.messages.invitation.Invitation, outbound_handler)[source]¶ Handle the forwarding of an invitation to the responder.
Parameters: - target_connection_id – The ID of the connection sending the Invitation
- invitation – The received Invitation message
- outbound_handler – The outbound handler coroutine for sending a message
-
start_introduction
(init_connection_id: str, target_connection_id: str, outbound_handler, message: str = None)[source]¶ Start the introduction process between two connections.
Parameters: - init_connection_id – The connection initiating the request
- target_connection_id – The connection which is asked for an invitation
- outbound_handler – The outbound handler coroutine for sending a message
- message – The message to use when requesting the invitation
-
-
exception
aries_cloudagent.messaging.introduction.base_service.
IntroductionError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Generic introduction service error.
Introduction service demo classes.
-
class
aries_cloudagent.messaging.introduction.demo_service.
DemoIntroductionService
(context: aries_cloudagent.messaging.base_context.BaseRequestContext)[source]¶ Bases:
aries_cloudagent.messaging.introduction.base_service.BaseIntroductionService
Service handler for allowing connections to exchange invitations.
-
RECORD_TYPE
= 'introduction_record'¶
-
return_invitation
(target_connection_id: str, invitation: aries_cloudagent.messaging.introduction.messages.invitation.Invitation, outbound_handler)[source]¶ Handle the forwarding of an invitation to the responder.
Parameters: - target_connection_id – The ID of the connection sending the Invitation
- invitation – The received Invitation message
- outbound_handler – The outbound handler coroutine for sending a message
-
start_introduction
(init_connection_id: str, target_connection_id: str, message: str, outbound_handler)[source]¶ Start the introduction process between two connections.
Parameters: - init_connection_id – The connection initiating the request
- target_connection_id – The connection which is asked for an invitation
- outbound_handler – The outbound handler coroutine for sending a message
- message – The message to use when requesting the invitation
-
Message type identifiers for Introductions.
Introduction service admin routes.
aries_cloudagent.messaging.models package¶
Base classes for Models and Schemas.
-
class
aries_cloudagent.messaging.models.base.
BaseModel
[source]¶ Bases:
abc.ABC
Base model that provides convenience methods.
-
Schema
¶ Accessor for the model’s schema class.
Returns: The schema class
-
classmethod
deserialize
(obj)[source]¶ Convert from JSON representation to a model instance.
Parameters: obj – The dict to load into a model instance Returns: A model instance for this data
-
classmethod
from_json
(json_repr: Union[str, bytes])[source]¶ Parse a JSON string into a model instance.
Parameters: json_repr – JSON string Returns: A model instance representation of this JSON
-
-
exception
aries_cloudagent.messaging.models.base.
BaseModelError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Base exception class for base model errors.
-
class
aries_cloudagent.messaging.models.base.
BaseModelSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
BaseModel schema.
-
class
Meta
[source]¶ Bases:
object
BaseModelSchema metadata.
-
model_class
= None¶
-
ordered
= True¶
-
skip_values
= [None]¶
-
-
Model
¶ Accessor for the schema’s model class.
Returns: The model class
-
class
aries_cloudagent.messaging.presentations package¶
Basic message handler.
-
class
aries_cloudagent.messaging.presentations.handlers.credential_presentation_handler.
CredentialPresentationHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential presentations.
Basic message handler.
-
class
aries_cloudagent.messaging.presentations.handlers.presentation_request_handler.
PresentationRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for presentation requests.
A credential presentation message.
-
class
aries_cloudagent.messaging.presentations.messages.credential_presentation.
CredentialPresentation
(presentation: str = None, comment: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a credential presentation.
-
class
Meta
[source]¶ Bases:
object
CredentialPresentation metadata.
-
handler_class
= 'aries_cloudagent.messaging.presentations.handlers.credential_presentation_handler.CredentialPresentationHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/credential-presentation/0.1/credential-presentation'¶
-
schema_class
= 'CredentialPresentationSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.presentations.messages.credential_presentation.
CredentialPresentationSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
CredentialPresentation schema.
-
class
Meta
[source]¶ Bases:
object
CredentialPresentationSchema metadata.
-
model_class
¶ alias of
CredentialPresentation
-
-
comment
¶ Used by autodoc_mock_imports.
-
presentation
¶ Used by autodoc_mock_imports.
-
class
A presentation request content message.
-
class
aries_cloudagent.messaging.presentations.messages.presentation_request.
PresentationRequest
(request: str = None, comment: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a presentation request.
-
class
Meta
[source]¶ Bases:
object
PresentationRequest metadata.
-
handler_class
= 'aries_cloudagent.messaging.presentations.handlers.presentation_request_handler.PresentationRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/credential-presentation/0.1/presentation-request'¶
-
schema_class
= 'PresentationRequestSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.presentations.messages.presentation_request.
PresentationRequestSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
PresentationRequest schema.
-
class
Meta
[source]¶ Bases:
object
PresentationRequestSchema metadata.
-
model_class
¶ alias of
PresentationRequest
-
-
comment
¶ Used by autodoc_mock_imports.
-
request
¶ Used by autodoc_mock_imports.
-
class
Handle presentation exchange information interface with non-secrets storage.
-
class
aries_cloudagent.messaging.presentations.models.presentation_exchange.
PresentationExchange
(*, presentation_exchange_id: str = None, connection_id: str = None, thread_id: str = None, initiator: str = None, state: str = None, presentation_request: dict = None, presentation: dict = None, verified: str = None, error_msg: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecord
Represents a presentation exchange.
-
INITIATOR_EXTERNAL
= 'external'¶
-
INITIATOR_SELF
= 'self'¶
-
LOG_STATE_FLAG
= 'debug.presentations'¶
-
class
Meta
[source]¶ Bases:
object
PresentationExchange metadata.
-
schema_class
= 'PresentationExchangeSchema'¶
-
-
RECORD_ID_NAME
= 'presentation_exchange_id'¶
-
RECORD_TYPE
= 'presentation_exchange'¶
-
STATE_PRESENTATION_RECEIVED
= 'presentation_received'¶
-
STATE_PRESENTATION_SENT
= 'presentation_sent'¶
-
STATE_REQUEST_RECEIVED
= 'request_received'¶
-
STATE_REQUEST_SENT
= 'request_sent'¶
-
STATE_VERIFIED
= 'verified'¶
-
WEBHOOK_TOPIC
= 'presentations'¶
-
presentation_exchange_id
¶ Accessor for the ID associated with this exchange.
Accessor for the record tags generated for this presentation exchange.
-
record_value
¶ Accessor for JSON record value generated for this presentation exchange.
-
-
class
aries_cloudagent.messaging.presentations.models.presentation_exchange.
PresentationExchangeSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecordSchema
Schema for serialization/deserialization of presentation exchange records.
-
class
Meta
[source]¶ Bases:
object
PresentationExchangeSchema metadata.
-
model_class
¶ alias of
PresentationExchange
-
-
connection_id
¶ Used by autodoc_mock_imports.
-
error_msg
¶ Used by autodoc_mock_imports.
-
initiator
¶ Used by autodoc_mock_imports.
-
presentation
¶ Used by autodoc_mock_imports.
-
presentation_exchange_id
¶ Used by autodoc_mock_imports.
-
presentation_request
¶ Used by autodoc_mock_imports.
-
state
¶ Used by autodoc_mock_imports.
-
thread_id
¶ Used by autodoc_mock_imports.
-
verified
¶ Used by autodoc_mock_imports.
-
class
Classes to manage presentations.
-
class
aries_cloudagent.messaging.presentations.manager.
PresentationManager
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Bases:
object
Class for managing presentations.
-
context
¶ Accessor for the current request context.
Returns: The injection context for this presentation manager
-
create_presentation
(presentation_exchange_record: aries_cloudagent.messaging.presentations.models.presentation_exchange.PresentationExchange, requested_credentials: dict)[source]¶ Receive a presentation request.
Parameters: - presentation_exchange_record – Record to update
- requested_credentials – Indy formatted requested_credentials
i.e.,
- {
- “self_attested_attributes”: {
- “j233ffbc-bd35-49b1-934f-51e083106f6d”: “value”
}, “requested_attributes”: {
- “6253ffbb-bd35-49b3-934f-46e083106f6c”: {
- “cred_id”: “5bfa40b7-062b-4ae0-a251-a86c87922c0e”, “revealed”: true
}
}, “requested_predicates”: {
- “bfc8a97d-60d3-4f21-b998-85eeabe5c8c0”: {
- “cred_id”: “5bfa40b7-062b-4ae0-a251-a86c87922c0e”
}
}
}
-
create_request
(name: str, version: str, requested_attributes: list, requested_predicates: list, connection_id: str)[source]¶ Create a proof request.
-
-
exception
aries_cloudagent.messaging.presentations.manager.
PresentationManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Presentation error.
Message type identifiers for Connections.
Admin routes for presentations.
-
class
aries_cloudagent.messaging.presentations.routes.
PresentationExchangeListSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Result schema for a presentation exchange query.
-
results
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.presentations.routes.
PresentationRequestRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for sending a proof request.
-
class
RequestedAttribute
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
RequestedAttribute model.
-
name
¶ Used by autodoc_mock_imports.
-
restrictions
¶ Used by autodoc_mock_imports.
-
-
class
RequestedPredicate
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
RequestedPredicate model.
-
name
¶ Used by autodoc_mock_imports.
-
p_type
¶ Used by autodoc_mock_imports.
-
p_value
¶ Used by autodoc_mock_imports.
-
restrictions
¶ Used by autodoc_mock_imports.
-
-
connection_id
¶ Used by autodoc_mock_imports.
-
name
¶ Used by autodoc_mock_imports.
-
requested_attributes
¶ Used by autodoc_mock_imports.
-
requested_predicates
¶ Used by autodoc_mock_imports.
-
version
¶ Used by autodoc_mock_imports.
-
class
-
class
aries_cloudagent.messaging.presentations.routes.
SendPresentationRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for sending a presentation.
-
requested_attributes
¶ Used by autodoc_mock_imports.
-
requested_predicates
¶ Used by autodoc_mock_imports.
-
self_attested_attributes
¶ Used by autodoc_mock_imports.
-
-
aries_cloudagent.messaging.presentations.routes.
presentation_exchange_create_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef35176c18>)[source]¶ Request handler for creating a presentation request.
Parameters: request – aiohttp request object Returns: The presentation exchange details.
-
aries_cloudagent.messaging.presentations.routes.
presentation_exchange_credentials_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef35176c18>)[source]¶ Request handler for searching applicable credential records.
Parameters: request – aiohttp request object Returns: The credential list response
-
aries_cloudagent.messaging.presentations.routes.
presentation_exchange_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef35176c18>)[source]¶ Request handler for searching presentation exchange records.
Parameters: request – aiohttp request object Returns: The presentation exchange list response
-
aries_cloudagent.messaging.presentations.routes.
presentation_exchange_remove
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef35176c18>)[source]¶ Request handler for removing a presentation exchange record.
Parameters: request – aiohttp request object
-
aries_cloudagent.messaging.presentations.routes.
presentation_exchange_retrieve
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef35176c18>)[source]¶ Request handler for fetching a single presentation exchange record.
Parameters: request – aiohttp request object Returns: The presentation exchange record response
-
aries_cloudagent.messaging.presentations.routes.
presentation_exchange_send_credential_presentation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef35176c18>)[source]¶ Request handler for sending a credential presentation.
Parameters: request – aiohttp request object Returns: The presentation exchange details.
-
aries_cloudagent.messaging.presentations.routes.
presentation_exchange_send_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef35176c18>)[source]¶ Request handler for creating and sending a presentation request.
Parameters: request – aiohttp request object Returns: The presentation exchange details.
-
aries_cloudagent.messaging.presentations.routes.
presentation_exchange_verify_credential_presentation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef35176c18>)[source]¶ Request handler for verifying a presentation request.
Parameters: request – aiohttp request object Returns: The presentation exchange details.
aries_cloudagent.messaging.problem_report package¶
Generic problem report handler.
-
class
aries_cloudagent.messaging.problem_report.handler.
ProblemReportHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Problem report handler class.
Represents a generic problem report message.
-
class
aries_cloudagent.messaging.problem_report.message.
ProblemReport
(*, msg_catalog: str = None, locale: str = None, explain_ltxt: str = None, explain_l10n: Mapping[str, str] = None, problem_items: Sequence[Mapping[str, str]] = None, who_retries: str = None, fix_hint_ltxt: Mapping[str, str] = None, impact: str = None, where: str = None, time_noticed: str = None, tracking_uri: str = None, escalation_uri: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Base class representing a generic problem report message.
-
class
aries_cloudagent.messaging.problem_report.message.
ProblemReportSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Schema for ProblemReport base class.
-
class
Meta
[source]¶ Bases:
object
Problem report schema metadata.
-
model_class
¶ alias of
ProblemReport
-
-
escalation_uri
¶ Used by autodoc_mock_imports.
-
explain_l10n
¶ Used by autodoc_mock_imports.
-
explain_ltxt
¶ Used by autodoc_mock_imports.
-
fix_hint_ltxt
¶ Used by autodoc_mock_imports.
-
impact
¶ Used by autodoc_mock_imports.
-
locale
¶ Used by autodoc_mock_imports.
-
msg_catalog
¶ Used by autodoc_mock_imports.
-
problem_items
¶ Used by autodoc_mock_imports.
-
time_noticed
¶ Used by autodoc_mock_imports.
-
tracking_uri
¶ Used by autodoc_mock_imports.
-
where
¶ Used by autodoc_mock_imports.
-
who_retries
¶ Used by autodoc_mock_imports.
-
class
aries_cloudagent.messaging.routing package¶
Handler for incoming forward messages.
-
class
aries_cloudagent.messaging.routing.handlers.forward_handler.
ForwardHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming forward messages.
Handler for incoming route-query-request messages.
-
class
aries_cloudagent.messaging.routing.handlers.route_query_request_handler.
RouteQueryRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming route-query-request messages.
Handler for incoming route-query-response messages.
-
class
aries_cloudagent.messaging.routing.handlers.route_query_response_handler.
RouteQueryResponseHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming route-query-response messages.
Handler for incoming route-update-request messages.
-
class
aries_cloudagent.messaging.routing.handlers.route_update_request_handler.
RouteUpdateRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming route-update-request messages.
Handler for incoming route-update-response messages.
-
class
aries_cloudagent.messaging.routing.handlers.route_update_response_handler.
RouteUpdateResponseHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming route-update-response messages.
-
class
aries_cloudagent.messaging.routing.messages.tests.test_route_query_request.
TestRouteQueryRequest
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
test_filter
= {'recipient_key': '3Dn1SJNPaCXcvvJvSbsFWP2xaCjMom3can8CQNhWrTRx'}¶
-
test_limit
= 100¶
-
test_offset
= 10¶
-
test_verkey
= '3Dn1SJNPaCXcvvJvSbsFWP2xaCjMom3can8CQNhWrTRx'¶
-
-
class
aries_cloudagent.messaging.routing.messages.tests.test_route_query_response.
TestRouteQueryResponse
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
test_conn_id
= 'conn-id'¶
-
test_end
= 15¶
-
test_limit
= 5¶
-
test_route_id
= 'route-id'¶
-
test_start
= 10¶
-
test_total
= 20¶
-
test_verkey
= '3Dn1SJNPaCXcvvJvSbsFWP2xaCjMom3can8CQNhWrTRx'¶
-
-
class
aries_cloudagent.messaging.routing.messages.tests.test_route_update_request.
TestRouteQueryRequestSchema
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
-
class
aries_cloudagent.messaging.routing.messages.tests.test_route_update_response.
TestRouteQueryRequestSchema
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase
Represents a forward message.
-
class
aries_cloudagent.messaging.routing.messages.forward.
Forward
(*, to: str = None, msg: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Represents a request to forward a message to a connected agent.
-
class
aries_cloudagent.messaging.routing.messages.forward.
ForwardSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Forward message schema used in serialization/deserialization.
-
msg
¶ Used by autodoc_mock_imports.
-
to
¶ Used by autodoc_mock_imports.
-
Query existing forwarding routes.
-
class
aries_cloudagent.messaging.routing.messages.route_query_request.
RouteQueryRequest
(*, filter: dict = None, paginate: aries_cloudagent.messaging.routing.models.paginate.Paginate = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Query existing routes from a routing agent.
-
class
Meta
[source]¶ Bases:
object
RouteQueryRequest metadata.
-
handler_class
= 'aries_cloudagent.messaging.routing.handlers.route_query_request_handler.RouteQueryRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/routing/1.0/route-query-request'¶
-
schema_class
= 'RouteQueryRequestSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.routing.messages.route_query_request.
RouteQueryRequestSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
RouteQueryRequest message schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
RouteQueryRequestSchema metadata.
-
model_class
¶ alias of
RouteQueryRequest
-
-
filter
= <fields.Dict(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=True, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid mapping type.'})>¶
-
paginate
= <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=True, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>¶
-
class
Return existing forwarding routes in response to a query.
-
class
aries_cloudagent.messaging.routing.messages.route_query_response.
RouteQueryResponse
(*, routes: Sequence[aries_cloudagent.messaging.routing.models.route_query_result.RouteQueryResult] = None, paginated: aries_cloudagent.messaging.routing.models.paginated.Paginated = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Return existing routes from a routing agent.
-
class
Meta
[source]¶ Bases:
object
RouteQueryResponse metadata.
-
handler_class
= 'aries_cloudagent.messaging.routing.handlers.route_query_response_handler.RouteQueryResponseHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/routing/1.0/route-query-response'¶
-
schema_class
= 'RouteQueryResponseSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.routing.messages.route_query_response.
RouteQueryResponseSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
RouteQueryResponse message schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
RouteQueryResponseSchema metadata.
-
model_class
¶ alias of
RouteQueryResponse
-
-
paginated
= <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>¶
-
routes
= <fields.List(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid list.'})>¶
-
class
Request to update forwarding routes.
-
class
aries_cloudagent.messaging.routing.messages.route_update_request.
RouteUpdateRequest
(*, updates: Sequence[aries_cloudagent.messaging.routing.models.route_update.RouteUpdate] = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Request to existing routes with a routing agent.
-
class
Meta
[source]¶ Bases:
object
RouteUpdateRequest metadata.
-
handler_class
= 'aries_cloudagent.messaging.routing.handlers.route_update_request_handler.RouteUpdateRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/routing/1.0/route-update-request'¶
-
schema_class
= 'RouteUpdateRequestSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.routing.messages.route_update_request.
RouteUpdateRequestSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
RouteUpdateRequest message schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
RouteUpdateRequestSchema metadata.
-
model_class
¶ alias of
RouteUpdateRequest
-
-
updates
¶ Used by autodoc_mock_imports.
-
class
Response for a route update request.
-
class
aries_cloudagent.messaging.routing.messages.route_update_response.
RouteUpdateResponse
(*, updated: Sequence[aries_cloudagent.messaging.routing.models.route_updated.RouteUpdated] = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Response for a route update request.
-
class
Meta
[source]¶ Bases:
object
RouteUpdateResponse metadata.
-
handler_class
= 'aries_cloudagent.messaging.routing.handlers.route_update_response_handler.RouteUpdateResponseHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/routing/1.0/route-update-response'¶
-
schema_class
= 'RouteUpdateResponseSchema'¶
-
-
class
-
class
aries_cloudagent.messaging.routing.messages.route_update_response.
RouteUpdateResponseSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
RouteUpdateResponse message schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
RouteUpdateResponseSchema metadata.
-
model_class
¶ alias of
RouteUpdateResponse
-
-
updated
= <fields.List(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid list.'})>¶
-
class
An object for containing the request pagination information.
-
class
aries_cloudagent.messaging.routing.models.paginate.
Paginate
(*, limit: int = None, offset: int = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing the pagination details of a request.
-
class
aries_cloudagent.messaging.routing.models.paginate.
PaginateSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Paginate schema.
-
limit
= <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid integer.'})>¶
-
offset
= <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid integer.'})>¶
-
An object for containing the response pagination information.
-
class
aries_cloudagent.messaging.routing.models.paginated.
Paginated
(*, start: int = None, end: int = None, limit: int = None, total: int = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing the pagination details of a response.
-
class
aries_cloudagent.messaging.routing.models.paginated.
PaginatedSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Paginated schema.
-
end
= <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid integer.'})>¶
-
limit
= <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid integer.'})>¶
-
start
= <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid integer.'})>¶
-
total
= <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid integer.'})>¶
-
An object for containing returned route information.
-
class
aries_cloudagent.messaging.routing.models.route_query_result.
RouteQueryResult
(*, recipient_key: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing route information returned by a route query.
-
class
aries_cloudagent.messaging.routing.models.route_query_result.
RouteQueryResultSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
RouteQueryResult schema.
-
class
Meta
[source]¶ Bases:
object
RouteQueryResultSchema metadata.
-
model_class
= 'RouteQueryResult'¶
-
-
recipient_key
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
class
An object for containing information on an individual route.
-
class
aries_cloudagent.messaging.routing.models.route_record.
RouteRecord
(*, record_id: str = None, connection_id: str = None, recipient_key: str = None, created_at: str = None, updated_at: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing stored route information.
-
class
aries_cloudagent.messaging.routing.models.route_record.
RouteRecordSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
RouteRecord schema.
-
connection_id
¶ Used by autodoc_mock_imports.
-
created_at
¶ Used by autodoc_mock_imports.
-
recipient_key
¶ Used by autodoc_mock_imports.
-
record_id
¶ Used by autodoc_mock_imports.
-
updated_at
¶ Used by autodoc_mock_imports.
-
An object for containing route information to be updated.
-
class
aries_cloudagent.messaging.routing.models.route_update.
RouteUpdate
(*, recipient_key: str = None, action: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing a route update request.
-
ACTION_CREATE
= 'create'¶
-
ACTION_DELETE
= 'delete'¶
-
-
class
aries_cloudagent.messaging.routing.models.route_update.
RouteUpdateSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
RouteUpdate schema.
-
action
¶ Used by autodoc_mock_imports.
-
recipient_key
¶ Used by autodoc_mock_imports.
-
An object for containing updated route information.
-
class
aries_cloudagent.messaging.routing.models.route_updated.
RouteUpdated
(*, recipient_key: str = None, action: str = None, result: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing a route update response.
-
RESULT_CLIENT_ERROR
= 'client_error'¶
-
RESULT_NO_CHANGE
= 'no_change'¶
-
RESULT_SERVER_ERROR
= 'server_error'¶
-
RESULT_SUCCESS
= 'success'¶
-
-
class
aries_cloudagent.messaging.routing.models.route_updated.
RouteUpdatedSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
RouteUpdated schema.
-
action
¶ Used by autodoc_mock_imports.
-
recipient_key
¶ Used by autodoc_mock_imports.
-
result
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.routing.tests.test_routing_manager.
TestRoutingManager
[source]¶ Bases:
object
Routing manager classes for tracking and inspecting routing records.
-
exception
aries_cloudagent.messaging.routing.manager.
RouteNotFoundError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.routing.manager.RoutingManagerError
Requested route was not found.
-
class
aries_cloudagent.messaging.routing.manager.
RoutingManager
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Bases:
object
Class for handling routing records.
-
RECORD_TYPE
= 'forward_route'¶
-
context
¶ Accessor for the current request context.
Returns: The request context for this connection
-
create_route_record
(client_connection_id: str = None, recipient_key: str = None) → aries_cloudagent.messaging.routing.models.route_record.RouteRecord[source]¶ Create and store a new RouteRecord.
Parameters: - client_connection_id – The ID of the connection record
- recipient_key – The recipient verkey of the route
Returns: The new routing record
-
delete_route_record
(route: aries_cloudagent.messaging.routing.models.route_record.RouteRecord)[source]¶ Remove an existing route record.
-
get_recipient
(recip_verkey: str) → aries_cloudagent.messaging.routing.models.route_record.RouteRecord[source]¶ Resolve the recipient for a verkey.
Parameters: recip_verkey – The verkey (“to”) of the incoming Forward message Returns: The RouteRecord associated with this verkey
-
get_routes
(client_connection_id: str = None, tag_filter: dict = None) → Sequence[aries_cloudagent.messaging.routing.models.route_record.RouteRecord][source]¶ Fetch all routes associated with the current connection.
Parameters: - client_connection_id – The ID of the connection record
- tag_filter – An optional dictionary of tag filters
Returns: A sequence of route records found by the query
-
send_create_route
(router_connection_id: str, recip_key: str, outbound_handler)[source]¶ Create and send a route update request.
Returns: the current routing state (request or done)
-
update_routes
(client_connection_id: str, updates: Sequence[aries_cloudagent.messaging.routing.models.route_update.RouteUpdate]) → Sequence[aries_cloudagent.messaging.routing.models.route_updated.RouteUpdated][source]¶ Update routes associated with the current connection.
Parameters: - client_connection_id – The ID of the connection record
- updates – The sequence of route updates (create/delete) to perform.
-
-
exception
aries_cloudagent.messaging.routing.manager.
RoutingManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Generic routing error.
Message type identifiers for Routing.
aries_cloudagent.messaging.schemas package¶
Credential schema admin routes.
-
class
aries_cloudagent.messaging.schemas.routes.
SchemaGetResultsSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Results schema for schema get request.
-
schema_json
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.schemas.routes.
SchemaSendRequestSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Request schema for schema send request.
-
attributes
¶ Used by autodoc_mock_imports.
-
schema_name
¶ Used by autodoc_mock_imports.
-
schema_version
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.messaging.schemas.routes.
SchemaSendResultsSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Results schema for schema send request.
-
schema_id
¶ Used by autodoc_mock_imports.
-
-
aries_cloudagent.messaging.schemas.routes.
register
(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef3518b630>)[source]¶ Register routes.
aries_cloudagent.messaging.tests package¶
-
class
aries_cloudagent.messaging.tests.test_agent_message.
BasicAgentMessage
(_id: str = None, _decorators: aries_cloudagent.messaging.decorators.base.BaseDecoratorSet = None)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Simple agent message implementation
-
class
aries_cloudagent.messaging.tests.test_agent_message.
SignedAgentMessage
(value: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Signed agent message tests
-
class
aries_cloudagent.messaging.tests.test_agent_message.
SignedAgentMessageSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Utility schema
-
class
Meta
[source]¶ Bases:
object
-
model_class
¶ alias of
SignedAgentMessage
-
signed_fields
= ('value',)¶
-
-
value
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
class
-
class
aries_cloudagent.messaging.tests.test_agent_message.
TestAgentMessage
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Tests agent message.
-
class
BadImplementationClass
(_id: str = None, _decorators: aries_cloudagent.messaging.decorators.base.BaseDecoratorSet = None)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Test utility class.
-
class
-
class
aries_cloudagent.messaging.tests.test_protocol_registry.
TestProtocolRegistry
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
-
no_type_message
= {'a': 'b'}¶
-
test_message_handler
= 'fake_handler'¶
-
test_message_type
= 'PROTOCOL/MESSAGE'¶
-
test_protocol
= 'PROTOCOL'¶
-
test_protocol_queries
= ['*', 'PROTOCOL', 'PROTO*']¶
-
test_protocol_queries_fail
= ['', 'nomatch', 'nomatch*']¶
-
unknown_type_message
= {'@type': 1}¶
-
aries_cloudagent.messaging.trustping package¶
Ping handler.
-
class
aries_cloudagent.messaging.trustping.handlers.ping_handler.
PingHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Ping handler class.
Ping response handler.
-
class
aries_cloudagent.messaging.trustping.handlers.ping_response_handler.
PingResponseHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Ping response handler class.
Represents a trust ping message.
-
class
aries_cloudagent.messaging.trustping.messages.ping.
Ping
(*, response_requested: bool = True, comment: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a trustping message.
-
class
aries_cloudagent.messaging.trustping.messages.ping.
PingSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Schema for Ping class.
-
comment
¶ Used by autodoc_mock_imports.
-
response_requested
¶ Used by autodoc_mock_imports.
-
Represents an response to a trust ping message.
-
class
aries_cloudagent.messaging.trustping.messages.ping_response.
PingResponse
(*, comment: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a ping response.
-
class
aries_cloudagent.messaging.trustping.messages.ping_response.
PingResponseSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
PingResponse schema.
-
class
Meta
[source]¶ Bases:
object
PingResponseSchema metadata.
-
model_class
¶ alias of
PingResponse
-
-
comment
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=True, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
class
Message type identifiers for Trust Pings.
Trust ping admin routes.
Submodules¶
aries_cloudagent.messaging.agent_message module¶
Agent message base class and schema.
-
class
aries_cloudagent.messaging.agent_message.
AgentMessage
(_id: str = None, _decorators: aries_cloudagent.messaging.decorators.base.BaseDecoratorSet = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Agent message base class.
-
Handler
¶ Accessor for the agent message’s handler class.
Returns: Handler class
-
class
Meta
[source]¶ Bases:
object
AgentMessage metadata.
-
handler_class
= None¶
-
message_type
= None¶
-
schema_class
= None¶
-
-
assign_thread_from
(msg: aries_cloudagent.messaging.agent_message.AgentMessage)[source]¶ Copy thread information from a previous message.
Parameters: msg – The received message containing optional thread information
-
assign_thread_id
(thid: str, pthid: str = None)[source]¶ Assign a specific thread ID.
Parameters: - thid – The thread identifier
- pthid – The parent thread identifier
-
get_signature
(field_name: str) → aries_cloudagent.messaging.decorators.signature_decorator.SignatureDecorator[source]¶ Get the signature for a named field.
Parameters: field_name – Field name to get the signature for Returns: A SignatureDecorator for the requested field name
-
set_signature
(field_name: str, signature: aries_cloudagent.messaging.decorators.signature_decorator.SignatureDecorator)[source]¶ Add or replace the signature for a named field.
Parameters: - field_name – Field to set signature on
- signature – Signature for the field
-
sign_field
(field_name: str, signer_verkey: str, wallet: aries_cloudagent.wallet.base.BaseWallet, timestamp=None) → aries_cloudagent.messaging.decorators.signature_decorator.SignatureDecorator[source]¶ Create and store a signature for a named field.
Parameters: - field_name – Field to sign
- signer_verkey – Verkey of signer
- wallet – Wallet to use for signature
- timestamp – Optional timestamp for signature
Returns: A SignatureDecorator for newly created signature
Raises: ValueError
– If field_name doesn’t exist on this message
-
verify_signatures
(wallet: aries_cloudagent.wallet.base.BaseWallet) → bool[source]¶ Verify all associated field signatures.
Parameters: wallet – Wallet to use in verification Returns: True if all signatures verify, else false
-
verify_signed_field
(field_name: str, wallet: aries_cloudagent.wallet.base.BaseWallet, signer_verkey: str = None) → str[source]¶ Verify a specific field signature.
Parameters: - field_name – The field name to verify
- wallet – Wallet to use for the verification
- signer_verkey – Verkey of signer to use
Returns: The verkey of the signer
Raises: ValueError
– If field_name does not exist on this messageValueError
– If the verification failsValueError
– If the verkey of the signature does not match the- provided verkey
-
-
exception
aries_cloudagent.messaging.agent_message.
AgentMessageError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelError
Base exception for agent message issues.
-
class
aries_cloudagent.messaging.agent_message.
AgentMessageSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
AgentMessage schema.
-
class
Meta
[source]¶ Bases:
object
AgentMessageSchema metadata.
-
model_class
= None¶
-
signed_fields
= None¶
-
-
check_dump_decorators
(obj)[source]¶ Pre-dump hook to validate and load the message decorators.
Parameters: obj – The AgentMessage object Raises: BaseModelError
– If a decorator does not validate
-
dump_decorators
(data)[source]¶ Post-dump hook to write the decorators to the serialized output.
Parameters: obj – The serialized data Returns: The modified data
-
extract_decorators
(data)[source]¶ Pre-load hook to extract the decorators and check the signed fields.
Parameters: data – Incoming data to parse
Returns: Parsed and modified data
Raises: ValidationError
– If a field signature does not correlate- to a field in the message
ValidationError
– If the message defines both a field signature- and a value for the same field
ValidationError
– If there is a missing field signature
-
class
aries_cloudagent.messaging.base_context module¶
Abstract RequestContext base class.
aries_cloudagent.messaging.base_handler module¶
A Base handler class for all message handlers.
-
class
aries_cloudagent.messaging.base_handler.
BaseHandler
[source]¶ Bases:
abc.ABC
Abstract base class for handlers.
-
exception
aries_cloudagent.messaging.base_handler.
HandlerException
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Exception base class for generic handler errors.
aries_cloudagent.messaging.error module¶
Messaging-related error classes and codes.
-
exception
aries_cloudagent.messaging.error.
MessageParseError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Message parse error.
-
error_code
= 'message_parse_error'¶
-
-
exception
aries_cloudagent.messaging.error.
MessagePrepareError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Message preparation error.
-
error_code
= 'message_prepare_error'¶
-
aries_cloudagent.messaging.message_delivery module¶
Classes for representing message delivery details.
-
class
aries_cloudagent.messaging.message_delivery.
MessageDelivery
(*, connection_id: str = None, direct_response: bool = False, direct_response_requested: str = None, in_time: datetime.datetime = None, raw_message: str = None, recipient_verkey: str = None, recipient_did: str = None, recipient_did_public: str = None, sender_did: str = None, sender_verkey: str = None, socket_id: str = None, thread_id: str = None, transport_type: str = None)[source]¶ Bases:
object
Properties of an agent message’s delivery.
-
connection_id
¶ Accessor for the pairwise connection identifier.
Returns: This context’s connection identifier
-
direct_response
¶ Accessor for the flag indicating that direct responses are preferred.
Returns: This context’s direct response flag
-
direct_response_requested
¶ Accessor for the requested direct response mode.
Returns: This context’s requested direct response mode
-
in_time
¶ Accessor for the datetime the message was received.
Returns: This context’s received time
-
raw_message
¶ Accessor for the raw message text.
Returns: The raw message text
-
recipient_did
¶ Accessor for the recipient DID which corresponds with the verkey.
Returns: The recipient DID
-
recipient_did_public
¶ Check if the recipient did is public.
Indicates whether the message is associated with a public (ledger) recipient DID.
Returns: True if the recipient’s DID is public, else false
-
recipient_verkey
¶ Accessor for the recipient verkey key used to pack the incoming request.
Returns: The recipient verkey
-
sender_did
¶ Accessor for the sender DID which corresponds with the verkey.
Returns: The sender did
-
sender_verkey
¶ Accessor for the sender public key used to pack the incoming request.
Returns: This context’s sender’s verkey
-
socket_id
¶ Accessor for the identifier of the incoming socket connection.
Returns: This context’s socket identifier
-
thread_id
¶ Accessor for the identifier of the message thread.
Returns: The delivery thread ID
-
transport_type
¶ Accessor for the transport type used to receive the message.
Returns: This context’s transport type
-
aries_cloudagent.messaging.outbound_message module¶
Outbound message representation.
-
class
aries_cloudagent.messaging.outbound_message.
OutboundMessage
(payload: Union[str, bytes], *, connection_id: str = None, encoded: bool = False, endpoint: str = None, reply_socket_id: str = None, reply_thread_id: str = None, reply_to_verkey: str = None, target: aries_cloudagent.messaging.connections.models.connection_target.ConnectionTarget = None)[source]¶ Bases:
object
Represents an outgoing message.
-
endpoint
¶ Return the endpoint of the outbound message.
Defaults to the endpoint of the connection target.
-
aries_cloudagent.messaging.protocol_registry module¶
Handle registration and publication of supported message families.
-
class
aries_cloudagent.messaging.protocol_registry.
ProtocolRegistry
[source]¶ Bases:
object
Protocol registry for indexing message families.
-
controllers
¶ Accessor for a list of all protocol controller functions.
-
message_types
¶ Accessor for a list of all message types.
-
prepare_disclosed
(context: aries_cloudagent.config.injection_context.InjectionContext, protocols: Sequence[str])[source]¶ Call controllers and return publicly supported message families and roles.
-
protocols
¶ Accessor for a list of all message protocols.
-
protocols_matching_query
(query: str) → Sequence[str][source]¶ Return a list of message protocols matching a query string.
-
register_controllers
(*controller_sets)[source]¶ Add new controllers.
Parameters: controller_sets – Mappings of message families to coroutines
-
aries_cloudagent.messaging.request_context module¶
Request context class.
A request context provides everything required by handlers and other parts of the system to process a message.
-
class
aries_cloudagent.messaging.request_context.
RequestContext
(*, base_context: aries_cloudagent.config.injection_context.InjectionContext = None, settings: Mapping[str, object] = None)[source]¶ Bases:
aries_cloudagent.config.injection_context.InjectionContext
Context established by the Conductor and passed into message handlers.
-
connection_ready
¶ Accessor for the flag indicating an active connection with the sender.
Returns: True if the connection is active, else False
-
connection_record
¶ Accessor for the related connection record.
-
copy
() → aries_cloudagent.messaging.request_context.RequestContext[source]¶ Produce a copy of the request context instance.
-
default_endpoint
¶ Accessor for the default agent endpoint (from agent config).
Returns: The default agent endpoint
-
default_label
¶ Accessor for the default agent label (from agent config).
Returns: The default label
-
message
¶ Accessor for the deserialized message instance.
Returns: This context’s agent message
-
message_delivery
¶ Accessor for the message delivery information.
Returns: This context’s message delivery information
-
aries_cloudagent.messaging.responder module¶
A message responder.
The responder is provided to message handlers to enable them to send a new message in response to the message being handled.
-
class
aries_cloudagent.messaging.responder.
BaseResponder
(*, connection_id: str = None, reply_socket_id: str = None, reply_to_verkey: str = None)[source]¶ Bases:
abc.ABC
Interface for message handlers to send responses.
-
create_outbound
(message: Union[aries_cloudagent.messaging.agent_message.AgentMessage, str, bytes], *, connection_id: str = None, reply_socket_id: str = None, reply_thread_id: str = None, reply_to_verkey: str = None, target: aries_cloudagent.messaging.connections.models.connection_target.ConnectionTarget = None) → aries_cloudagent.messaging.outbound_message.OutboundMessage[source]¶ Create an OutboundMessage from a message payload.
-
send
(message: Union[aries_cloudagent.messaging.agent_message.AgentMessage, str, bytes], **kwargs)[source]¶ Convert a message to an OutboundMessage and send it.
-
send_outbound
(message: aries_cloudagent.messaging.outbound_message.OutboundMessage)[source]¶ Send an outbound message.
Parameters: message – The OutboundMessage to be sent
-
send_reply
(message: Union[aries_cloudagent.messaging.agent_message.AgentMessage, str, bytes], *, connection_id: str = None, target: aries_cloudagent.messaging.connections.models.connection_target.ConnectionTarget = None)[source]¶ Send a reply to an incoming message.
Parameters: - message – the AgentMessage, or pre-packed str or bytes to reply with
- connection_id – optionally override the target connection ID
- target – optionally specify a ConnectionTarget to send to
Raises: ResponderError
– If there is no active connection
-
-
class
aries_cloudagent.messaging.responder.
MockResponder
[source]¶ Bases:
aries_cloudagent.messaging.responder.BaseResponder
Mock responder implementation for use by tests.
-
send
(message: Union[aries_cloudagent.messaging.agent_message.AgentMessage, str, bytes], **kwargs)[source]¶ Convert a message to an OutboundMessage and send it.
-
send_outbound
(message: aries_cloudagent.messaging.outbound_message.OutboundMessage)[source]¶ Send an outbound message.
-
-
exception
aries_cloudagent.messaging.responder.
ResponderError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Responder error.
aries_cloudagent.messaging.serializer module¶
Standard message serializer classes.
-
class
aries_cloudagent.messaging.serializer.
MessageSerializer
[source]¶ Bases:
object
Standard DIDComm message parser and serializer.
-
encode_message
(context: aries_cloudagent.config.injection_context.InjectionContext, message_json: Union[str, bytes], recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str) → Union[str, bytes][source]¶ Encode an outgoing message for transport.
Parameters: - context – The injection context for settings and services
- message_json – The message body to serialize
- recipient_keys – A sequence of recipient verkeys
- routing_keys – A sequence of routing verkeys
- sender_key – The verification key of the sending agent
Returns: The encoded message
-
extract_message_type
(parsed_msg: dict) → str[source]¶ Extract the message type identifier from a parsed message.
Raises: MessageParseError
– If the message doesn’t specify a type
-
parse_message
(context: aries_cloudagent.config.injection_context.InjectionContext, message_body: Union[str, bytes], transport_type: str) → Tuple[dict, aries_cloudagent.messaging.message_delivery.MessageDelivery][source]¶ Deserialize an incoming message and further populate the request context.
Parameters: - context – The injection context for settings and services
- message_body – The body of the message
- transport_type – The transport the message was received on
Returns: A message delivery object with details on the parsed message
Raises: MessageParseError
– If the JSON parsing failedMessageParseError
– If a wallet is required but can’t be located
-
aries_cloudagent.messaging.socket module¶
Duplex connection handling classes.
-
class
aries_cloudagent.messaging.socket.
SocketInfo
(*, connection_id: str = None, handler: Coroutine[T_co, T_contra, V_co] = None, reply_mode: str = None, reply_thread_ids: Sequence[str] = None, reply_verkeys: Sequence[str] = None, single_response: _asyncio.Future = None, socket_id: str = None)[source]¶ Bases:
object
Track an open transport connection for direct routing of outbound messages.
-
REPLY_MODE_ALL
= 'all'¶
-
REPLY_MODE_NONE
= 'none'¶
-
REPLY_MODE_THREAD
= 'thread'¶
-
closed
¶ Accessor for the socket closed state.
-
process_incoming
(parsed_msg: dict, delivery: aries_cloudagent.messaging.message_delivery.MessageDelivery)[source]¶ Process an incoming message and update the socket metadata as necessary.
Parameters: - parsed_msg – The unserialized message body
- delivery – The message delivery metadata
-
reply_mode
¶ Accessor for the socket reply mode.
-
aries_cloudagent.messaging.util module¶
Utils for messages.
-
aries_cloudagent.messaging.util.
datetime_to_str
(dt: Union[str, datetime.datetime]) → str[source]¶ Convert a datetime object to an indy-standard datetime string.
Parameters: dt – May be a string or datetime to allow automatic conversion
-
aries_cloudagent.messaging.util.
str_to_datetime
(dt: Union[str, datetime.datetime]) → datetime.datetime[source]¶ Convert an indy-standard datetime string to a datetime.
Using a fairly lax regex pattern to match slightly different formats. In Python 3.7 datetime.fromisoformat might be used.
Parameters: dt – May be a string or datetime to allow automatic conversion
aries_cloudagent.storage package¶
Subpackages¶
Submodules¶
aries_cloudagent.storage.base module¶
Abstract base classes for non-secrets storage.
-
class
aries_cloudagent.storage.base.
BaseStorage
[source]¶ Bases:
abc.ABC
Abstract Non-Secrets interface.
-
add_record
(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Add a new record to the store.
Parameters: record – StorageRecord to be stored
-
delete_record
(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Delete an existing record.
Parameters: record – StorageRecord to delete
Update an existing stored record’s tags.
Parameters: - record – StorageRecord to delete
- tags – Tags
-
get_record
(record_type: str, record_id: str) → aries_cloudagent.storage.record.StorageRecord[source]¶ Fetch a record from the store by type and ID.
Parameters: - record_type – The record type
- record_id – The record id
Returns: A StorageRecord instance
-
search_records
(type_filter: str, tag_query: Mapping[KT, VT_co] = None, page_size: int = None) → aries_cloudagent.storage.base.BaseStorageRecordSearch[source]¶ Create a new record query.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- page_size – Page size
Returns: An instance of BaseStorageRecordSearch
Update an existing stored record’s tags.
Parameters: - record – StorageRecord to update
- tags – New tags
-
-
class
aries_cloudagent.storage.base.
BaseStorageRecordSearch
(store: aries_cloudagent.storage.base.BaseStorage, type_filter: str, tag_query: Mapping[KT, VT_co], page_size: int = None)[source]¶ Bases:
abc.ABC
Represent an active stored records search.
-
fetch
(max_count: int) → Sequence[aries_cloudagent.storage.record.StorageRecord][source]¶ Fetch the next list of results from the store.
Parameters: max_count – Max number of records to return Returns: A list of `StorageRecord`s
-
fetch_all
() → Sequence[aries_cloudagent.storage.record.StorageRecord][source]¶ Fetch all records from the query.
-
fetch_single
() → aries_cloudagent.storage.record.StorageRecord[source]¶ Fetch a single query result.
-
handle
¶ Handle a search request.
-
opened
¶ Accessor for open state.
Returns: True if opened, else False
-
page_size
¶ Accessor for page size.
Returns: The page size
-
store
¶ BaseStorage backend for this implementation.
Returns: The BaseStorage implementation being used
-
tag_query
¶ Accessor for tag query.
Returns: The tag query
-
type_filter
¶ Accessor for type filter.
Returns: The type filter
-
aries_cloudagent.storage.basic module¶
Basic in-memory storage implementation (non-wallet).
-
class
aries_cloudagent.storage.basic.
BasicStorage
(_wallet: aries_cloudagent.wallet.base.BaseWallet = None)[source]¶ Bases:
aries_cloudagent.storage.base.BaseStorage
Basic in-memory storage class.
-
add_record
(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Add a new record to the store.
Parameters: record – StorageRecord to be stored
Raises: StorageError
– If no record is providedStorageError
– If the record has no ID
-
delete_record
(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Delete a record.
Parameters: record – StorageRecord to delete Raises: StorageNotFoundError
– If record not found
Update an existing stored record’s tags.
Parameters: - record – StorageRecord to delete
- tags – Tags
Raises: StorageNotFoundError
– If record not found
-
get_record
(record_type: str, record_id: str) → aries_cloudagent.storage.record.StorageRecord[source]¶ Fetch a record from the store by type and ID.
Parameters: - record_type – The record type
- record_id – The record id
Returns: A StorageRecord instance
Raises: StorageNotFoundError
– If the record is not found
-
search_records
(type_filter: str, tag_query: Mapping[KT, VT_co] = None, page_size: int = None) → aries_cloudagent.storage.basic.BasicStorageRecordSearch[source]¶ Search stored records.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- page_size – Page size
Returns: An instance of BaseStorageRecordSearch
Update an existing stored record’s tags.
Parameters: - record – StorageRecord to update
- tags – New tags
Raises: StorageNotFoundError
– If record not found
-
-
class
aries_cloudagent.storage.basic.
BasicStorageRecordSearch
(store: aries_cloudagent.storage.basic.BasicStorage, type_filter: str, tag_query: Mapping[KT, VT_co], page_size: int = None)[source]¶ Bases:
aries_cloudagent.storage.base.BaseStorageRecordSearch
Represent an active stored records search.
-
fetch
(max_count: int) → Sequence[aries_cloudagent.storage.record.StorageRecord][source]¶ Fetch the next list of results from the store.
Parameters: max_count – Max number of records to return Returns: A list of `StorageRecord`s Raises: StorageSearchError
– If the search query has not been opened
-
opened
¶ Accessor for open state.
Returns: True if opened, else False
-
aries_cloudagent.storage.error module¶
Storage-related exceptions.
-
exception
aries_cloudagent.storage.error.
StorageDuplicateError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.storage.error.StorageError
Duplicate record found in storage.
-
exception
aries_cloudagent.storage.error.
StorageError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Base class for Storage errors.
-
exception
aries_cloudagent.storage.error.
StorageNotFoundError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.storage.error.StorageError
Record not found in storage.
-
exception
aries_cloudagent.storage.error.
StorageSearchError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.storage.error.StorageError
General exception during record search.
aries_cloudagent.storage.indy module¶
Indy implementation of BaseStorage interface.
-
class
aries_cloudagent.storage.indy.
IndyStorage
(wallet: aries_cloudagent.wallet.indy.IndyWallet)[source]¶ Bases:
aries_cloudagent.storage.base.BaseStorage
Indy Non-Secrets interface.
-
add_record
(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Add a new record to the store.
Parameters: record – StorageRecord to be stored
-
delete_record
(record: aries_cloudagent.storage.record.StorageRecord)[source]¶ Delete a record.
Parameters: record – StorageRecord to delete
Raises: StorageNotFoundError
– If record not foundStorageError
– If a libindy error occurs
Update an existing stored record’s tags.
Parameters: - record – StorageRecord to delete
- tags – Tags
-
get_record
(record_type: str, record_id: str) → aries_cloudagent.storage.record.StorageRecord[source]¶ Fetch a record from the store by type and ID.
Parameters: - record_type – The record type
- record_id – The record id
Returns: A StorageRecord instance
Raises: StorageError
– If the record is not providedStorageError
– If the record ID not providedStorageNotFoundError
– If the record is not foundStorageError
– If record not found
-
search_records
(type_filter: str, tag_query: Mapping[KT, VT_co] = None, page_size: int = None) → aries_cloudagent.storage.indy.IndyStorageRecordSearch[source]¶ Search stored records.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- page_size – Page size
Returns: An instance of BaseStorageRecordSearch
Update an existing stored record’s tags.
Parameters: - record – StorageRecord to update
- tags – New tags
Raises: StorageNotFoundError
– If record not foundStorageError
– If a libindy error occurs
-
update_record_value
(record: aries_cloudagent.storage.record.StorageRecord, value: str)[source]¶ Update an existing stored record’s value.
Parameters: - record – StorageRecord to update
- value – The new value
Raises: StorageNotFoundError
– If record not foundStorageError
– If a libindy error occurs
-
wallet
¶ Accessor for IndyWallet instance.
-
-
class
aries_cloudagent.storage.indy.
IndyStorageRecordSearch
(store: aries_cloudagent.storage.indy.IndyStorage, type_filter: str, tag_query: Mapping[KT, VT_co], page_size: int = None)[source]¶ Bases:
aries_cloudagent.storage.base.BaseStorageRecordSearch
Represent an active stored records search.
-
fetch
(max_count: int) → Sequence[aries_cloudagent.storage.record.StorageRecord][source]¶ Fetch the next list of results from the store.
Parameters: max_count – Max number of records to return Returns: A list of `StorageRecord`s Raises: StorageSearchError
– If the search query has not been opened
-
handle
¶ Accessor for search handle.
Returns: The handle
-
opened
¶ Accessor for open state.
Returns: True if opened, else False
-
aries_cloudagent.storage.provider module¶
Default storage provider classes.
-
class
aries_cloudagent.storage.provider.
StorageProvider
[source]¶ Bases:
aries_cloudagent.config.base.BaseProvider
Provider for the default configurable storage classes.
-
STORAGE_TYPES
= {'basic': 'aries_cloudagent.storage.basic.BasicStorage', 'indy': 'aries_cloudagent.storage.indy.IndyStorage', 'postgres_storage': 'aries_cloudagent.storage.indy.IndyStorage'}¶
-
aries_cloudagent.storage.record module¶
Record instance stored and searchable by BaseStorage implementation.
-
class
aries_cloudagent.storage.record.
StorageRecord
[source]¶ Bases:
aries_cloudagent.storage.record.StorageRecord
Storage record class.
aries_cloudagent.tests package¶
Submodules¶
aries_cloudagent.tests.test_conductor module¶
-
class
aries_cloudagent.tests.test_conductor.
Config
[source]¶ Bases:
object
-
bad_inbound_transports
= {'transport.inbound_configs': [['bad', 'host', 80]]}¶
-
bad_outbound_transports
= {'transport.outbound_configs': ['bad']}¶
-
good_inbound_transports
= {'transport.inbound_configs': [['http', 'host', 80]]}¶
-
good_outbound_transports
= {'transport.outbound_configs': ['http']}¶
-
test_settings
= {}¶
-
-
class
aries_cloudagent.tests.test_conductor.
StubContextBuilder
(settings)[source]¶ Bases:
aries_cloudagent.config.base_context.ContextBuilder
-
class
aries_cloudagent.tests.test_conductor.
TestConductor
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
,aries_cloudagent.tests.test_conductor.Config
aries_cloudagent.tests.test_init module¶
aries_cloudagent.tests.test_stats module¶
aries_cloudagent.transport package¶
Subpackages¶
aries_cloudagent.transport.inbound package¶
Base inbound transport class.
-
class
aries_cloudagent.transport.inbound.base.
BaseInboundTransport
[source]¶ Bases:
abc.ABC
Base inbound transport class.
-
class
aries_cloudagent.transport.inbound.base.
InboundTransportConfiguration
(module, host, port)¶ Bases:
tuple
-
host
¶ Alias for field number 1
-
module
¶ Alias for field number 0
-
port
¶ Alias for field number 2
-
-
exception
aries_cloudagent.transport.inbound.base.
InboundTransportRegistrationError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Error in loading an inbound transport.
-
exception
aries_cloudagent.transport.inbound.base.
InboundTransportSetupError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Setup error for an inbound transport.
Http Transport classes and functions.
-
class
aries_cloudagent.transport.inbound.http.
HttpTransport
(host: str, port: int, message_router: Coroutine[T_co, T_contra, V_co], register_socket: Coroutine[T_co, T_contra, V_co])[source]¶ Bases:
aries_cloudagent.transport.inbound.base.BaseInboundTransport
Http Transport class.
-
inbound_message_handler
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef342c8710>)[source]¶ Message handler for inbound messages.
Parameters: request – aiohttp request object Returns: The web response
-
invite_message_handler
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fef342c8710>)[source]¶ Message handler for invites.
Parameters: request – aiohttp request object Returns: The web response
-
make_application
() → <sphinx.ext.autodoc.importer._MockObject object at 0x7fef342c8710>[source]¶ Construct the aiohttp application.
-
scheme
¶ Accessor for this transport’s scheme.
-
Inbound transport manager.
-
class
aries_cloudagent.transport.inbound.manager.
InboundTransportManager
[source]¶ Bases:
object
Inbound transport manager class.
-
register
(config: aries_cloudagent.transport.inbound.base.InboundTransportConfiguration, message_handler, register_socket)[source]¶ Register transport module.
Parameters: - module_path – Path to module
- host – The host to register on
- port – The port to register on
- message_handler – The message handler for incoming messages
- register_socket – A coroutine for registering a new socket
-
Websockets Transport classes and functions.
-
class
aries_cloudagent.transport.inbound.ws.
WsTransport
(host: str, port: int, message_router: Coroutine[T_co, T_contra, V_co], register_socket: Coroutine[T_co, T_contra, V_co])[source]¶ Bases:
aries_cloudagent.transport.inbound.base.BaseInboundTransport
Websockets Transport class.
-
inbound_message_handler
(request)[source]¶ Message handler for inbound messages.
Parameters: request – aiohttp request object Returns: The web response
-
make_application
() → <sphinx.ext.autodoc.importer._MockObject object at 0x7fef34258240>[source]¶ Construct the aiohttp application.
-
scheme
¶ Accessor for this transport’s scheme.
-
aries_cloudagent.transport.outbound package¶
Abstract outbound queue.
-
class
aries_cloudagent.transport.outbound.queue.base.
BaseOutboundMessageQueue
[source]¶ Bases:
abc.ABC
Abstract outbound queue class.
-
dequeue
(*, timeout: int = None)[source]¶ Dequeue a message.
Returns: The dequeued message, or None if a timeout occurs
Raises: - asyncio.CancelledError if the queue has been stopped
- asyncio.TimeoutError if the timeout is reached
-
Basic in memory queue.
-
class
aries_cloudagent.transport.outbound.queue.basic.
BasicOutboundMessageQueue
[source]¶ Bases:
aries_cloudagent.transport.outbound.queue.base.BaseOutboundMessageQueue
Basic in memory queue implementation class.
-
dequeue
(*, timeout: int = None)[source]¶ Dequeue a message.
Returns: The dequeued message, or None if a timeout occurs
Raises: - asyncio.CancelledError if the queue has been stopped
- asyncio.TimeoutError if the timeout is reached
-
Base outbound transport.
-
class
aries_cloudagent.transport.outbound.base.
BaseOutboundTransport
[source]¶ Bases:
abc.ABC
Base outbound transport class.
-
exception
aries_cloudagent.transport.outbound.base.
OutboundTransportRegistrationError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Outbound transport registration error.
Http outbound transport.
-
class
aries_cloudagent.transport.outbound.http.
HttpTransport
[source]¶ Bases:
aries_cloudagent.transport.outbound.base.BaseOutboundTransport
Http outbound transport class.
-
handle_message
(message: aries_cloudagent.messaging.outbound_message.OutboundMessage)[source]¶ Handle message from queue.
Parameters: message – OutboundMessage to send over transport implementation
-
schemes
= ('http', 'https')¶
-
Outbound transport manager.
-
exception
aries_cloudagent.transport.outbound.manager.
OutboundDeliveryError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Base exception when a message cannot be delivered via an outbound transport.
-
class
aries_cloudagent.transport.outbound.manager.
OutboundTransportManager
(queue: aries_cloudagent.transport.outbound.queue.base.BaseOutboundMessageQueue = None)[source]¶ Bases:
object
Outbound transport manager class.
-
dispatch_message
(message: aries_cloudagent.messaging.outbound_message.OutboundMessage, attempt: int = None)[source]¶ Dispatch a message to the relevant transport.
Find a registered transport for the scheme in the uri and use it to send the message.
Parameters: message – The outbound message to dispatch
-
get_registered_transport_for_scheme
(scheme: str)[source]¶ Find the registered transport for a given scheme.
-
get_running_transport_for_scheme
(scheme: str)[source]¶ Find the running transport for a given scheme.
-
register
(module_path)[source]¶ Register a new outbound transport by module path.
Parameters: module_path – Module path to register
Raises: OutboundTransportRegistrationError
– If the imported class cannot be locatedOutboundTransportRegistrationError
– If the imported class does not specify a schemes attributeOutboundTransportRegistrationError
– If the scheme has already been registered
-
register_class
(transport_class: Type[aries_cloudagent.transport.outbound.base.BaseOutboundTransport])[source]¶ Register a new outbound transport class.
Parameters: transport_class – Transport class to register
Raises: OutboundTransportRegistrationError
– If the imported class does not specify a schemes attributeOutboundTransportRegistrationError
– If the scheme has already been registered
-
Websockets outbound transport.
-
class
aries_cloudagent.transport.outbound.ws.
WsTransport
[source]¶ Bases:
aries_cloudagent.transport.outbound.base.BaseOutboundTransport
Websockets outbound transport class.
-
handle_message
(message: aries_cloudagent.messaging.outbound_message.OutboundMessage)[source]¶ Handle message from queue.
Parameters: message – OutboundMessage to send over transport implementation
-
schemes
= ('ws', 'wss')¶
-
aries_cloudagent.verifier package¶
Subpackages¶
Submodules¶
aries_cloudagent.verifier.base module¶
Base Verifier class.
aries_cloudagent.verifier.indy module¶
Indy verifier implementation.
-
class
aries_cloudagent.verifier.indy.
IndyVerifier
(wallet)[source]¶ Bases:
aries_cloudagent.verifier.base.BaseVerifier
Indy holder class.
aries_cloudagent.wallet package¶
Abstract and Indy wallet handling.
Subpackages¶
aries_cloudagent.wallet.tests package¶
Wallet test suite
-
class
aries_cloudagent.wallet.tests.test_basic_wallet.
TestBasicWallet
[source]¶ Bases:
object
-
missing_did
= 'YVnYBGTdjZUoQXKQjHV87i'¶
-
missing_verkey
= 'JAfHCRDH9ZW5E7m4mofjr8cpAHaZdiRQ94it75aXUPK3'¶
-
test_did
= '55GkHamhTU1ZbTbV2ab9DE'¶
-
test_message
= 'test message'¶
-
test_message_bytes
= b'test message bytes'¶
-
test_metadata
= {'meta': True}¶
-
test_seed
= 'testseed000000000000000000000001'¶
-
test_signature
= b'\xd6\x98\x04\x88\xd2-\xc1D\x02\x15\xc9Z\x9bK \x8f\xe0\x8b5\xd0Z$\xe3\x02\x19\xa1\xb3\x86\xfa2\x07\xc8\xbd3-\x1c\xc4\x8d\x8e\xa3\x9be\xea\xcf\x8bc\xfa_\x0c\xb2jE\xe4}\x12+\xbc0\x01l\xdb\x97\xf6\x02'¶
-
test_target_did
= 'GbuDUYXaUZRfHD2jeDuQuP'¶
-
test_target_seed
= 'testseed000000000000000000000002'¶
-
test_target_verkey
= '9WCgWKUaAJj3VWxxtzvvMQN3AoFxoBtBDo9ntwJnVVCC'¶
-
test_update_metadata
= {'meta': False}¶
-
test_verkey
= '3Dn1SJNPaCXcvvJvSbsFWP2xaCjMom3can8CQNhWrTRx'¶
-
Submodules¶
aries_cloudagent.wallet.base module¶
Wallet base class.
-
class
aries_cloudagent.wallet.base.
BaseWallet
(config: dict)[source]¶ Bases:
abc.ABC
Abstract wallet interface.
-
WALLET_TYPE
= None¶
-
create_local_did
(seed: str = None, did: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Create and store a new local DID.
Parameters: - seed – Optional seed to use for did
- did – The DID to use
- metadata – Metadata to store with DID
Returns: The created DIDInfo
-
create_pairwise
(their_did: str, their_verkey: str, my_did: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Create a new pairwise DID for a secure connection.
Parameters: - their_did – Their DID
- their_verkey – Their verkey
- my_did – My DID
- metadata – Metadata for relationship
Returns: A PairwiseInfo instance representing the new relationship
-
create_public_did
(seed: str = None, did: str = None, metadata: dict = {}) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Create and store a new public DID.
Implicitly flags all other dids as not public.
Parameters: - seed – Optional seed to use for did
- did – The DID to use
- metadata – Metadata to store with DID
Returns: The created DIDInfo
-
create_signing_key
(seed: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.KeyInfo[source]¶ Create a new public/private signing keypair.
Parameters: - seed – Optional seed allowing deterministic key creation
- metadata – Optional metadata to store with the keypair
Returns: A KeyInfo representing the new record
-
created
¶ Check whether the wallet was created on the last open call.
-
decrypt_message
(enc_message: bytes, to_verkey: str, use_auth: bool) -> (<class 'bytes'>, <class 'str'>)[source]¶ Decrypt a message assembled by auth_crypt or anon_crypt.
Parameters: - enc_message – The encrypted message content
- to_verkey – The verkey of the recipient. If provided then auth_decrypt is used, otherwise anon_decrypt is used.
Returns: - A tuple of the decrypted message content and sender verkey
(None for anon_crypt)
-
encrypt_message
(message: bytes, to_verkey: str, from_verkey: str = None) → bytes[source]¶ Apply auth_crypt or anon_crypt to a message.
Parameters: - message – The binary message content
- to_verkey – The verkey of the recipient
- from_verkey – The verkey of the sender. If provided then auth_crypt is used, otherwise anon_crypt is used.
Returns: The encrypted message content
-
get_local_did
(did: str) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Find info for a local DID.
Parameters: did – The DID to get info for Returns: A DIDInfo instance for the DID
-
get_local_did_for_verkey
(verkey: str) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Resolve a local DID from a verkey.
Parameters: verkey – Verkey to get DID info for Returns: A DIDInfo instance for the DID
-
get_local_dids
() → Sequence[aries_cloudagent.wallet.base.DIDInfo][source]¶ Get list of defined local DIDs.
Returns: A list of DIDInfo instances
-
get_pairwise_for_did
(their_did: str) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Find info for a pairwise DID.
Parameters: their_did – The DID representing the relationship Returns: A PairwiseInfo instance representing the relationship
-
get_pairwise_for_verkey
(their_verkey: str) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Resolve a pairwise DID from a verkey.
Parameters: their_verkey – The verkey representing the relationship Returns: A PairwiseInfo instance representing the relationship
-
get_pairwise_list
() → Sequence[aries_cloudagent.wallet.base.PairwiseInfo][source]¶ Get list of defined pairwise DIDs.
Returns: A list of PairwiseInfo instances for all relationships
-
get_public_did
() → aries_cloudagent.wallet.base.DIDInfo[source]¶ Retrieve the public did.
Returns: The created DIDInfo
-
get_signing_key
(verkey: str) → aries_cloudagent.wallet.base.KeyInfo[source]¶ Fetch info for a signing keypair.
Parameters: verkey – The verification key of the keypair Returns: A KeyInfo representing the keypair
-
handle
¶ Get internal wallet reference.
Returns: Defaults to None
-
name
¶ Accessor for the wallet name.
Returns: Defaults to None
-
opened
¶ Check whether wallet is currently open.
Returns: Defaults to False
-
pack_message
(message: str, to_verkeys: Sequence[str], from_verkey: str = None) → bytes[source]¶ Pack a message for one or more recipients.
Parameters: - message – The message to pack
- to_verkeys – The verkeys to pack the message for
- from_verkey – The sender verkey
Returns: The packed message
-
replace_local_did_metadata
(did: str, metadata: dict)[source]¶ Replace the metadata associated with a local DID.
Parameters: - did – DID to replace metadata for
- metadata – The new metadata
-
replace_pairwise_metadata
(their_did: str, metadata: dict)[source]¶ Replace the metadata associated with a pairwise DID.
Parameters: - their_did – The did representing the relationship
- metadata – The new metadata
-
replace_signing_key_metadata
(verkey: str, metadata: dict)[source]¶ Replace the metadata associated with a signing keypair.
Parameters: - verkey – The verification key of the keypair
- metadata – The new metadata to store
-
set_public_did
(did: str) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Assign the public did.
Returns: The created DIDInfo
-
sign_message
(message: bytes, from_verkey: str) → bytes[source]¶ Sign a message using the private key associated with a given verkey.
Parameters: - message – The message to sign
- from_verkey – Sign using the private key related to this verkey
Returns: The signature
-
type
¶ Accessor for the wallet type.
Returns: Defaults to None
-
unpack_message
(enc_message: bytes) -> (<class 'str'>, <class 'str'>, <class 'str'>)[source]¶ Unpack a message.
Parameters: enc_message – The encrypted message Returns: (message, from_verkey, to_verkey) Return type: A tuple
-
verify_message
(message: bytes, signature: bytes, from_verkey: str) → bool[source]¶ Verify a signature against the public key of the signer.
Parameters: - message – The message to verify
- signature – The signature to verify
- from_verkey – Verkey to use in verification
Returns: True if verified, else False
-
-
class
aries_cloudagent.wallet.base.
DIDInfo
(did, verkey, metadata)¶ Bases:
tuple
-
did
¶ Alias for field number 0
-
metadata
¶ Alias for field number 2
-
verkey
¶ Alias for field number 1
-
aries_cloudagent.wallet.basic module¶
In-memory implementation of BaseWallet interface.
-
class
aries_cloudagent.wallet.basic.
BasicWallet
(config: dict = None)[source]¶ Bases:
aries_cloudagent.wallet.base.BaseWallet
In-memory wallet implementation.
-
WALLET_TYPE
= 'basic'¶
-
create_local_did
(seed: str = None, did: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Create and store a new local DID.
Parameters: - seed – Optional seed to use for did
- did – The DID to use
- metadata – Metadata to store with DID
Returns: A DIDInfo instance representing the created DID
Raises: WalletDuplicateError
– If the DID already exists in the wallet
-
create_pairwise
(their_did: str, their_verkey: str, my_did: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Create a new pairwise DID for a secure connection.
Parameters: - their_did – The other party’s DID
- their_verkey – The other party’s verkey
- my_did – My DID
- metadata – Metadata to store with this relationship
Returns: A PairwiseInfo object representing the pairwise connection
Raises: WalletDuplicateError
– If the DID already exists in the wallet
-
create_signing_key
(seed: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.KeyInfo[source]¶ Create a new public/private signing keypair.
Parameters: - seed – Seed to use for signing key
- metadata – Optional metadata to store with the keypair
Returns: A KeyInfo representing the new record
Raises: WalletDuplicateError
– If the resulting verkey already exists in the wallet
-
created
¶ Check whether the wallet was created on the last open call.
-
decrypt_message
(enc_message: bytes, to_verkey: str, use_auth: bool) -> (<class 'bytes'>, <class 'str'>)[source]¶ Decrypt a message assembled by auth_crypt or anon_crypt.
Parameters: - message – The encrypted message content
- to_verkey – The verkey of the recipient. If provided then auth_decrypt is used, otherwise anon_decrypt is used.
- use_auth – True if you would like to auth_decrypt, False for anon_decrypt
Returns: A tuple of the decrypted message content and sender verkey (None for anon_crypt)
-
encrypt_message
(message: bytes, to_verkey: str, from_verkey: str = None) → bytes[source]¶ Apply auth_crypt or anon_crypt to a message.
Parameters: - message – The binary message content
- to_verkey – The verkey of the recipient
- from_verkey – The verkey of the sender. If provided then auth_crypt is used, otherwise anon_crypt is used.
Returns: The encrypted message content
-
get_local_did
(did: str) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Find info for a local DID.
Parameters: did – The DID to get info for Returns: A DIDInfo instance representing the found DID Raises: WalletNotFoundError
– If the DID is not found
-
get_local_did_for_verkey
(verkey: str) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Resolve a local DID from a verkey.
Parameters: verkey – The verkey to get the local DID for Returns: A DIDInfo instance representing the found DID Raises: WalletNotFoundError
– If the verkey is not found
-
get_local_dids
() → Sequence[aries_cloudagent.wallet.base.DIDInfo][source]¶ Get list of defined local DIDs.
Returns: A list of locally stored DIDs as DIDInfo instances
-
get_pairwise_for_did
(their_did: str) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Find info for a pairwise DID.
Parameters: their_did – The DID to get a pairwise relationship for Returns: A PairwiseInfo instance representing the relationship Raises: WalletNotFoundError
– If the DID is unknown
-
get_pairwise_for_verkey
(their_verkey: str) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Resolve a pairwise DID from a verkey.
Parameters: their_verkey – The verkey to get a pairwise relationship for Returns: A PairwiseInfo instance for the relationship Raises: WalletNotFoundError
– If the verkey is not found
-
get_pairwise_list
() → Sequence[aries_cloudagent.wallet.base.PairwiseInfo][source]¶ Get list of defined pairwise DIDs.
Returns: A list of PairwiseInfo instances for all pairwise relationships
-
get_signing_key
(verkey: str) → aries_cloudagent.wallet.base.KeyInfo[source]¶ Fetch info for a signing keypair.
Parameters: verkey – The verification key of the keypair Returns: A KeyInfo representing the keypair Raises: WalletNotFoundError
– if no keypair is associated with the verification key
-
name
¶ Accessor for the wallet name.
-
opened
¶ Check whether wallet is currently open.
Returns: True
-
pack_message
(message: str, to_verkeys: Sequence[str], from_verkey: str = None) → bytes[source]¶ Pack a message for one or more recipients.
Parameters: - message – The message to pack
- to_verkeys – List of verkeys to pack for
- from_verkey – Sender verkey to pack from
Returns: The resulting packed message bytes
-
replace_local_did_metadata
(did: str, metadata: dict)[source]¶ Replace metadata for a local DID.
Parameters: - did – The DID to replace metadata for
- metadata – The new metadata
Raises: WalletNotFoundError
– If the DID doesn’t exist
-
replace_pairwise_metadata
(their_did: str, metadata: dict)[source]¶ Replace metadata for a pairwise DID.
Parameters: - their_did – The DID to replace metadata for
- metadata – The new metadata
Raises: WalletNotFoundError
– If the DID is unknown
-
replace_signing_key_metadata
(verkey: str, metadata: dict)[source]¶ Replace the metadata associated with a signing keypair.
Parameters: - verkey – The verification key of the keypair
- metadata – The new metadata to store
Raises: WalletNotFoundError
– if no keypair is associated with the verification key
-
sign_message
(message: bytes, from_verkey: str) → bytes[source]¶ Sign a message using the private key associated with a given verkey.
Parameters: - message – Message bytes to sign
- from_verkey – The verkey to use to sign
Returns: A signature
Raises: WalletError
– If the message is not providedWalletError
– If the verkey is not provided
-
unpack_message
(enc_message: bytes) -> (<class 'str'>, <class 'str'>, <class 'str'>)[source]¶ Unpack a message.
Parameters: enc_message – The packed message bytes
Returns: (message, from_verkey, to_verkey)
Return type: A tuple
Raises: WalletError
– If the message is not providedWalletError
– If there is a problem unpacking the message
-
verify_message
(message: bytes, signature: bytes, from_verkey: str) → bool[source]¶ Verify a signature against the public key of the signer.
Parameters: - message – Message to verify
- signature – Signature to verify
- from_verkey – Verkey to use in verification
Returns: True if verified, else False
Raises: WalletError
– If the verkey is not providedWalletError
– If the signature is not providedWalletError
– If the message is not provided
-
aries_cloudagent.wallet.crypto module¶
Cryptography functions used by BasicWallet.
-
class
aries_cloudagent.wallet.crypto.
PackMessageSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Packed message schema.
-
ciphertext
¶ Used by autodoc_mock_imports.
-
iv
¶ Used by autodoc_mock_imports.
-
protected
¶ Used by autodoc_mock_imports.
-
tag
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.wallet.crypto.
PackRecipientHeaderSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Packed recipient header schema.
-
iv
¶ Used by autodoc_mock_imports.
-
kid
¶ Used by autodoc_mock_imports.
-
sender
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.wallet.crypto.
PackRecipientSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Packed recipient schema.
-
encrypted_key
¶ Used by autodoc_mock_imports.
-
header
¶ Used by autodoc_mock_imports.
-
-
class
aries_cloudagent.wallet.crypto.
PackRecipientsSchema
(*args, **kwargs)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Packed recipients schema.
-
alg
¶ Used by autodoc_mock_imports.
-
enc
¶ Used by autodoc_mock_imports.
-
recipients
¶ Used by autodoc_mock_imports.
-
typ
¶ Used by autodoc_mock_imports.
-
-
aries_cloudagent.wallet.crypto.
anon_crypt_message
(message: bytes, to_verkey: bytes) → bytes[source]¶ Apply anon_crypt to a binary message.
Parameters: - message – The message to encrypt
- to_verkey – The verkey to encrypt the message for
Returns: The anon encrypted message
-
aries_cloudagent.wallet.crypto.
anon_decrypt_message
(enc_message: bytes, secret: bytes) → bytes[source]¶ Apply anon_decrypt to a binary message.
Parameters: - enc_message – The encrypted message
- secret – The seed to use
Returns: The decrypted message
-
aries_cloudagent.wallet.crypto.
auth_crypt_message
(message: bytes, to_verkey: bytes, from_secret: bytes) → bytes[source]¶ Apply auth_crypt to a binary message.
Parameters: - message – The message to encrypt
- to_verkey – To recipient’s verkey
- from_secret – The seed to use
Returns: The encrypted message
-
aries_cloudagent.wallet.crypto.
auth_decrypt_message
(enc_message: bytes, secret: bytes) -> (<class 'bytes'>, <class 'str'>)[source]¶ Apply auth_decrypt to a binary message.
Parameters: - enc_message – The encrypted message
- secret – Secret for signing keys
Returns: A tuple of (decrypted message, sender verkey)
-
aries_cloudagent.wallet.crypto.
create_keypair
(seed: bytes = None) -> (<class 'bytes'>, <class 'bytes'>)[source]¶ Create a public and private signing keypair from a seed value.
Parameters: seed – Seed for keypair Returns: A tuple of (public key, secret key)
-
aries_cloudagent.wallet.crypto.
decode_pack_message
(enc_message: bytes, find_key: Callable) -> (<class 'str'>, typing.Union[str, NoneType], <class 'str'>)[source]¶ Decode a packed message.
Disassemble and unencrypt a packed message, returning the message content, verification key of the sender (if available), and verification key of the recipient.
Parameters: - enc_message – The encrypted message
- find_key – Function to retrieve private key
Returns: A tuple of (message, sender_vk, recip_vk)
Raises: ValueError
– If the packed message is invalidValueError
– If the packed message reipients are invalidValueError
– If the pack algorithm is unsupportedValueError
– If the sender’s public key was not provided
-
aries_cloudagent.wallet.crypto.
decrypt_plaintext
(ciphertext: bytes, recips_bin: bytes, nonce: bytes, key: bytes) → str[source]¶ Decrypt the payload of a packed message.
Parameters: - ciphertext –
- recips_bin –
- nonce –
- key –
Returns: The decrypted string
-
aries_cloudagent.wallet.crypto.
encode_pack_message
(message: str, to_verkeys: Sequence[bytes], from_secret: bytes = None) → bytes[source]¶ Assemble a packed message for a set of recipients, optionally including the sender.
Parameters: - message – The message to pack
- to_verkeys – The verkeys to pack the message for
- from_secret – The sender secret
Returns: The encoded message
-
aries_cloudagent.wallet.crypto.
encrypt_plaintext
(message: str, add_data: bytes, key: bytes) -> (<class 'bytes'>, <class 'bytes'>, <class 'bytes'>)[source]¶ Encrypt the payload of a packed message.
Parameters: - message – Message to encrypt
- add_data –
- key – Key used for encryption
Returns: A tuple of (ciphertext, nonce, tag)
-
aries_cloudagent.wallet.crypto.
locate_pack_recipient_key
(recipients: Sequence[dict], find_key: Callable) -> (<class 'bytes'>, <class 'str'>, <class 'str'>)[source]¶ Locate pack recipient key.
Decode the encryption key and sender verification key from a corresponding recipient block, if any is defined.
Parameters: - recipients – Recipients to locate
- find_key – Function used to find private key
Returns: A tuple of (cek, sender_vk, recip_vk_b58)
Raises: ValueError
– If no corresponding recipient key found
-
aries_cloudagent.wallet.crypto.
prepare_pack_recipient_keys
(to_verkeys: Sequence[bytes], from_secret: bytes = None) -> (<class 'str'>, <class 'bytes'>)[source]¶ Assemble the recipients block of a packed message.
Parameters: - to_verkeys – Verkeys of recipients
- from_secret – Secret to use for signing keys
Returns: A tuple of (json result, key)
-
aries_cloudagent.wallet.crypto.
random_seed
() → bytes[source]¶ Generate a random seed value.
Returns: A new random seed
-
aries_cloudagent.wallet.crypto.
seed_to_did
(seed: str) → str[source]¶ Derive a did from a seed value.
Parameters: seed – The seed to derive Returns: The did derived from the seed
-
aries_cloudagent.wallet.crypto.
sign_message
(message: bytes, secret: bytes) → bytes[source]¶ Sign a message using a private signing key.
Parameters: - message – The message to sign
- secret – The private signing key
Returns: The signature
aries_cloudagent.wallet.error module¶
Wallet-related exceptions.
-
exception
aries_cloudagent.wallet.error.
WalletDuplicateError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.wallet.error.WalletError
Duplicate record exception.
-
exception
aries_cloudagent.wallet.error.
WalletError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
General wallet exception.
-
exception
aries_cloudagent.wallet.error.
WalletNotFoundError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.wallet.error.WalletError
Record not found exception.
aries_cloudagent.wallet.indy module¶
Indy implementation of BaseWallet interface.
-
class
aries_cloudagent.wallet.indy.
IndyWallet
(config: dict = None)[source]¶ Bases:
aries_cloudagent.wallet.base.BaseWallet
Indy wallet implementation.
-
DEFAULT_FRESHNESS
= 0¶
-
DEFAULT_KEY
= ''¶
-
DEFAULT_NAME
= 'default'¶
-
DEFAULT_STORAGE_TYPE
= None¶
-
WALLET_TYPE
= 'indy'¶
-
create
(replace: bool = False)[source]¶ Create a new wallet.
Parameters: replace – Removes the old wallet if True
Raises: WalletError
– If there was a problem removing the walletWalletError
– IF there was a libindy error
-
create_local_did
(seed: str = None, did: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Create and store a new local DID.
Parameters: - seed – Optional seed to use for did
- did – The DID to use
- metadata – Metadata to store with DID
Returns: A DIDInfo instance representing the created DID
Raises: WalletDuplicateError
– If the DID already exists in the walletWalletError
– If there is a libindy error
-
create_pairwise
(their_did: str, their_verkey: str, my_did: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Create a new pairwise DID for a secure connection.
Parameters: - their_did – The other party’s DID
- their_verkey – The other party’s verkey
- my_did – My DID
- metadata – Metadata to store with this relationship
Returns: A PairwiseInfo object representing the pairwise connection
Raises: WalletError
– If there is a libindy errorWalletDuplicateError
– If the DID already exists in the wallet
-
create_signing_key
(seed: str = None, metadata: dict = None) → aries_cloudagent.wallet.base.KeyInfo[source]¶ Create a new public/private signing keypair.
Parameters: - seed – Seed for key
- metadata – Optional metadata to store with the keypair
Returns: A KeyInfo representing the new record
Raises: WalletDuplicateError
– If the resulting verkey already exists in the walletWalletError
– If there is a libindy error
-
created
¶ Check whether the wallet was created on the last open call.
-
decrypt_message
(enc_message: bytes, to_verkey: str, use_auth: bool) -> (<class 'bytes'>, <class 'str'>)[source]¶ Decrypt a message assembled by auth_crypt or anon_crypt.
Parameters: - message – The encrypted message content
- to_verkey – The verkey of the recipient. If provided then auth_decrypt is used, otherwise anon_decrypt is used.
- use_auth – True if you would like to auth_decrypt, False for anon_decrypt
Returns: A tuple of the decrypted message content and sender verkey (None for anon_crypt)
Raises: WalletError
– If a libindy error occurs
-
encrypt_message
(message: bytes, to_verkey: str, from_verkey: str = None) → bytes[source]¶ Apply auth_crypt or anon_crypt to a message.
Parameters: - message – The binary message content
- to_verkey – The verkey of the recipient
- from_verkey – The verkey of the sender. If provided then auth_crypt is used, otherwise anon_crypt is used.
Returns: The encrypted message content
Raises: WalletError
– If a libindy error occurs
-
get_local_did
(did: str) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Find info for a local DID.
Parameters: did – The DID to get info for
Returns: A DIDInfo instance representing the found DID
Raises: WalletNotFoundError
– If the DID is not foundWalletError
– If there is a libindy error
-
get_local_did_for_verkey
(verkey: str) → aries_cloudagent.wallet.base.DIDInfo[source]¶ Resolve a local DID from a verkey.
Parameters: verkey – The verkey to get the local DID for Returns: A DIDInfo instance representing the found DID Raises: WalletNotFoundError
– If the verkey is not found
-
get_local_dids
() → Sequence[aries_cloudagent.wallet.base.DIDInfo][source]¶ Get list of defined local DIDs.
Returns: A list of locally stored DIDs as DIDInfo instances
-
get_pairwise_for_did
(their_did: str) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Find info for a pairwise DID.
Parameters: their_did – The DID to get a pairwise relationship for
Returns: A PairwiseInfo instance representing the relationship
Raises: WalletNotFoundError
– If no pairwise DID defined for targetWalletNotFoundError
– If no pairwise DID defined for target
-
get_pairwise_for_verkey
(their_verkey: str) → aries_cloudagent.wallet.base.PairwiseInfo[source]¶ Resolve a pairwise DID from a verkey.
Parameters: their_verkey – The verkey to get a pairwise relationship for Returns: A PairwiseInfo instance for the relationship Raises: WalletNotFoundError
– If no pairwise DID is defined for verkey
-
get_pairwise_list
() → Sequence[aries_cloudagent.wallet.base.PairwiseInfo][source]¶ Get list of defined pairwise DIDs.
Returns: A list of PairwiseInfo instances for all pairwise relationships
-
get_signing_key
(verkey: str) → aries_cloudagent.wallet.base.KeyInfo[source]¶ Fetch info for a signing keypair.
Parameters: verkey – The verification key of the keypair
Returns: A KeyInfo representing the keypair
Raises: WalletNotFoundError
– If no keypair is associated with the verification keyWalletError
– If there is a libindy error
-
handle
¶ Get internal wallet reference.
Returns: A handle to the wallet
-
master_secret_id
¶ Accessor for the master secret id.
Returns: The master secret id
-
name
¶ Accessor for the wallet name.
Returns: The wallet name
-
open
()[source]¶ Open wallet, removing and/or creating it if so configured.
Raises: WalletError
– If wallet not found after creationWalletNotFoundError
– If the wallet is not foundWalletError
– If the wallet is already openWalletError
– If there is a libindy error
-
opened
¶ Check whether wallet is currently open.
Returns: True if open, else False
-
pack_message
(message: str, to_verkeys: Sequence[str], from_verkey: str = None) → bytes[source]¶ Pack a message for one or more recipients.
Parameters: - message – The message to pack
- to_verkeys – List of verkeys to pack for
- from_verkey – Sender verkey to pack from
Returns: The resulting packed message bytes
Raises: WalletError
– If no message is providedWalletError
– If a libindy error occurs
-
remove
()[source]¶ Remove an existing wallet.
Raises: WalletNotFoundError
– If the wallet could not be foundWalletError
– If there was an libindy error
-
replace_local_did_metadata
(did: str, metadata: dict)[source]¶ Replace metadata for a local DID.
Parameters: - did – The DID to replace metadata for
- metadata – The new metadata
-
replace_pairwise_metadata
(their_did: str, metadata: dict)[source]¶ Replace metadata for a pairwise DID.
Parameters: - their_did – The DID to replace metadata for
- metadata – The new metadata
-
replace_signing_key_metadata
(verkey: str, metadata: dict)[source]¶ Replace the metadata associated with a signing keypair.
Parameters: - verkey – The verification key of the keypair
- metadata – The new metadata to store
Raises: WalletNotFoundError
– if no keypair is associated with the verification key
-
sign_message
(message: bytes, from_verkey: str) → bytes[source]¶ Sign a message using the private key associated with a given verkey.
Parameters: - message – Message bytes to sign
- from_verkey – The verkey to use to sign
Returns: A signature
Raises: WalletError
– If the message is not providedWalletError
– If the verkey is not providedWalletError
– If a libindy error occurs
-
unpack_message
(enc_message: bytes) -> (<class 'str'>, <class 'str'>, <class 'str'>)[source]¶ Unpack a message.
Parameters: enc_message – The packed message bytes
Returns: (message, from_verkey, to_verkey)
Return type: A tuple
Raises: WalletError
– If the message is not providedWalletError
– If a libindy error occurs
-
verify_message
(message: bytes, signature: bytes, from_verkey: str) → bool[source]¶ Verify a signature against the public key of the signer.
Parameters: - message – Message to verify
- signature – Signature to verify
- from_verkey – Verkey to use in verification
Returns: True if verified, else False
Raises: WalletError
– If the verkey is not providedWalletError
– If the signature is not providedWalletError
– If the message is not providedWalletError
– If a libindy error occurs
-
aries_cloudagent.wallet.provider module¶
Default wallet provider classes.
-
class
aries_cloudagent.wallet.provider.
WalletProvider
[source]¶ Bases:
aries_cloudagent.config.base.BaseProvider
Provider for the default configurable wallet classes.
-
WALLET_TYPES
= {'basic': 'aries_cloudagent.wallet.basic.BasicWallet', 'indy': 'aries_cloudagent.wallet.indy.IndyWallet'}¶
-
aries_cloudagent.wallet.util module¶
Wallet utility functions.
-
aries_cloudagent.wallet.util.
b58_to_bytes
(val: str) → bytes[source]¶ Convert a base 58 string to bytes.
-
aries_cloudagent.wallet.util.
b64_to_bytes
(val: str, urlsafe=False) → bytes[source]¶ Convert a base 64 string to bytes.
Submodules¶
aries_cloudagent.classloader module¶
The classloader provides utilties to dynamically load classes and modules.
-
class
aries_cloudagent.classloader.
ClassLoader
(base_path, super_class)[source]¶ Bases:
object
Class used to load classes from modules dynamically.
-
load
(module_path, load_relative=False)[source]¶ Load module by module path.
Parameters: - module_path – Dotted path to module
- load_relative – Should the method check in the
- base path for relative import (configured) –
Returns: The loaded class
Raises: ModuleLoadError
– If there is an error loading the classClassNotFoundError
– If there is no class to load at specified path
-
classmethod
load_class
(class_name: str, default_module: str = None)[source]¶ Resolve a complete class path (ie. typing.Dict) to the class itself.
Parameters: - class_name – Class name
- default_module – (Default value = None)
Returns: The resolved class
Raises: ClassNotFoundError
– If the class could not be resolved at pathModuleLoadError
– If there was an error loading the module
-
classmethod
load_module
(mod_path: str, default_module: str = None)[source]¶ Resolve a complete class path (ie. typing.Dict) to the class itself.
Parameters: - class_name – Class name
- default_module – (Default value = None)
Returns: The resolved class
Raises: ClassNotFoundError
– If the class could not be resolved at pathModuleLoadError
– If there was an error loading the module
-
-
exception
aries_cloudagent.classloader.
ClassNotFoundError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Class not found error.
-
exception
aries_cloudagent.classloader.
ModuleLoadError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Module load error.
aries_cloudagent.conductor module¶
The Conductor.
The conductor is responsible for coordinating messages that are received over the network, communicating with the ledger, passing messages to handlers, instantiating concrete implementations of required modules and storing data in the wallet.
-
class
aries_cloudagent.conductor.
Conductor
(context_builder: aries_cloudagent.config.base_context.ContextBuilder)[source]¶ Bases:
object
Conductor class.
Class responsible for initializing concrete implementations of our require interfaces and routing inbound and outbound message data.
-
inbound_message_router
(message_body: Union[str, bytes], transport_type: str = None, socket_id: str = None, single_response: _asyncio.Future = None) → _asyncio.Future[source]¶ Route inbound messages.
Parameters: - message_body – Body of the incoming message
- transport_type – Type of transport this message came from
- socket_id – The identifier of the incoming socket connection
- single_response – A future to contain the first direct response message
-
outbound_message_router
(message: aries_cloudagent.messaging.outbound_message.OutboundMessage, context: aries_cloudagent.config.injection_context.InjectionContext = None) → None[source]¶ Route an outbound message.
Parameters: - message – An outbound message to be sent
- context – Optional request context
-
prepare_outbound_message
(message: aries_cloudagent.messaging.outbound_message.OutboundMessage, context: aries_cloudagent.config.injection_context.InjectionContext = None)[source]¶ Prepare a response message for transmission.
Parameters: - message – An outbound message to be sent
- context – Optional request context
-
aries_cloudagent.defaults module¶
Sane defaults for known message definitions.
aries_cloudagent.dispatcher module¶
The Dispatcher.
The dispatcher is responsible for coordinating data flow between handlers, providing lifecycle hook callbacks storing state for message threads, etc.
-
class
aries_cloudagent.dispatcher.
Dispatcher
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Bases:
object
Dispatcher class.
Class responsible for dispatching messages to message handlers and responding to other agents.
-
dispatch
(parsed_msg: dict, delivery: aries_cloudagent.messaging.message_delivery.MessageDelivery, connection: aries_cloudagent.messaging.connections.models.connection_record.ConnectionRecord, send: Coroutine[T_co, T_contra, V_co]) → _asyncio.Future[source]¶ Configure responder and dispatch message context to message handler.
Parameters: - parsed_msg – The parsed message body
- delivery – The incoming message delivery metadata
- connection – The related connection record, if any
- send – Function to send outbound messages
Returns: The response from the handler
-
make_message
(parsed_msg: dict) → aries_cloudagent.messaging.agent_message.AgentMessage[source]¶ Deserialize a message dict into the appropriate message instance.
Given a dict describing a message, this method returns an instance of the related message class.
Parameters: parsed_msg – The parsed message
Returns: An instance of the corresponding message class for this message
Raises: MessageParseError
– If the message doesn’t specify @typeMessageParseError
– If there is no message class registered to handle- the given type
-
-
class
aries_cloudagent.dispatcher.
DispatcherResponder
(send: Coroutine[T_co, T_contra, V_co], context: aries_cloudagent.messaging.request_context.RequestContext, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.responder.BaseResponder
Handle outgoing messages from message handlers.
-
create_outbound
(message: Union[aries_cloudagent.messaging.agent_message.AgentMessage, str, bytes], **kwargs) → aries_cloudagent.messaging.outbound_message.OutboundMessage[source]¶ Create an OutboundMessage from a message body.
-
aries_cloudagent.error module¶
Common exception classes.
-
exception
aries_cloudagent.error.
BaseError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
Exception
Generic exception class which other exceptions should inherit from.
-
error_code
= None¶
-
message
¶ Accessor for the error message.
-
-
exception
aries_cloudagent.error.
StartupError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.error.BaseError
Error raised when there is a problem starting the conductor.
aries_cloudagent.postgres module¶
Utility for loading Postgres wallet plug-in.
aries_cloudagent.stats module¶
Classes for tracking performance and timing.
-
class
aries_cloudagent.stats.
Collector
(enabled: bool = True)[source]¶ Bases:
object
Collector for a set of statistics.
-
enabled
¶ Accessor for the collector’s enabled property.
-
extract
(groups: Sequence[str] = None) → dict[source]¶ Extract statistics for a specific set of groups.
-
log
(name: str, duration: float)[source]¶ Log an entry in the statistics if the collector is enabled.
-
results
¶ Accessor for the current set of collected statistics.
-
wrap
(obj, prop_name: Union[str, Sequence[str]], groups: Sequence[str] = None, *, ignore_missing: bool = False)[source]¶ Wrap a method on a class or class instance.
-
aries_cloudagent.task_processor module¶
Classes for managing a limited set of concurrent tasks.
-
class
aries_cloudagent.task_processor.
PendingTask
(ident, fn: Callable[[PendingTask], Awaitable[T_co]], retries: int = None, retry_delay: float = None)[source]¶ Bases:
object
Class for tracking pending tasks.
-
class
aries_cloudagent.task_processor.
TaskProcessor
(*, max_pending: int = 10)[source]¶ Bases:
object
Class for managing a limited set of concurrent tasks.
-
run_retry
(fn: Callable[[aries_cloudagent.task_processor.PendingTask], Awaitable[T_co]], *, ident=None, retries: int = 5, retry_delay: float = 10.0, when_ready: bool = True) → aries_cloudagent.task_processor.PendingTask[source]¶ Process a task and track the result.
-
aries_cloudagent.version module¶
Library version information.