Aries Cloud Agent Python Code Documentation¶
Hyperledger Aries Cloud Agent Python (ACA-Py) is a foundation for building decentralized identity applications and services running in non-mobile environments.
This is the Read The Docs site for the Hyperledger Aries Cloud Agent Python. This site contains only the ACA-Py docstrings documentation extracted from the Python Code. For other documentation, please consult the links in the Readme for the ACA-Py GitHub Repo.
If you are getting started with verifiable credentials or Aries, we recommend that you start with this verifiable credentials and agents getting started guide.
Want to quick overview of the deployment model for ACA-Py? See this document.
To investigate the code, use search or click the package links in the left menu to drill into the modules, subpackages and submodules that make up ACA-Py.
Developers that are interested in what DIDComm protocols are supported in ACA-Py should take a look at the protocols package. These should align with the corresponding aries-rfcs protocols. Decorators defined in aries-rfcs and implemented in ACA-Py can be found here. Some general purpose subpackages that might be of interest include wallet and storage. For those agents playing different roles in a verifiable credential exchange, take a look at the issuer, holder and verifier packages.
Please see the ACA-Py Contribution guidelines for how to contribute to ACA-Py, including for how to submit issues about ACA-Py.
aries_cloudagent package¶
Aries Cloud Agent.
Subpackages¶
aries_cloudagent.admin package¶
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, max_attempts: 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.core.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.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
(context: aries_cloudagent.config.injection_context.InjectionContext, 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], webhook_router: Callable, task_queue: aries_cloudagent.utils.task_queue.TaskQueue = None, conductor_stats: Coroutine[T_co, T_contra, V_co] = None)[source]¶ Bases:
aries_cloudagent.admin.base_server.BaseAdminServer
Admin HTTP server class.
-
add_webhook_target
(target_url: str, topic_filter: Sequence[str] = None, max_attempts: int = None)[source]¶ Add a webhook target.
-
make_application
() → <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66b600eb8>[source]¶ Get the aiohttp application instance.
-
on_startup
(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66b600eb8>)[source]¶ Perform webserver startup actions.
-
plugins_handler
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66b600eb8>)[source]¶ Request handler for the loaded plugins list.
Parameters: request – aiohttp request object Returns: The module list response
-
redirect_handler
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66b600eb8>)[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 0x7fb66b600eb8>)[source]¶ Request handler for the server status information.
Parameters: request – aiohttp request object Returns: The web response
-
aries_cloudagent.cache package¶
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
-
-
exception
aries_cloudagent.cache.base.
CacheError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Base class for cache-related errors.
-
class
aries_cloudagent.cache.base.
CacheKeyLock
(cache: aries_cloudagent.cache.base.BaseCache, key: str)[source]¶ Bases:
object
A lock on a particular cache key.
Used to prevent multiple async threads from generating or querying the same semi-expensive data. Not thread safe.
-
done
¶ Accessor for the done state.
-
future
¶ Fetch the result in the form of an awaitable future.
-
parent
¶ Accessor for the parent key lock, if any.
-
result
¶ Fetch the current result, if any.
-
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
-
get
(key: str)[source]¶ Get an item from the cache.
Parameters: key – the key to retrieve an item for Returns: The record found or None
-
set
(keys: Union[str, Sequence[str]], value: Any, ttl: int = None)[source]¶ Add an item to the cache with an optional ttl.
Overwrites existing cache entries.
Parameters: - keys – the key or keys for which to set an item
- value – the value to store in the cache
- ttl – number of seconds that the record should persist
-
aries_cloudagent.commands package¶
Commands module common setup.
-
aries_cloudagent.commands.
load_command
(command: str)[source]¶ Load the module corresponding with a named command.
-
aries_cloudagent.commands.
run_command
(command: str, argv: Sequence[str] = None)[source]¶ Execute a named command with command line arguments.
Submodules¶
aries_cloudagent.commands.help module¶
Help command for indexing available commands.
aries_cloudagent.commands.provision module¶
Provision command for setting up agent settings before starting.
-
exception
aries_cloudagent.commands.provision.
ProvisionError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Base exception for provisioning errors.
aries_cloudagent.commands.start module¶
Entrypoint.
-
aries_cloudagent.commands.start.
init_argument_parser
(parser: argparse.ArgumentParser)[source]¶ Initialize an argument parser with the module’s arguments.
-
aries_cloudagent.commands.start.
run_loop
(startup: Coroutine[T_co, T_contra, V_co], shutdown: Coroutine[T_co, T_contra, V_co])[source]¶ Execute the application, handling signals and ctrl-c.
aries_cloudagent.config package¶
Submodules¶
aries_cloudagent.config.argparse module¶
Command line option parsing.
-
class
aries_cloudagent.config.argparse.
AdminGroup
[source]¶ Bases:
aries_cloudagent.config.argparse.ArgumentGroup
Admin server settings.
-
CATEGORIES
= ('start',)¶
-
GROUP_NAME
= 'Admin'¶
-
-
class
aries_cloudagent.config.argparse.
ArgumentGroup
[source]¶ Bases:
abc.ABC
A class representing a group of related command line arguments.
-
GROUP_NAME
= None¶
-
-
class
aries_cloudagent.config.argparse.
DebugGroup
[source]¶ Bases:
aries_cloudagent.config.argparse.ArgumentGroup
Debug settings.
-
CATEGORIES
= ('start',)¶
-
GROUP_NAME
= 'Debug'¶
-
-
class
aries_cloudagent.config.argparse.
GeneralGroup
[source]¶ Bases:
aries_cloudagent.config.argparse.ArgumentGroup
General settings.
-
CATEGORIES
= ('general', 'start')¶
-
GROUP_NAME
= 'General'¶
-
-
class
aries_cloudagent.config.argparse.
LedgerGroup
[source]¶ Bases:
aries_cloudagent.config.argparse.ArgumentGroup
Ledger settings.
-
CATEGORIES
= ('start', 'general')¶
-
GROUP_NAME
= 'Ledger'¶
-
-
class
aries_cloudagent.config.argparse.
LoggingGroup
[source]¶ Bases:
aries_cloudagent.config.argparse.ArgumentGroup
Logging settings.
-
CATEGORIES
= ('general', 'start')¶
-
GROUP_NAME
= 'Logging'¶
-
-
class
aries_cloudagent.config.argparse.
ProtocolGroup
[source]¶ Bases:
aries_cloudagent.config.argparse.ArgumentGroup
Protocol settings.
-
CATEGORIES
= ('start',)¶
-
GROUP_NAME
= 'Protocol'¶
-
-
class
aries_cloudagent.config.argparse.
TransportGroup
[source]¶ Bases:
aries_cloudagent.config.argparse.ArgumentGroup
Transport settings.
-
CATEGORIES
= ('start',)¶
-
GROUP_NAME
= 'Transport'¶
-
-
class
aries_cloudagent.config.argparse.
WalletGroup
[source]¶ Bases:
aries_cloudagent.config.argparse.ArgumentGroup
Wallet settings.
-
CATEGORIES
= ('general', 'start')¶
-
GROUP_NAME
= 'Wallet'¶
-
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.core.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.base_context module¶
Base injection context builder classes.
aries_cloudagent.config.default_context module¶
Classes for configuring the default injection context.
-
class
aries_cloudagent.config.default_context.
DefaultContextBuilder
(settings: Mapping[str, object] = None)[source]¶ Bases:
aries_cloudagent.config.base_context.ContextBuilder
Default context builder.
-
bind_providers
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Bind various class providers.
-
aries_cloudagent.config.error module¶
Errors for config modules.
-
exception
aries_cloudagent.config.error.
ArgsParseError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.config.base.ConfigError
Error raised when there is a problem parsing the command-line arguments.
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.ledger module¶
Ledger configuration.
-
aries_cloudagent.config.ledger.
accept_taa
(ledger: aries_cloudagent.ledger.base.BaseLedger, taa_info, provision: bool = False) → bool[source]¶ Perform TAA acceptance.
aries_cloudagent.config.logging module¶
Utilities related to logging.
-
class
aries_cloudagent.config.logging.
LoggingConfigurator
[source]¶ Bases:
object
Utility class used to configure logging and print an informative start banner.
-
classmethod
configure
(logging_config_path: str = None, log_level: str = None, log_file: str = None)[source]¶ Configure logger.
Parameters: - logging_config_path – str: (Default value = None) Optional path to custom logging config
- log_level – str: (Default value = None)
Print a startup banner describing the configuration.
Parameters: - agent_label – Agent Label
- inbound_transports – Configured inbound transports
- outbound_transports – Configured outbound transports
- admin_server – Admin server info
- public_did – Public DID
- banner_length – (Default value = 40) Length of the banner
- border_character – (Default value = “:”) Character to use in banner
- border –
-
classmethod
-
aries_cloudagent.config.logging.
load_resource
(path: str, encoding: str = None) → TextIO[source]¶ Open a resource file located in a python package or the local filesystem.
Parameters: path – The resource path in the form of dir/file or package:dir/file Returns: A file-like object representing the resource
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.core package¶
Submodules¶
aries_cloudagent.core.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.core.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.
-
dispatch_complete
(message: aries_cloudagent.transport.inbound.message.InboundMessage, completed: aries_cloudagent.utils.task_queue.CompletedTask)[source]¶ Handle completion of message dispatch.
-
handle_not_delivered
(context: aries_cloudagent.config.injection_context.InjectionContext, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]¶ Handle a message that failed delivery via outbound transports.
-
handle_not_returned
(context: aries_cloudagent.config.injection_context.InjectionContext, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]¶ Handle a message that failed delivery via an inbound session.
-
inbound_message_router
(message: aries_cloudagent.transport.inbound.message.InboundMessage, can_respond: bool = False)[source]¶ Route inbound messages.
Parameters: - message – The inbound message instance
- can_respond – If the session supports return routing
-
outbound_message_router
(context: aries_cloudagent.config.injection_context.InjectionContext, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage, inbound: aries_cloudagent.transport.inbound.message.InboundMessage = None) → None[source]¶ Route an outbound message.
Parameters: - context – The request context
- message – An outbound message to be sent
- inbound – The inbound message that produced this response, if available
-
queue_outbound
(context: aries_cloudagent.config.injection_context.InjectionContext, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage, inbound: aries_cloudagent.transport.inbound.message.InboundMessage = None)[source]¶ Queue an outbound message.
Parameters: - context – The request context
- message – An outbound message to be sent
- inbound – The inbound message that produced this response, if available
-
webhook_router
(topic: str, payload: dict, endpoint: str, max_attempts: int = None)[source]¶ Route a webhook through the outbound transport manager.
Parameters: - topic – The webhook topic
- payload – The webhook payload
- endpoint – The endpoint of the webhook target
- max_attempts – The maximum number of attempts
-
aries_cloudagent.core.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.core.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.
-
handle_message
(inbound_message: aries_cloudagent.transport.inbound.message.InboundMessage, send_outbound: Coroutine[T_co, T_contra, V_co], send_webhook: Coroutine[T_co, T_contra, V_co] = None)[source]¶ Configure responder and message context and invoke the message handler.
Parameters: - inbound_message – The inbound message instance
- send_outbound – Async function to send outbound messages
- send_webhook – Async function to dispatch a webhook
Returns: The response from the handler
-
log_task
(task: aries_cloudagent.utils.task_queue.CompletedTask)[source]¶ Log a completed task using the stats collector.
-
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
-
put_task
(coro: Coroutine[T_co, T_contra, V_co], complete: Callable = None, ident: str = None) → aries_cloudagent.utils.task_queue.PendingTask[source]¶ Run a task in the task queue, potentially blocking other handlers.
-
queue_message
(inbound_message: aries_cloudagent.transport.inbound.message.InboundMessage, send_outbound: Coroutine[T_co, T_contra, V_co], send_webhook: Coroutine[T_co, T_contra, V_co] = None, complete: Callable = None) → aries_cloudagent.utils.task_queue.PendingTask[source]¶ Add a message to the processing queue for handling.
Parameters: - inbound_message – The inbound message instance
- send_outbound – Async function to send outbound messages
- send_webhook – Async function to dispatch a webhook
- complete – Function to call when the handler has completed
Returns: A pending task instance resolving to the handler task
-
-
class
aries_cloudagent.core.dispatcher.
DispatcherResponder
(context: aries_cloudagent.messaging.request_context.RequestContext, inbound_message: aries_cloudagent.transport.inbound.message.InboundMessage, send_outbound: Coroutine[T_co, T_contra, V_co], send_webhook: Coroutine[T_co, T_contra, V_co] = None, **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.transport.outbound.message.OutboundMessage[source]¶ Create an OutboundMessage from a message body.
Parameters: message – The message payload
-
aries_cloudagent.core.error module¶
Common exception classes.
-
exception
aries_cloudagent.core.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.core.error.
StartupError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Error raised when there is a problem starting the conductor.
aries_cloudagent.core.plugin_registry module¶
Handle registration of plugin modules for extending functionality.
-
class
aries_cloudagent.core.plugin_registry.
PluginRegistry
[source]¶ Bases:
object
Plugin registry for indexing application plugins.
-
init_context
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Call plugin setup methods on the current context.
-
load_message_types
(context: aries_cloudagent.config.injection_context.InjectionContext, plugin: module)[source]¶ For modules that don’t implement setup, register protocols manually.
-
plugin_names
¶ Accessor for a list of all plugin modules.
-
plugins
¶ Accessor for a list of all plugin modules.
-
aries_cloudagent.core.protocol_registry module¶
Handle registration and publication of supported protocols.
-
class
aries_cloudagent.core.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.holder package¶
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.
-
RECORD_TYPE_MIME_TYPES
= 'attribute-mime-types'¶
-
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
-
get_mime_type
(credential_id: str, attr: str = None) → Union[dict, str][source]¶ Get MIME type per attribute (or for all attributes).
Parameters: - credential_id – credential id
- attr – attribute of interest or omit for all
- Returns: Attribute MIME type or dict mapping attribute names to MIME types
- attr_meta_json = all_meta.tags.get(attr)
-
store_credential
(credential_definition, credential_data, credential_request_metadata, credential_attr_mime_types=None, credential_id=None)[source]¶ Store a credential in the wallet.
Parameters: - credential_definition – Credential definition for this credential
- credential_data – Credential data generated by the issuer
- credential_request_metadata – credential request metadata generated by the issuer
- credential_attr_mime_types – dict mapping attribute names to (optional) MIME types to store as non-secret record, if specified
-
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.core.error.BaseError
Generic issuer error.
aries_cloudagent.issuer.util module¶
aries_cloudagent.ledger package¶
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¶
Save a new record recording the acceptance of the TAA.
Fetch the current AML and TAA from the ledger.
-
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_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 the current transaction author agreement, fetching it if necessary.
-
register_nym
(did: str, verkey: str, alias: str = None, role: str = None)[source]¶ Register a nym on the ledger.
Parameters: - did – DID to register on the ledger.
- verkey – The verification key of the keypair.
- alias – Human-friendly alias to assign to the DID.
- role – For permissioned ledgers, what role should the new DID have.
-
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.core.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.
-
classmethod
wrap_error
(err_value: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a2f7860>, message: str = None, error_cls: Type[aries_cloudagent.ledger.error.LedgerError] = <class 'aries_cloudagent.ledger.error.LedgerError'>) → aries_cloudagent.ledger.error.LedgerError[source]¶ Create an instance of LedgerError from an IndyError.
-
classmethod
-
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, read_only: bool = False)[source]¶ Bases:
aries_cloudagent.ledger.base.BaseLedger
Indy ledger class.
-
LEDGER_TYPE
= 'indy'¶
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.
-
credential_definition_id2schema_id
(credential_definition_id)[source]¶ From a credential definition, get the identifier for its schema.
Parameters: credential_definition_id – The identifier of the credential definition from which to identify a schema
-
fetch_credential_definition
(credential_definition_id: str)[source]¶ Get a credential definition from the ledger by id.
Parameters: credential_definition_id – The cred def id of the cred def to fetch
-
fetch_schema_by_id
(schema_id: str)[source]¶ Get schema from ledger.
Parameters: schema_id – The schema id (or stringified sequence number) to retrieve Returns: Indy schema dict
-
fetch_schema_by_seq_no
(seq_no: int)[source]¶ Fetch a schema by its sequence number.
Parameters: seq_no – schema ledger sequence number Returns: Indy schema dict
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 (or stringified sequence number) to retrieve
Get the current transaction author agreement, fetching it if necessary.
-
register_nym
(did: str, verkey: str, alias: str = None, role: str = None)[source]¶ Register a nym on the ledger.
Parameters: - did – DID to register on the ledger.
- verkey – The verification key of the keypair.
- alias – Human-friendly alias to assign to the DID.
- role – For permissioned ledgers, what role should the new DID have.
-
send_credential_definition
(schema_id: str, tag: str = None)[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
-
send_schema
(schema_name: str, schema_version: str, attribute_names: Sequence[str])[source]¶ Send schema to ledger.
Parameters: - schema_name – The schema name
- schema_version – The schema version
- attribute_names – A list of schema attributes
-
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.ledger.routes module¶
Ledger admin routes.
-
class
aries_cloudagent.ledger.routes.
AMLRecordSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Ledger AML record.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.ledger.routes.
TAAAcceptSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Input schema for accepting the TAA.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.ledger.routes.
TAAAcceptanceSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
TAA acceptance record.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.ledger.routes.
TAAInfoSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Transaction author agreement info.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.ledger.routes.
TAARecordSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Ledger TAA record.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.ledger.routes.
TAAResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for a transaction author agreement.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.ledger.routes.
get_did_endpoint
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66aa1cd68>)[source]¶ Request handler for getting a verkey for a DID from the ledger.
Parameters: request – aiohttp request object
-
aries_cloudagent.ledger.routes.
get_did_verkey
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66aa1cd68>)[source]¶ Request handler for getting a verkey for a DID from the ledger.
Parameters: request – aiohttp request object
-
aries_cloudagent.ledger.routes.
ledger_accept_taa
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66aa1cd68>)[source]¶ Request handler for accepting the current transaction author agreement.
Parameters: request – aiohttp request object Returns: The DID list response
-
aries_cloudagent.ledger.routes.
ledger_get_taa
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66aa1cd68>)[source]¶ Request handler for fetching the transaction author agreement.
Parameters: request – aiohttp request object Returns: The TAA information including the AML
aries_cloudagent.ledger.util module¶
Ledger utilities.
aries_cloudagent.messaging package¶
Subpackages¶
aries_cloudagent.messaging.ack package¶
Represents an explicit ack message as per Aries RFC 15.
-
class
aries_cloudagent.messaging.ack.message.
Ack
(status: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Base class representing an explicit ack message.
Subclass to adopt, specify Meta message type and handler class.
-
class
aries_cloudagent.messaging.ack.message.
AckSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Schema for Ack base class.
-
status
= <fields.Constant(default='OK', attribute=None, validate=None, required=True, load_only=False, dump_only=False, missing=OK, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.'})>¶
-
aries_cloudagent.messaging.credential_definitions package¶
Credential definition admin routes.
-
class
aries_cloudagent.messaging.credential_definitions.routes.
CredentialDefinitionGetResultsSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Results schema for schema get request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.messaging.credential_definitions.routes.
CredentialDefinitionSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Credential definition schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.messaging.credential_definitions.routes.
CredentialDefinitionSendRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for schema send request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.messaging.credential_definitions.routes.
CredentialDefinitionSendResultsSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Results schema for schema send request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.messaging.credential_definitions.routes.
CredentialDefinitionsCreatedResultsSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Results schema for cred-defs-created request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.messaging.credential_definitions.routes.
credential_definitions_created
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a342e80>)[source]¶ Request handler for retrieving credential definitions that current agent created.
Parameters: request – aiohttp request object Returns: The identifiers of matching credential definitions.
-
aries_cloudagent.messaging.credential_definitions.routes.
credential_definitions_get_credential_definition
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a342e80>)[source]¶ Request handler for getting a credential definition from the ledger.
Parameters: request – aiohttp request object Returns: The credential definition details.
-
aries_cloudagent.messaging.credential_definitions.routes.
credential_definitions_send_credential_definition
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a342e80>)[source]¶ Request handler for sending a credential definition to the ledger.
Parameters: request – aiohttp request object Returns: The credential definition identifier
Credential definition utilities.
aries_cloudagent.messaging.decorators package¶
A message decorator for attachments.
An attach decorator embeds content or specifies appended content.
-
class
aries_cloudagent.messaging.decorators.attach_decorator.
AttachDecorator
(*, ident: str = None, description: str = None, filename: str = None, mime_type: str = None, lastmod_time: str = None, byte_count: int = None, data: aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorData, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing attach decorator.
-
classmethod
from_indy_dict
(indy_dict: dict, *, ident: str = None, description: str = None, filename: str = None, lastmod_time: str = None, byte_count: int = None)[source]¶ Create AttachDecorator instance from indy object (dict).
Given indy object (dict), JSON dump, base64-encode, and embed it as data; mark application/json MIME type.
Parameters: - indy_dict – indy (dict) data structure
- ident – optional attachment identifier (default random UUID4)
- description – optional attachment description
- filename – optional attachment filename
- lastmod_time – optional attachment last modification time
- byte_count – optional attachment byte count
-
indy_dict
¶ Return indy data structure encoded in attachment.
Returns: dict with indy object in data attachment
-
classmethod
-
class
aries_cloudagent.messaging.decorators.attach_decorator.
AttachDecoratorData
(*, base64_: str = None, sig_: str = None, json_: str = None, links_: Union[list, str] = None, sha256_: str = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Attach decorator data.
-
class
Meta
[source]¶ Bases:
object
AttachDecoratorData metadata.
-
schema_class
= 'AttachDecoratorDataSchema'¶
-
-
base64
¶ Accessor for base64 decorator data, or None.
-
header
(idx: int = 0, jose: bool = True) → Mapping[KT, VT_co][source]¶ Accessor for header info at input index, default 0 or unique for singly-signed.
Parameters: - idx – index of interest, zero-based (default 0)
- jose – True to return unprotected header attributes, False for protected only
-
json
¶ Accessor for json decorator data, or None.
-
links
¶ Accessor for links decorator data, or None.
-
sha256
¶ Accessor for sha256 decorator data, or None.
-
sig
¶ Accessor for signed-content decorator data, or None.
-
sign
(verkeys: Union[str, Mapping[str, str]], wallet: aries_cloudagent.wallet.base.BaseWallet)[source]¶ Sign and replace base64 data value of attachment.
Parameters: - verkeys – Verkey(s) of the signing party; specify: - single verkey alone for single signature with no key identifier (kid) - dict mapping single key identifier to verkey for single signature - dict mapping key identifiers to verkeys for multi-signature
- wallet – The wallet to use for the signature
-
signatures
¶ Accessor for number of signatures.
-
signed
¶ Accessor for signed content (payload), None for unsigned.
-
class
-
class
aries_cloudagent.messaging.decorators.attach_decorator.
AttachDecoratorDataSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Attach decorator data schema.
-
class
Meta
[source]¶ Bases:
object
Attach decorator data schema metadata.
-
model_class
¶ alias of
AttachDecoratorData
-
-
base64_
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Base64 object>, 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.'})>¶
-
json_
= <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.'})>¶
-
links_
= <fields.List(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 list.'})>¶
-
sha256_
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.SHA256Hash object>, 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.'})>¶
-
sig_
= <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.'})>¶
-
class
-
class
aries_cloudagent.messaging.decorators.attach_decorator.
AttachDecoratorSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Attach decorator schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
AttachDecoratorSchema metadata.
-
model_class
¶ alias of
AttachDecorator
-
-
byte_count
= <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.', 'too_large': 'Number too large.'})>¶
-
data
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
description
= <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.'})>¶
-
filename
= <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.'})>¶
-
ident
= <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.'})>¶
-
lastmod_time
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyISO8601DateTime object>, 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.'})>¶
-
mime_type
= <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.'})>¶
-
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 0x7fb66b0cc518>] = 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.core.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
The please-ack decorator to request acknowledgement.
-
class
aries_cloudagent.messaging.decorators.please_ack_decorator.
PleaseAckDecorator
(message_id: str = None, on: Sequence[str] = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing the please-ack decorator.
-
class
aries_cloudagent.messaging.decorators.please_ack_decorator.
PleaseAckDecoratorSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
PleaseAck decorator schema used in serialization/deserialization.
-
class
Meta
[source]¶ Bases:
object
PleaseAckDecoratorSchema metadata.
-
model_class
¶ alias of
PleaseAckDecorator
-
-
message_id
= <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.'})>¶
-
on
= <fields.List(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 list.'})>¶
-
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.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.core.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
-
make_model
(data: dict, **kwargs)[source]¶ Return model instance after loading.
Returns: A model instance
-
class
Classes for BaseStorage-based record management.
-
class
aries_cloudagent.messaging.models.base_record.
BaseRecord
(id: str = None, state: str = None, *, created_at: Union[str, datetime.datetime] = None, updated_at: Union[str, datetime.datetime] = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Represents a single storage record.
-
CACHE_ENABLED
= False¶
-
CACHE_TTL
= 60¶
-
LOG_STATE_FLAG
= None¶
-
RECORD_ID_NAME
= 'id'¶
-
RECORD_TYPE
= None¶
-
TAG_NAMES
= {'state'}¶
-
WEBHOOK_TOPIC
= None¶
-
classmethod
cache_key
(record_id: str, record_type: str = None)[source]¶ Assemble a cache key.
Parameters: - record_id – The record identifier
- The cache type identifier, defaulting to RECORD_TYPE (record_type) –
-
clear_cached
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Clear the cached value of this record, if any.
-
classmethod
clear_cached_key
(context: aries_cloudagent.config.injection_context.InjectionContext, cache_key: str)[source]¶ Shortcut method to clear a cached key value, if any.
Parameters: - context – The injection context to use
- cache_key – The unique cache identifier
-
delete_record
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Remove the stored record.
Parameters: context – The injection context to use
-
classmethod
from_storage
(record_id: str, record: Mapping[str, Any])[source]¶ Initialize a record from its stored representation.
Parameters: - record_id – The unique record identifier
- record – The stored representation
-
classmethod
get_cached_key
(context: aries_cloudagent.config.injection_context.InjectionContext, cache_key: str)[source]¶ Shortcut method to fetch a cached key value.
Parameters: - context – The injection context to use
- cache_key – The unique cache identifier
-
classmethod
log_state
(context: aries_cloudagent.config.injection_context.InjectionContext, msg: str, params: dict = None, override: bool = False)[source]¶ Print a message with increased visibility (for testing).
-
post_save
(context: aries_cloudagent.config.injection_context.InjectionContext, new_record: bool, last_state: str, webhook: bool = None)[source]¶ Perform post-save actions.
Parameters: - context – The injection context to use
- new_record – Flag indicating if the record was just created
- last_state – The previous state value
- webhook – Adjust whether the webhook is called
-
classmethod
prefix_tag_filter
(tag_filter: dict)[source]¶ Prefix unencrypted tags used in the tag filter.
-
classmethod
query
(context: aries_cloudagent.config.injection_context.InjectionContext, tag_filter: dict = None, post_filter: dict = None) → Sequence[aries_cloudagent.messaging.models.base_record.BaseRecord][source]¶ Query stored records.
Parameters: - context – The injection context to use
- tag_filter – An optional dictionary of tag filter clauses
- post_filter – Additional value filters to apply
Accessor to define implementation-specific tags.
-
record_value
¶ Accessor to define custom properties for the JSON record value.
-
classmethod
retrieve_by_id
(context: aries_cloudagent.config.injection_context.InjectionContext, record_id: str, cached: bool = True) → aries_cloudagent.messaging.models.base_record.BaseRecord[source]¶ Retrieve a stored record by ID.
Parameters: - context – The injection context to use
- record_id – The ID of the record to find
- cached – Whether to check the cache for this record
-
classmethod
retrieve_by_tag_filter
(context: aries_cloudagent.config.injection_context.InjectionContext, tag_filter: dict, post_filter: dict = None) → aries_cloudagent.messaging.models.base_record.BaseRecord[source]¶ Retrieve a record by tag filter.
Parameters: - context – The injection context to use
- tag_filter – The filter dictionary to apply
- post_filter – Additional value filters to apply after retrieval
-
save
(context: aries_cloudagent.config.injection_context.InjectionContext, *, reason: str = None, log_params: Mapping[str, Any] = None, log_override: bool = False, webhook: bool = None) → str[source]¶ Persist the record to storage.
Parameters: - context – The injection context to use
- reason – A reason to add to the log
- log_params – Additional parameters to log
- webhook – Flag to override whether the webhook is sent
-
send_webhook
(context: aries_cloudagent.config.injection_context.InjectionContext, payload: Any, topic: str = None)[source]¶ Send a standard webhook.
Parameters: - context – The injection context to use
- payload – The webhook payload
- topic – The webhook topic, defaulting to WEBHOOK_TOPIC
-
classmethod
set_cached_key
(context: aries_cloudagent.config.injection_context.InjectionContext, cache_key: str, value: Any, ttl=None)[source]¶ Shortcut method to set a cached key value.
Parameters: - context – The injection context to use
- cache_key – The unique cache identifier
- value – The value to cache
- ttl – The cache ttl
-
storage_record
¶ Accessor for a StorageRecord representing this record.
Accessor for the record tags generated for this record.
-
value
¶ Accessor for the JSON record value generated for this record.
-
webhook_payload
¶ Return a JSON-serialized version of the record for the webhook.
-
webhook_topic
¶ Return the webhook topic value.
-
-
class
aries_cloudagent.messaging.models.base_record.
BaseRecordSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Schema to allow serialization/deserialization of base records.
-
created_at
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyISO8601DateTime object>, 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.'})>¶
-
state
= <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.'})>¶
-
updated_at
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyISO8601DateTime object>, 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.'})>¶
-
aries_cloudagent.messaging.schemas package¶
Credential schema admin routes.
-
class
aries_cloudagent.messaging.schemas.routes.
SchemaGetResultsSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Results schema for schema get request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.messaging.schemas.routes.
SchemaSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Content for returned schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.messaging.schemas.routes.
SchemaSendRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for schema send request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.messaging.schemas.routes.
SchemaSendResultsSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Results schema for schema send request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.messaging.schemas.routes.
SchemasCreatedResultsSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Results schema for a schemas-created request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.messaging.schemas.routes.
register
(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a106518>)[source]¶ Register routes.
-
aries_cloudagent.messaging.schemas.routes.
schemas_created
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a106518>)[source]¶ Request handler for retrieving schemas that current agent created.
Parameters: request – aiohttp request object Returns: The identifiers of matching schemas
Schema utilities.
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, **kwargs)[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, **kwargs)[source]¶ Post-dump hook to write the decorators to the serialized output.
Parameters: obj – The serialized data Returns: The modified data
-
extract_decorators
(data, **kwargs)[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_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.core.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.core.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.core.error.BaseError
Message preparation error.
-
error_code
= 'message_prepare_error'¶
-
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_receipt
¶ Accessor for the message receipt information.
Returns: This context’s message receipt 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_session_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_session_id: str = None, reply_thread_id: str = None, reply_to_verkey: str = None, target: aries_cloudagent.connections.models.connection_target.ConnectionTarget = None, target_list: Sequence[aries_cloudagent.connections.models.connection_target.ConnectionTarget] = None, to_session_only: bool = False) → aries_cloudagent.transport.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.transport.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.connections.models.connection_target.ConnectionTarget = None, target_list: Sequence[aries_cloudagent.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.transport.outbound.message.OutboundMessage)[source]¶ Send an outbound message.
-
-
exception
aries_cloudagent.messaging.responder.
ResponderError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Responder error.
aries_cloudagent.messaging.util module¶
Utils for messages.
-
aries_cloudagent.messaging.util.
canon
(raw_attr_name: str) → str[source]¶ Canonicalize input attribute name for indy proofs and credential offers.
Parameters: raw_attr_name – raw attribute name Returns: canonicalized attribute name
-
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.
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.messaging.util.
epoch_to_str
(epoch: int) → str[source]¶ Convert epoch seconds to indy-standard datetime string.
Parameters: epoch – epoch seconds
-
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.messaging.valid module¶
Validators for schema fields.
-
class
aries_cloudagent.messaging.valid.
Base64
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate base64 value.
-
EXAMPLE
= 'ey4uLn0='¶
-
-
class
aries_cloudagent.messaging.valid.
Base64URL
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate base64 value.
-
EXAMPLE
= 'ey4uLn0='¶
-
-
class
aries_cloudagent.messaging.valid.
IndyCredDefId
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against indy credential definition identifier specification.
-
EXAMPLE
= 'WgWxqztrNooG92RXvxSTWv:3:CL:20:tag'¶
-
-
class
aries_cloudagent.messaging.valid.
IndyDID
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against indy DID.
-
EXAMPLE
= 'WgWxqztrNooG92RXvxSTWv'¶
-
-
class
aries_cloudagent.messaging.valid.
IndyISO8601DateTime
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against ISO 8601 datetime format, indy profile.
-
EXAMPLE
= '2020-03-09 21:46:49Z'¶
-
-
class
aries_cloudagent.messaging.valid.
IndyPredicate
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against indy predicate.
-
EXAMPLE
= '>='¶
-
-
class
aries_cloudagent.messaging.valid.
IndyRawPublicKey
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against indy (Ed25519VerificationKey2018) raw public key.
-
EXAMPLE
= 'H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV'¶
-
-
class
aries_cloudagent.messaging.valid.
IndyRevRegId
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against indy revocation registry identifier specification.
-
EXAMPLE
= 'WgWxqztrNooG92RXvxSTWv:4:WgWxqztrNooG92RXvxSTWv:3:CL:20:tag:CL_ACCUM:0'¶
-
-
class
aries_cloudagent.messaging.valid.
IndySchemaId
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against indy schema identifier specification.
-
EXAMPLE
= 'WgWxqztrNooG92RXvxSTWv:2:schema_name:1.0'¶
-
-
class
aries_cloudagent.messaging.valid.
IndyVersion
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against indy version specification.
-
EXAMPLE
= '1.0'¶
-
-
class
aries_cloudagent.messaging.valid.
IntEpoch
[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Validate value against (integer) epoch format.
-
EXAMPLE
= 1583790409¶
-
aries_cloudagent.storage package¶
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, options: Mapping[KT, VT_co] = None) → 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
- options – A dictionary of backend-specific options
Returns: A StorageRecord instance
-
search_records
(type_filter: str, tag_query: Mapping[KT, VT_co] = None, page_size: int = None, options: Mapping[KT, VT_co] = 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
- options – Dictionary of backend-specific options
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, options: Mapping[KT, VT_co] = 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
-
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
-
option
(name: str, default=None)[source]¶ Fetch a named search option, if defined.
Returns: The option value or default
-
options
¶ Accessor for the search options.
Returns: The search options
-
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, options: Mapping[KT, VT_co] = None) → 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
- options – A dictionary of backend-specific options
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, options: Mapping[KT, VT_co] = None) → aries_cloudagent.storage.basic.BasicStorageRecordSearch[source]¶ Search stored records.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- page_size – Page size
- options – Dictionary of backend-specific options
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, options: Mapping[KT, VT_co] = 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 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.core.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, options: Mapping[KT, VT_co] = None) → 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
- options – A dictionary of backend-specific options
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, options: Mapping[KT, VT_co] = None) → aries_cloudagent.storage.indy.IndyStorageRecordSearch[source]¶ Search stored records.
Parameters: - type_filter – Filter string
- tag_query – Tags to query
- page_size – Page size
- options – Dictionary of backend-specific options
Returns: An instance of IndyStorageRecordSearch
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, options: Mapping[KT, VT_co] = 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 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.transport package¶
Subpackages¶
aries_cloudagent.transport.inbound package¶
Base inbound transport class.
-
class
aries_cloudagent.transport.inbound.base.
BaseInboundTransport
(scheme: str, create_session: Callable, *, max_message_size: int = 0, wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat = None)[source]¶ Bases:
abc.ABC
Base inbound transport class.
-
create_session
(*, accept_undelivered: bool = False, can_respond: bool = False, client_info: dict = None, wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat = None) → Awaitable[aries_cloudagent.transport.inbound.session.InboundSession][source]¶ Create a new inbound session.
Parameters: - accept_undelivered – Flag for accepting undelivered messages
- can_respond – Flag indicating that the transport can send responses
- client_info – Request-specific client information
- wire_format – Optionally override the session wire format
-
max_message_size
¶ Accessor for this transport’s max message size.
-
scheme
¶ Accessor for this transport’s scheme.
-
-
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.
InboundTransportError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.error.TransportError
Generic inbound transport error.
-
exception
aries_cloudagent.transport.inbound.base.
InboundTransportRegistrationError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.inbound.base.InboundTransportError
Error in loading an inbound transport.
-
exception
aries_cloudagent.transport.inbound.base.
InboundTransportSetupError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.inbound.base.InboundTransportError
Setup error for an inbound transport.
The Delivery Queue.
The delivery queue holds and manages messages that have not yet been delivered to their intended destination.
-
class
aries_cloudagent.transport.inbound.delivery_queue.
DeliveryQueue
[source]¶ Bases:
object
DeliveryQueue class.
Manages undelivered messages.
-
add_message
(msg: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]¶ Add an OutboundMessage to delivery queue.
The message is added once per recipient key
Parameters: msg – The OutboundMessage to add
-
expire_messages
(ttl=None)[source]¶ Expire messages that are past the time limit.
Parameters: ttl – Optional. Allows override of configured ttl
-
get_one_message_for_key
(key: str)[source]¶ Remove and return a matching message.
Parameters: key – The key to use for lookup
-
has_message_for_key
(key: str)[source]¶ Check for queued messages by key.
Parameters: key – The key to use for lookup
-
inspect_all_messages_for_key
(key: str)[source]¶ Return all messages for key.
Parameters: key – The key to use for lookup
-
Http Transport classes and functions.
-
class
aries_cloudagent.transport.inbound.http.
HttpTransport
(host: str, port: int, create_session, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.inbound.base.BaseInboundTransport
Http Transport class.
-
inbound_message_handler
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb669c3c208>)[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 0x7fb669c3c208>)[source]¶ Message handler for invites.
Parameters: request – aiohttp request object Returns: The web response
-
make_application
() → <sphinx.ext.autodoc.importer._MockObject object at 0x7fb669c3c208>[source]¶ Construct the aiohttp application.
-
Inbound transport manager.
-
class
aries_cloudagent.transport.inbound.manager.
InboundTransportManager
(context: aries_cloudagent.config.injection_context.InjectionContext, receive_inbound: Coroutine[T_co, T_contra, V_co], return_inbound: Callable = None)[source]¶ Bases:
object
Inbound transport manager class.
-
closed_session
(session: aries_cloudagent.transport.inbound.session.InboundSession)[source]¶ Clean up a closed session.
Returns an undelivered message to the caller if possible.
-
create_session
(transport_type: str, *, accept_undelivered: bool = False, can_respond: bool = False, client_info: dict = None, wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat = None)[source]¶ Create a new inbound session.
Parameters: - transport_type – The inbound transport identifier
- accept_undelivered – Flag for accepting undelivered messages
- can_respond – Flag indicating that the transport can send responses
- client_info – An optional dict describing the client
- wire_format – Override the wire format for this session
-
dispatch_complete
(message: aries_cloudagent.transport.inbound.message.InboundMessage, completed: aries_cloudagent.utils.task_queue.CompletedTask)[source]¶ Handle completion of message dispatch.
-
get_transport_instance
(transport_id: str) → aries_cloudagent.transport.inbound.base.BaseInboundTransport[source]¶ Get an instance of a running transport by ID.
-
process_undelivered
(session: aries_cloudagent.transport.inbound.session.InboundSession)[source]¶ Interact with undelivered queue to find applicable messages.
Parameters: session – The inbound session
-
register
(config: aries_cloudagent.transport.inbound.base.InboundTransportConfiguration) → str[source]¶ Register transport module.
Parameters: config – The inbound transport configuration
-
register_transport
(transport: aries_cloudagent.transport.inbound.base.BaseInboundTransport, transport_id: str) → str[source]¶ Register a new inbound transport class.
Parameters: - transport – Transport instance to register
- transport_id – The transport ID to register
-
return_to_session
(outbound: aries_cloudagent.transport.outbound.message.OutboundMessage) → bool[source]¶ Return an outbound message via an open session, if possible.
-
return_undelivered
(outbound: aries_cloudagent.transport.outbound.message.OutboundMessage) → bool[source]¶ Add an undelivered message to the undelivered queue.
At this point the message could not be associated with an inbound session and could not be delivered via an outbound transport.
-
Classes representing inbound messages.
-
class
aries_cloudagent.transport.inbound.message.
InboundMessage
(payload: Union[str, bytes], receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt, *, connection_id: str = None, session_id: str = None, transport_type: str = None)[source]¶ Bases:
object
Container class linking a message payload with its receipt details.
Classes for representing message receipt details.
-
class
aries_cloudagent.transport.inbound.receipt.
MessageReceipt
(*, connection_id: str = None, direct_response_mode: str = None, in_time: datetime.datetime = None, raw_message: str = None, recipient_verkey: str = None, recipient_did: str = None, recipient_did_public: bool = None, sender_did: str = None, sender_verkey: str = None, thread_id: str = None)[source]¶ Bases:
object
Properties of an agent message’s delivery.
-
REPLY_MODE_ALL
= 'all'¶
-
REPLY_MODE_NONE
= 'none'¶
-
REPLY_MODE_THREAD
= 'thread'¶
-
connection_id
¶ Accessor for the pairwise connection identifier.
Returns: This context’s connection identifier
-
direct_response_mode
¶ Accessor for the requested direct response mode.
Returns: This context’s requested direct response mode
-
direct_response_requested
¶ Accessor for the the state of the 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
-
thread_id
¶ Accessor for the identifier of the message thread.
Returns: The delivery thread ID
-
Inbound connection handling classes.
-
class
aries_cloudagent.transport.inbound.session.
AcceptResult
(accepted: bool, retry: bool = False)[source]¶ Bases:
object
Represent the result of accept_response.
-
class
aries_cloudagent.transport.inbound.session.
InboundSession
(*, context: aries_cloudagent.config.injection_context.InjectionContext, inbound_handler: Callable, session_id: str, wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat, accept_undelivered: bool = False, can_respond: bool = False, client_info: dict = None, close_handler: Callable = None, reply_mode: str = None, reply_thread_ids: Sequence[str] = None, reply_verkeys: Sequence[str] = None, transport_type: str = None)[source]¶ Bases:
object
Track an open transport connection for direct routing of outbound messages.
-
accept_response
(message: aries_cloudagent.transport.outbound.message.OutboundMessage) → aries_cloudagent.transport.inbound.session.AcceptResult[source]¶ Try to queue an outbound message if it applies to this session.
Returns: a tuple of (message buffered, retry later)
-
can_respond
¶ Accessor for the session can-respond state.
-
closed
¶ Accessor for the session closed state.
-
encode_outbound
(outbound: aries_cloudagent.transport.outbound.message.OutboundMessage) → aries_cloudagent.transport.outbound.message.OutboundMessage[source]¶ Apply wire formatting to an outbound message.
-
parse_inbound
(payload_enc: Union[str, bytes]) → aries_cloudagent.transport.inbound.message.InboundMessage[source]¶ Convert a message payload and to an inbound message.
-
process_inbound
(message: aries_cloudagent.transport.inbound.message.InboundMessage)[source]¶ Process an incoming message and update the session metadata as necessary.
Parameters: message – The inbound message instance
-
receive
(payload_enc: Union[str, bytes]) → aries_cloudagent.transport.inbound.message.InboundMessage[source]¶ Receive a new message payload and dispatch the message.
-
receive_inbound
(message: aries_cloudagent.transport.inbound.message.InboundMessage)[source]¶ Deliver the inbound message to the conductor.
-
reply_mode
¶ Accessor for the session reply mode.
-
reply_thread_ids
¶ Accessor for the reply thread IDs.
-
reply_verkeys
¶ Accessor for the reply verkeys.
-
response_buffered
¶ Check if a response is currently buffered.
-
select_outbound
(message: aries_cloudagent.transport.outbound.message.OutboundMessage) → bool[source]¶ Determine if an outbound message should be sent to this session.
Parameters: message – The outbound message to be checked
-
Websockets Transport classes and functions.
-
class
aries_cloudagent.transport.inbound.ws.
WsTransport
(host: str, port: int, create_session, **kwargs)[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 0x7fb669cb00b8>[source]¶ Construct the aiohttp application.
-
scheme
¶ Accessor for this transport’s scheme.
-
aries_cloudagent.transport.outbound package¶
Base outbound transport.
-
class
aries_cloudagent.transport.outbound.base.
BaseOutboundTransport
(wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat = None)[source]¶ Bases:
abc.ABC
Base outbound transport class.
-
collector
¶ Accessor for the stats collector instance.
-
handle_message
(payload: Union[str, bytes], endpoint: str)[source]¶ Handle message from queue.
Parameters: - payload – message payload in string or byte format
- endpoint – URI endpoint for delivery
-
wire_format
¶ Accessor for a custom wire format for the transport.
-
-
exception
aries_cloudagent.transport.outbound.base.
OutboundDeliveryError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.outbound.base.OutboundTransportError
Base exception when a message cannot be delivered via an outbound transport.
-
exception
aries_cloudagent.transport.outbound.base.
OutboundTransportError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.error.TransportError
Generic outbound transport error.
-
exception
aries_cloudagent.transport.outbound.base.
OutboundTransportRegistrationError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.outbound.base.OutboundTransportError
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
(payload: Union[str, bytes], endpoint: str)[source]¶ Handle message from queue.
Parameters: message – OutboundMessage to send over transport implementation
-
schemes
= ('http', 'https')¶
-
Outbound transport manager.
-
class
aries_cloudagent.transport.outbound.manager.
OutboundTransportManager
(context: aries_cloudagent.config.injection_context.InjectionContext, handle_not_delivered: Callable = None)[source]¶ Bases:
object
Outbound transport manager class.
-
deliver_queued_message
(queued: aries_cloudagent.transport.outbound.manager.QueuedOutboundMessage) → _asyncio.Task[source]¶ Kick off delivery of a queued message.
-
encode_queued_message
(queued: aries_cloudagent.transport.outbound.manager.QueuedOutboundMessage) → _asyncio.Task[source]¶ Kick off encoding of a queued message.
-
enqueue_message
(context: aries_cloudagent.config.injection_context.InjectionContext, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]¶ Add an outbound message to the queue.
Parameters: - context – The context of the request
- outbound – The outbound message to deliver
-
enqueue_webhook
(topic: str, payload: dict, endpoint: str, max_attempts: int = None)[source]¶ Add a webhook to the queue.
Parameters: - topic – The webhook topic
- payload – The webhook payload
- endpoint – The webhook endpoint
- max_attempts – Override the maximum number of attempts
Raises: OutboundDeliveryError
– if the associated transport is not running
-
finished_deliver
(queued: aries_cloudagent.transport.outbound.manager.QueuedOutboundMessage, completed: aries_cloudagent.utils.task_queue.CompletedTask)[source]¶ Handle completion of queued message delivery.
-
finished_encode
(queued: aries_cloudagent.transport.outbound.manager.QueuedOutboundMessage, completed: aries_cloudagent.utils.task_queue.CompletedTask)[source]¶ Handle completion of queued message encoding.
-
get_registered_transport_for_scheme
(scheme: str) → str[source]¶ Find the registered transport ID for a given scheme.
-
get_running_transport_for_endpoint
(endpoint: str)[source]¶ Find the running transport ID to use for a given endpoint.
-
get_running_transport_for_scheme
(scheme: str) → str[source]¶ Find the running transport ID for a given scheme.
-
get_transport_instance
(transport_id: str) → aries_cloudagent.transport.outbound.base.BaseOutboundTransport[source]¶ Get an instance of a running transport by ID.
-
perform_encode
(queued: aries_cloudagent.transport.outbound.manager.QueuedOutboundMessage)[source]¶ Perform message encoding.
-
process_queued
() → _asyncio.Task[source]¶ Start the process to deliver queued messages if necessary.
Returns: the current queue processing task or None
-
register
(module: str) → str[source]¶ Register a new outbound transport by module path.
Parameters: module – Module name 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], transport_id: str = None) → str[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
-
-
class
aries_cloudagent.transport.outbound.manager.
QueuedOutboundMessage
(context: aries_cloudagent.config.injection_context.InjectionContext, message: aries_cloudagent.transport.outbound.message.OutboundMessage, target: aries_cloudagent.connections.models.connection_target.ConnectionTarget, transport_id: str)[source]¶ Bases:
object
Class representing an outbound message pending delivery.
-
STATE_DELIVER
= 'deliver'¶
-
STATE_DONE
= 'done'¶
-
STATE_ENCODE
= 'encode'¶
-
STATE_NEW
= 'new'¶
-
STATE_PENDING
= 'pending'¶
-
STATE_RETRY
= 'retry'¶
-
Outbound message representation.
-
class
aries_cloudagent.transport.outbound.message.
OutboundMessage
(*, connection_id: str = None, enc_payload: Union[str, bytes] = None, endpoint: str = None, payload: Union[str, bytes], reply_session_id: str = None, reply_thread_id: str = None, reply_to_verkey: str = None, reply_from_verkey: str = None, target: aries_cloudagent.connections.models.connection_target.ConnectionTarget = None, target_list: Sequence[aries_cloudagent.connections.models.connection_target.ConnectionTarget] = None, to_session_only: bool = False)[source]¶ Bases:
object
Represents an outgoing message.
Websockets outbound transport.
-
class
aries_cloudagent.transport.outbound.ws.
WsTransport
[source]¶ Bases:
aries_cloudagent.transport.outbound.base.BaseOutboundTransport
Websockets outbound transport class.
-
handle_message
(payload: Union[str, bytes], endpoint: str)[source]¶ Handle message from queue.
Parameters: message – OutboundMessage to send over transport implementation
-
schemes
= ('ws', 'wss')¶
-
aries_cloudagent.transport.queue package¶
Abstract message queue.
-
class
aries_cloudagent.transport.queue.base.
BaseMessageQueue
[source]¶ Bases:
abc.ABC
Abstract message 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.queue.basic.
BasicMessageQueue
[source]¶ Bases:
aries_cloudagent.transport.queue.base.BaseMessageQueue
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
-
Submodules¶
aries_cloudagent.transport.error module¶
Transport-related error classes and codes.
-
exception
aries_cloudagent.transport.error.
MessageEncodeError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.error.WireFormatError
Message encoding error.
-
error_code
= 'message_encode_error'¶
-
-
exception
aries_cloudagent.transport.error.
MessageParseError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.error.WireFormatError
Message parse error.
-
error_code
= 'message_parse_error'¶
-
-
exception
aries_cloudagent.transport.error.
TransportError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Base class for all transport errors.
-
exception
aries_cloudagent.transport.error.
WireFormatError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.error.TransportError
Base class for wire-format errors.
aries_cloudagent.transport.pack_format module¶
Standard packed message format classes.
-
class
aries_cloudagent.transport.pack_format.
PackWireFormat
[source]¶ Bases:
aries_cloudagent.transport.wire_format.BaseWireFormat
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
Raises: MessageEncodeError
– If the message could not be encoded
-
pack
(context: aries_cloudagent.config.injection_context.InjectionContext, message_json: Union[str, bytes], recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str)[source]¶ Look up the wallet instance and perform the message pack.
-
parse_message
(context: aries_cloudagent.config.injection_context.InjectionContext, message_body: Union[str, bytes]) → Tuple[dict, aries_cloudagent.transport.inbound.receipt.MessageReceipt][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
Returns: A tuple of the parsed message and a message receipt instance
Raises: MessageParseError
– If the JSON parsing failedMessageParseError
– If a wallet is required but can’t be located
-
aries_cloudagent.transport.stats module¶
aiohttp stats collector support.
aries_cloudagent.transport.wire_format module¶
Abstract wire format classes.
-
class
aries_cloudagent.transport.wire_format.
BaseWireFormat
[source]¶ Bases:
object
Abstract messaging wire format.
-
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
Raises: MessageEncodeError
– If the message could not be encoded
-
parse_message
(context: aries_cloudagent.config.injection_context.InjectionContext, message_body: Union[str, bytes]) → Tuple[dict, aries_cloudagent.transport.inbound.receipt.MessageReceipt][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
Returns: A tuple of the parsed message and a message receipt instance
Raises: MessageParseError
– If the message can’t be parsed
-
-
class
aries_cloudagent.transport.wire_format.
JsonWireFormat
[source]¶ Bases:
aries_cloudagent.transport.wire_format.BaseWireFormat
Unencrypted wire format.
-
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
Raises: MessageEncodeError
– If the message could not be encoded
-
parse_message
(context: aries_cloudagent.config.injection_context.InjectionContext, message_body: Union[str, bytes]) → Tuple[dict, aries_cloudagent.transport.inbound.receipt.MessageReceipt][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
Returns: A tuple of the parsed message and a message receipt instance
Raises: MessageParseError
– If the JSON parsing failed
-
aries_cloudagent.utils package¶
Submodules¶
aries_cloudagent.utils.classloader module¶
The classloader provides utilties to dynamically load classes and modules.
-
class
aries_cloudagent.utils.classloader.
ClassLoader
[source]¶ Bases:
object
Class used to load classes from modules dynamically.
-
classmethod
load_class
(class_name: str, default_module: str = None, package: str = None)[source]¶ Resolve a complete class path (ie. typing.Dict) to the class itself.
Parameters: - class_name – the class name
- default_module – the default module to load, if not part of in the class name
- package – the parent package to search for the module
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, package: str = None) → module[source]¶ Load a module by its absolute path.
Parameters: - mod_path – the absolute or relative module path
- package – the parent package to search for the module
Returns: The resolved module or None if the module cannot be found
Raises: ModuleLoadError
– If there was an error loading the module
-
classmethod
load_subclass_of
(base_class: Type[CT_co], mod_path: str, package: str = None)[source]¶ Resolve an implementation of a base path within a module.
Parameters: - base_class – the base class being implemented
- mod_path – the absolute module path
- package – the parent package to search for the module
Returns: The resolved class
Raises: ClassNotFoundError
– If the module or class implementation could not be foundModuleLoadError
– If there was an error loading the module
-
classmethod
-
exception
aries_cloudagent.utils.classloader.
ClassNotFoundError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Class not found error.
-
exception
aries_cloudagent.utils.classloader.
ModuleLoadError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Module load error.
aries_cloudagent.utils.http module¶
HTTP utility methods.
-
exception
aries_cloudagent.utils.http.
FetchError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Error raised when an HTTP fetch fails.
-
aries_cloudagent.utils.http.
fetch
(url: str, *, headers: dict = None, retry: bool = True, max_attempts: int = 5, interval: float = 1.0, backoff: float = 0.25, request_timeout: float = 10.0, connector: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ad69198> = None, session: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ad692b0> = None, json: bool = False)[source]¶ Fetch from an HTTP server with automatic retries and timeouts.
Parameters: - url – the address to fetch
- headers – an optional dict of headers to send
- retry – flag to retry the fetch
- max_attempts – the maximum number of attempts to make
- interval – the interval between retries, in seconds
- backoff – the backoff interval, in seconds
- request_timeout – the HTTP request timeout, in seconds
- connector – an optional existing BaseConnector
- session – a shared ClientSession
- json – flag to parse the result as JSON
aries_cloudagent.utils.repeat module¶
Utils for repeating tasks.
-
class
aries_cloudagent.utils.repeat.
RepeatAttempt
(seq: aries_cloudagent.utils.repeat.RepeatSequence, index: int = 1)[source]¶ Bases:
object
Represents the current iteration in a repeat sequence.
-
final
¶ Check if this is the last instance in the sequence.
-
next_interval
¶ Calculate the interval before the next attempt.
-
aries_cloudagent.utils.stats module¶
Classes for tracking performance and timing.
-
class
aries_cloudagent.utils.stats.
Collector
(*, enabled: bool = True, log_path: str = None)[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, start: float = None)[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.utils.task_queue module¶
Classes for managing a set of asyncio tasks.
-
class
aries_cloudagent.utils.task_queue.
CompletedTask
(task: _asyncio.Task, exc_info: Tuple, ident: str = None, timing: dict = None)[source]¶ Bases:
object
Represent the result of a queued task.
-
class
aries_cloudagent.utils.task_queue.
PendingTask
(coro: Coroutine[T_co, T_contra, V_co], complete_hook: Callable = None, ident: str = None, task_future: _asyncio.Future = None, queued_time: float = None)[source]¶ Bases:
object
Represent a task in the queue.
-
cancelled
¶ Accessor for the cancelled property.
-
task
¶ Accessor for the task.
-
-
class
aries_cloudagent.utils.task_queue.
TaskQueue
(max_active: int = 0, timed: bool = False, trace_fn: Callable = None)[source]¶ Bases:
object
A class for managing a set of asyncio tasks.
-
add_active
(task: _asyncio.Task, task_complete: Callable = None, ident: str = None, timing: dict = None) → _asyncio.Task[source]¶ Register an active async task with an optional completion callback.
Parameters: - task – The asyncio task instance
- task_complete – An optional callback to run on completion
- ident – A string identifer for the task
- timing – An optional dictionary of timing information
-
add_pending
(pending: aries_cloudagent.utils.task_queue.PendingTask)[source]¶ Add a task to the pending queue.
Parameters: pending – The PendingTask to add to the task queue
-
cancelled
¶ Accessor for the cancelled property of the queue.
-
complete
(timeout: float = None, cleanup: bool = True)[source]¶ Cancel any pending tasks and wait for, or cancel active tasks.
-
completed_task
(task: _asyncio.Task, task_complete: Callable, ident: str, timing: dict = None)[source]¶ Clean up after a task has completed and run callbacks.
-
current_active
¶ Accessor for the current number of active tasks in the queue.
-
current_pending
¶ Accessor for the current number of pending tasks in the queue.
-
current_size
¶ Accessor for the total number of tasks in the queue.
-
max_active
¶ Accessor for the maximum number of active tasks in the queue.
-
put
(coro: Coroutine[T_co, T_contra, V_co], task_complete: Callable = None, ident: str = None) → aries_cloudagent.utils.task_queue.PendingTask[source]¶ Add a new task to the queue, delaying execution if busy.
Parameters: - coro – The coroutine to run
- task_complete – A callback to run on completion
- ident – A string identifier for the task
Returns: a future resolving to the asyncio task instance once queued
-
ready
¶ Accessor for the ready property of the queue.
-
run
(coro: Coroutine[T_co, T_contra, V_co], task_complete: Callable = None, ident: str = None, timing: dict = None) → _asyncio.Task[source]¶ Start executing a coroutine as an async task, bypassing the pending queue.
Parameters: - coro – The coroutine to run
- task_complete – An optional callback to run on completion
- ident – A string identifier for the task
- timing – An optional dictionary of timing information
Returns: the new asyncio task instance
-
-
aries_cloudagent.utils.task_queue.
coro_ident
(coro: Coroutine[T_co, T_contra, V_co])[source]¶ Extract an identifier for a coroutine.
aries_cloudagent.verifier package¶
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.
-
static
pre_verify
(pres_req: dict, pres: dict) -> (<enum 'PreVerifyResult'>, <class 'str'>)[source]¶ Check for essential components and tampering in presentation.
Visit encoded attribute values against raw, and predicate bounds, in presentation, cross-reference against presentation request.
Parameters: - pres_req – presentation request
- pres – corresponding presentation
Returns: An instance of PreVerifyResult representing the validation result
-
static
aries_cloudagent.wallet package¶
Abstract and Indy wallet handling.
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_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.
-
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_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_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
-
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_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.
-
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_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_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
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Packed message schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.wallet.crypto.
PackRecipientHeaderSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Packed recipient header schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.wallet.crypto.
PackRecipientSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Packed recipient schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.wallet.crypto.
PackRecipientsSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Packed recipients schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.wallet.crypto.
create_keypair
(seed: bytes = None) → Tuple[bytes, 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) → Tuple[str, Optional[str], 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.
decode_pack_message_outer
(enc_message: bytes) → Tuple[dict, dict, bool][source]¶ Decode the outer wrapper of a packed message and extract the recipients.
Parameters: enc_message – The encrypted message Returns: a tuple of the decoded wrapper, recipients, and authcrypt flag
-
aries_cloudagent.wallet.crypto.
decode_pack_message_payload
(wrapper: dict, payload_key: bytes) → str[source]¶ Decode the payload of a packed message once the CEK is known.
Parameters: - wrapper – The decoded message wrapper
- payload_key – The decrypted payload key
-
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) → Tuple[bytes, bytes, 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.
extract_pack_recipients
(recipients: Sequence[dict]) → dict[source]¶ Extract the pack message recipients into a dict indexed by verkey.
Parameters: recipients – Recipients to locate Raises: ValueError
– If the recipients block is mal-formatted
-
aries_cloudagent.wallet.crypto.
extract_payload_key
(sender_cek: dict, recip_secret: bytes) → Tuple[bytes, str][source]¶ Extract the payload key from pack recipient details.
Returns: A tuple of the CEK and sender verkey
-
aries_cloudagent.wallet.crypto.
prepare_pack_recipient_keys
(to_verkeys: Sequence[bytes], from_secret: bytes = None) → Tuple[str, 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.crypto.
sign_pk_from_sk
(secret: bytes) → bytes[source]¶ Extract the verkey from a secret signing key.
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.core.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_KEY_DERIVIATION
= 'ARGON2I_MOD'¶
-
DEFAULT_NAME
= 'default'¶
-
DEFAULT_STORAGE_TYPE
= None¶
-
KEY_DERIVATION_ARGON2I_INT
= 'ARGON2I_INT'¶
-
KEY_DERIVATION_ARGON2I_MOD
= 'ARGON2I_MOD'¶
-
KEY_DERIVATION_RAW
= 'RAW'¶
-
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_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.
-
get_credential_definition_tag_policy
(credential_definition_id: str)[source]¶ Return the tag policy for a given credential definition ID.
-
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_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_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
-
set_credential_definition_tag_policy
(credential_definition_id: str, taggables: Sequence[str] = None, retroactive: bool = True)[source]¶ Set the tag policy for a given credential definition ID.
Parameters: - credential_definition_id – The ID of the credential definition
- taggables – A sequence of string values representing attribute names
- retroactive – Whether to apply the policy to previously-stored credentials
-
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.plugin module¶
Utility for loading Postgres wallet plug-in.
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.routes module¶
Wallet admin routes.
-
class
aries_cloudagent.wallet.routes.
DIDListSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for connection list.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.wallet.routes.
DIDResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for a DID.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.wallet.routes.
DIDSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for a DID.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.wallet.routes.
GetTagPolicyResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for tagging policy get request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.wallet.routes.
SetTagPolicyRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for tagging policy set request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.wallet.routes.
format_did_info
(info: aries_cloudagent.wallet.base.DIDInfo)[source]¶ Serialize a DIDInfo object.
-
aries_cloudagent.wallet.routes.
register
(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a886438>)[source]¶ Register routes.
-
aries_cloudagent.wallet.routes.
wallet_create_did
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a886438>)[source]¶ Request handler for creating a new wallet DID.
Parameters: request – aiohttp request object Returns: The DID info
-
aries_cloudagent.wallet.routes.
wallet_did_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a886438>)[source]¶ Request handler for searching wallet DIDs.
Parameters: request – aiohttp request object Returns: The DID list response
-
aries_cloudagent.wallet.routes.
wallet_get_public_did
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a886438>)[source]¶ Request handler for fetching the current public DID.
Parameters: request – aiohttp request object Returns: The DID info
-
aries_cloudagent.wallet.routes.
wallet_get_tagging_policy
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a886438>)[source]¶ Request handler for getting the tag policy associated with a cred def.
Parameters: request – aiohttp request object Returns: A JSON object containing the tagging policy
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.
-
aries_cloudagent.wallet.util.
b64_to_str
(val: str, urlsafe=False, encoding=None) → str[source]¶ Convert a base 64 string to string on input encoding (default utf-8).
-
aries_cloudagent.wallet.util.
bytes_to_b58
(val: bytes) → str[source]¶ Convert a byte string to base 58.
-
aries_cloudagent.wallet.util.
bytes_to_b64
(val: bytes, urlsafe=False, pad=True) → str[source]¶ Convert a byte string to base 64.
-
aries_cloudagent.wallet.util.
pad
(val: str) → str[source]¶ Pad base64 values if need be: JWT calls to omit trailing padding.
-
aries_cloudagent.wallet.util.
set_urlsafe_b64
(val: str, urlsafe: bool = True) → str[source]¶ Set URL safety in base64 encoding.
Submodules¶
aries_cloudagent.version module¶
Library version information.
aries_cloudagent.connections package¶
Subpackages¶
aries_cloudagent.connections.models package¶
Subpackages¶
aries_cloudagent.connections.models.diddoc package¶
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.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.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.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.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.connections.models.diddoc.service.Service, aries_cloudagent.connections.models.diddoc.publickey.PublicKey]) → aries_cloudagent.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.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.connections.models.diddoc.
PublicKey
(did: str, ident: str, value: str, pk_type: aries_cloudagent.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.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.connections.models.diddoc.
Service
(did: str, ident: str, typ: str, recip_keys: Union[Sequence[T_co], aries_cloudagent.connections.models.diddoc.publickey.PublicKey], routing_keys: Union[Sequence[T_co], aries_cloudagent.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.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.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.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.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.connections.models.diddoc.service.Service, aries_cloudagent.connections.models.diddoc.publickey.PublicKey]) → aries_cloudagent.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.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.connections.models.diddoc.publickey.
PublicKey
(did: str, ident: str, value: str, pk_type: aries_cloudagent.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.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.connections.models.diddoc.service.
Service
(did: str, ident: str, typ: str, recip_keys: Union[Sequence[T_co], aries_cloudagent.connections.models.diddoc.publickey.PublicKey], routing_keys: Union[Sequence[T_co], aries_cloudagent.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.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.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.connections.models.diddoc.util.
ok_did
(token: str) → bool[source]¶ Whether input token looks like a valid decentralized identifier.
Parameters: token – candidate string Returns: whether input token looks like a valid schema identifier
-
aries_cloudagent.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)
Submodules¶
aries_cloudagent.connections.models.connection_record module¶
Handle connection information interface with non-secrets storage.
-
class
aries_cloudagent.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, invitation_mode: str = None, alias: 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_MULTIUSE
= 'multiuse'¶
-
INITIATOR_SELF
= 'self'¶
-
INVITATION_MODE_MULTI
= 'multi'¶
-
INVITATION_MODE_ONCE
= 'once'¶
-
INVITATION_MODE_STATIC
= 'static'¶
-
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_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'¶
-
TAG_NAMES
= {'invitation_key', 'my_did', 'request_id', 'their_did'}¶
-
WEBHOOK_TOPIC
= 'connections'¶
-
attach_invitation
(context: aries_cloudagent.config.injection_context.InjectionContext, invitation: aries_cloudagent.protocols.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.protocols.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.
-
is_multiuse_invitation
¶ Accessor for multi use invitation mode.
-
is_ready
¶ Accessor for connection readiness.
-
post_save
(context: aries_cloudagent.config.injection_context.InjectionContext, *args, **kwargs)[source]¶ Perform post-save actions.
Parameters: context – The injection context to use
-
record_value
¶ Accessor to for the JSON record value properties for this connection.
-
classmethod
retrieve_by_did
(context: aries_cloudagent.config.injection_context.InjectionContext, their_did: str = None, my_did: str = None, initiator: str = None) → aries_cloudagent.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.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.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
-
-
class
aries_cloudagent.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
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['manual', 'auto'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
alias
= <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.'})>¶
-
connection_id
= <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.'})>¶
-
error_msg
= <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.'})>¶
-
inbound_connection_id
= <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.'})>¶
-
initiator
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['self', 'external', 'multiuse'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
invitation_key
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRawPublicKey object>, 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.'})>¶
-
invitation_mode
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['once', 'multi', 'static'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
my_did
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID object>, 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.'})>¶
-
request_id
= <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.'})>¶
-
routing_state
= <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.'})>¶
-
their_did
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID object>, 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.'})>¶
-
their_label
= <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.'})>¶
-
their_role
= <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.'})>¶
-
class
aries_cloudagent.connections.models.connection_target module¶
Record used to handle routing of messages to another agent.
-
class
aries_cloudagent.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.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
aries_cloudagent.protocols package¶
Subpackages¶
aries_cloudagent.protocols.basicmessage package¶
Subpackages¶
aries_cloudagent.protocols.basicmessage.handlers package¶
Basic message handler.
-
class
aries_cloudagent.protocols.basicmessage.handlers.basicmessage_handler.
BasicMessageHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for basic messages.
aries_cloudagent.protocols.basicmessage.messages package¶
Basic message.
-
class
aries_cloudagent.protocols.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.protocols.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
= <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.'})>¶
-
sent_time
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyISO8601DateTime object>, 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.'})>¶
-
class
Submodules¶
aries_cloudagent.protocols.basicmessage.message_types module¶
Message type identifiers for Connections.
aries_cloudagent.protocols.basicmessage.routes module¶
Basic message admin routes.
-
class
aries_cloudagent.protocols.basicmessage.routes.
SendMessageSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
aries_cloudagent.protocols.connections package¶
Subpackages¶
aries_cloudagent.protocols.connections.handlers package¶
Connect invitation handler.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.connections.handlers.connection_response_handler.
ConnectionResponseHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler class for connection responses.
aries_cloudagent.protocols.connections.messages package¶
Represents an invitation message for establishing connection.
-
class
aries_cloudagent.protocols.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.protocols.connections.handlers.connection_invitation_handler.ConnectionInvitationHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation'¶
-
schema_class
= 'ConnectionInvitationSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.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
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID object>, 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.'})>¶
-
endpoint
= <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.'})>¶
-
image_url
= <fields.Url(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 URL.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
label
= <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.'})>¶
-
recipient_keys
= <fields.List(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 list.'})>¶
-
routing_keys
= <fields.List(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 list.'})>¶
-
class
Represents a connection request message.
-
class
aries_cloudagent.protocols.connections.messages.connection_request.
ConnectionRequest
(*, connection: aries_cloudagent.protocols.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.protocols.connections.handlers.connection_request_handler.ConnectionRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/request'¶
-
schema_class
= 'ConnectionRequestSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.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
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
image_url
= <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.'})>¶
-
label
= <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
Represents a connection response message.
-
class
aries_cloudagent.protocols.connections.messages.connection_response.
ConnectionResponse
(*, connection: aries_cloudagent.protocols.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.protocols.connections.handlers.connection_response_handler.ConnectionResponseHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/response'¶
-
schema_class
= 'ConnectionResponseSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.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
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
Represents a connection problem report message.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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
= <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.'})>¶
-
problem_code
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['invitation_not_accepted', 'request_not_accepted', 'request_processing_error', 'response_not_accepted', 'response_processing_error'], labels=[], error='Value {input} must be one of {choices}.')>, 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.'})>¶
-
class
aries_cloudagent.protocols.connections.models package¶
An object for containing the connection request/response DID information.
-
class
aries_cloudagent.protocols.connections.models.connection_detail.
ConnectionDetail
(*, did: str = None, did_doc: aries_cloudagent.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.protocols.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
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID object>, 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.'})>¶
-
did_doc
= <fields.DIDDocWrapper(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.'})>¶
-
class
-
class
aries_cloudagent.protocols.connections.models.connection_detail.
DIDDocWrapper
(*, default=<marshmallow.missing>, missing=<marshmallow.missing>, data_key=None, attribute=None, validate=None, required=False, allow_none=None, load_only=False, dump_only=False, error_messages=None, **metadata)[source]¶ Bases:
marshmallow.fields.Field
Field that loads and serializes DIDDoc.
Submodules¶
aries_cloudagent.protocols.connections.manager module¶
Classes to manage connections.
-
class
aries_cloudagent.protocols.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.protocols.connections.messages.connection_response.ConnectionResponse, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.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
- receipt – The message receipt
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
(did_info: aries_cloudagent.wallet.base.DIDInfo, inbound_connection_id: str = None, svc_endpoints: Sequence[str] = []) → aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc[source]¶ Create our DID document for a given DID.
Parameters: - did_info – The DID information (DID and verkey) used in the connection
- inbound_connection_id – The ID of the inbound routing connection to use
- svc_endpoints – Custom endpoints 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, multi_use: bool = False, alias: str = None) → Tuple[aries_cloudagent.connections.models.connection_record.ConnectionRecord, aries_cloudagent.protocols.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:
{ "@type": "did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/connections/1.0/invitation", "label": "Alice", "did": "did:sov:QmWbsNYhMrjHiqZDTUTEJs" }
Or, in the case of a peer DID:
{ "@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
- multi_use – set to True to create an invitation for multiple use
- alias – optional alias to apply to connection for later use
Returns: A tuple of the new ConnectionRecord and ConnectionInvitation instances
-
create_request
(connection: aries_cloudagent.connections.models.connection_record.ConnectionRecord, my_label: str = None, my_endpoint: str = None) → aries_cloudagent.protocols.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.connections.models.connection_record.ConnectionRecord, my_endpoint: str = None) → aries_cloudagent.protocols.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
-
create_static_connection
(my_did: str = None, my_seed: str = None, their_did: str = None, their_seed: str = None, their_verkey: str = None, their_endpoint: str = None, their_role: str = None, their_label: str = None, alias: str = None) -> (<class 'aries_cloudagent.wallet.base.DIDInfo'>, <class 'aries_cloudagent.wallet.base.DIDInfo'>, <class 'aries_cloudagent.connections.models.connection_record.ConnectionRecord'>)[source]¶ Register a new static connection (for use by the test suite).
Parameters: - my_did – override the DID used in the connection
- my_seed – provide a seed used to generate our DID and keys
- their_did – provide the DID used by the other party
- their_seed – provide a seed used to generate their DID and keys
- their_verkey – provide the verkey used by the other party
- their_endpoint – their URL endpoint for routing messages
- their_role – their role in this connection
- alias – an alias for this connection record
Returns: The new ConnectionRecord instance
-
diddoc_connection_targets
(doc: aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc, sender_verkey: str, their_label: str = None) → Sequence[aries_cloudagent.connections.models.connection_target.ConnectionTarget][source]¶ Get a list of connection targets 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.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_connection_targets
(connection: aries_cloudagent.connections.models.connection_record.ConnectionRecord) → Sequence[aries_cloudagent.connections.models.connection_target.ConnectionTarget][source]¶ Get a list of connection target from a ConnectionRecord.
Parameters: connection – The connection record (with associated DIDDoc) used to generate the connection target
-
fetch_did_document
(did: str) → Tuple[aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc, aries_cloudagent.storage.record.StorageRecord][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.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_inbound_connection
(receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.connections.models.connection_record.ConnectionRecord[source]¶ Deserialize an incoming message and further populate the request context.
Parameters: receipt – The message receipt Returns: The ConnectionRecord associated with the expanded message, if any
-
get_connection_targets
(*, connection_id: str = None, connection: aries_cloudagent.connections.models.connection_record.ConnectionRecord = None)[source]¶ Create a connection target from a ConnectionRecord.
Parameters: - connection_id – The connection ID to search for
- connection – The connection record itself, if already available
-
receive_invitation
(invitation: aries_cloudagent.protocols.connections.messages.connection_invitation.ConnectionInvitation, their_role: str = None, accept: str = None, alias: str = None) → aries_cloudagent.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
- alias – optional alias to set on the record
Returns: The new ConnectionRecord instance
-
receive_request
(request: aries_cloudagent.protocols.connections.messages.connection_request.ConnectionRequest, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.connections.models.connection_record.ConnectionRecord[source]¶ Receive and store a connection request.
Parameters: - request – The ConnectionRequest to accept
- receipt – The message receipt
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
-
resolve_inbound_connection
(receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.connections.models.connection_record.ConnectionRecord[source]¶ Populate the receipt DID information and find the related ConnectionRecord.
Parameters: receipt – The message receipt Returns: The ConnectionRecord associated with the expanded message, if any
-
-
exception
aries_cloudagent.protocols.connections.manager.
ConnectionManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Connection error.
aries_cloudagent.protocols.connections.message_types module¶
Message type identifiers for Connections.
aries_cloudagent.protocols.connections.routes module¶
Connection handling admin routes.
-
class
aries_cloudagent.protocols.connections.routes.
ConnectionListSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for connection list.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.connections.routes.
ConnectionStaticRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for a new static connection.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.connections.routes.
ConnectionStaticResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for new static connection.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.connections.routes.
InvitationResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for a new connection invitation.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.protocols.connections.routes.
connection_sort_key
(conn)[source]¶ Get the sorting key for a particular connection.
-
aries_cloudagent.protocols.connections.routes.
connections_accept_invitation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a151550>)[source]¶ Request handler for accepting a stored connection invitation.
Parameters: request – aiohttp request object Returns: The resulting connection record details
-
aries_cloudagent.protocols.connections.routes.
connections_accept_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a151550>)[source]¶ Request handler for accepting a stored connection request.
Parameters: request – aiohttp request object Returns: The resulting connection record details
-
aries_cloudagent.protocols.connections.routes.
connections_create_invitation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a151550>)[source]¶ Request handler for creating a new connection invitation.
Parameters: request – aiohttp request object Returns: The connection invitation details
-
aries_cloudagent.protocols.connections.routes.
connections_create_static
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a151550>)[source]¶ Request handler for creating a new static connection.
Parameters: request – aiohttp request object Returns: The new connection record
-
aries_cloudagent.protocols.connections.routes.
connections_establish_inbound
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a151550>)[source]¶ Request handler for setting the inbound connection on a connection record.
Parameters: request – aiohttp request object
-
aries_cloudagent.protocols.connections.routes.
connections_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a151550>)[source]¶ Request handler for searching connection records.
Parameters: request – aiohttp request object Returns: The connection list response
-
aries_cloudagent.protocols.connections.routes.
connections_receive_invitation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a151550>)[source]¶ Request handler for receiving a new connection invitation.
Parameters: request – aiohttp request object Returns: The resulting connection record details
-
aries_cloudagent.protocols.connections.routes.
connections_remove
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a151550>)[source]¶ Request handler for removing a connection record.
Parameters: request – aiohttp request object
aries_cloudagent.protocols.credentials package¶
Subpackages¶
aries_cloudagent.protocols.credentials.handlers package¶
Basic message handler.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.credentials.handlers.credential_request_handler.
CredentialRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential requests.
Credential stored message handler.
-
class
aries_cloudagent.protocols.credentials.handlers.credential_stored_handler.
CredentialStoredHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential offers.
aries_cloudagent.protocols.credentials.messages package¶
A credential content message.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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
= <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
A credential offer content message.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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
= <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.'})>¶
-
credential_preview
= <fields.Dict(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 mapping type.'})>¶
-
offer_json
= <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
A credential request content message.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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
= <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.'})>¶
-
request
= <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
A credential stored message.
-
class
aries_cloudagent.protocols.credentials.messages.credential_stored.
CredentialStored
(**kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a credential stored message.
-
class
Meta
[source]¶ Bases:
object
Credential metadata.
-
handler_class
= 'aries_cloudagent.protocols.credentials.handlers.credential_stored_handler.CredentialStoredHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/credential-issuance/0.1/credential-stored'¶
-
schema_class
= 'CredentialStoredSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.credentials.messages.credential_stored.
CredentialStoredSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Credential stored schema.
-
class
Meta
[source]¶ Bases:
object
Schema metadata.
-
model_class
¶ alias of
CredentialStored
-
-
class
aries_cloudagent.protocols.credentials.models package¶
Handle credential exchange information interface with non-secrets storage.
-
class
aries_cloudagent.protocols.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'¶
-
TAG_NAMES
= {'thread_id'}¶
-
WEBHOOK_TOPIC
= 'credentials'¶
-
credential_exchange_id
¶ Accessor for the ID associated with this exchange.
-
post_save
(context: aries_cloudagent.config.injection_context.InjectionContext, new_record: bool, last_state: str, webhook: bool = None)[source]¶ Perform post-save actions.
Parameters: - context – The injection context to use
- new_record – Flag indicating if the record was just created
- last_state – The previous state value
- webhook – Adjust whether the webhook is called
-
record_value
¶ Accessor to for the JSON record value props for this credential exchange.
-
classmethod
retrieve_by_thread_and_initiator
(context: aries_cloudagent.config.injection_context.InjectionContext, thread_id: str, initiator: str) → aries_cloudagent.protocols.credentials.models.credential_exchange.CredentialExchange[source]¶ Retrieve a credential exchange record by thread ID and inititator.
-
-
class
aries_cloudagent.protocols.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
= <fields.Boolean(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 boolean.'})>¶
-
connection_id
= <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.'})>¶
-
credential
= <fields.Dict(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 mapping type.'})>¶
-
credential_definition_id
= <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.'})>¶
-
credential_exchange_id
= <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.'})>¶
-
credential_id
= <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.'})>¶
-
credential_offer
= <fields.Dict(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 mapping type.'})>¶
-
credential_request
= <fields.Dict(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 mapping type.'})>¶
-
credential_request_metadata
= <fields.Dict(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 mapping type.'})>¶
-
credential_values
= <fields.Dict(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 mapping type.'})>¶
-
error_msg
= <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.'})>¶
-
initiator
= <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.'})>¶
-
parent_thread_id
= <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.'})>¶
-
raw_credential
= <fields.Dict(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 mapping type.'})>¶
-
schema_id
= <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.'})>¶
-
state
= <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.'})>¶
-
thread_id
= <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.'})>¶
-
class
Submodules¶
aries_cloudagent.protocols.credentials.manager module¶
Classes to manage credentials.
-
class
aries_cloudagent.protocols.credentials.manager.
CredentialManager
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Bases:
object
Class for managing credentials.
-
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.protocols.credentials.models.credential_exchange.CredentialExchange, connection_record: aries_cloudagent.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.protocols.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.protocols.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
-
receive_credential
(credential_message: aries_cloudagent.protocols.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.protocols.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
-
receive_request
(credential_request_message: aries_cloudagent.protocols.credentials.messages.credential_request.CredentialRequest)[source]¶ Receive a credential request.
Parameters: credential_request_message – Credential request to receive
-
store_credential
(credential_exchange_record: aries_cloudagent.protocols.credentials.models.credential_exchange.CredentialExchange, credential_id: str = None)[source]¶ Store a credential in the wallet.
Parameters: - credential_message – credential to store
- credential_id – string to use as id for record in wallet
-
-
exception
aries_cloudagent.protocols.credentials.manager.
CredentialManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Credential error.
aries_cloudagent.protocols.credentials.message_types module¶
Message type identifiers for credentials.
aries_cloudagent.protocols.credentials.routes module¶
Credential handling admin routes.
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialExchangeListSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for a credential exchange query.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialIssueRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a credential issue admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialIssueResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for sending a credential issue admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialListSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for a credential query.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialOfferRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a credential offer admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialOfferResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for sending a credential offer admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialProblemReportRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a problem report.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialRequestResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for sending a credential request admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for a credential query.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialSendRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a credential offer admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialSendResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for sending a credential offer admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
CredentialStoreRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a credential store admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
RawEncCredAttrSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Credential attribute schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
RevRegSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Revocation registry schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.credentials.routes.
WitnessSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Witness schema.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_issue
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for sending a credential.
Parameters: request – aiohttp request object Returns: The credential details.
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for searching credential exchange records.
Parameters: request – aiohttp request object Returns: The credential exchange list response
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_problem_report
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for sending a problem report.
Parameters: request – aiohttp request object
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_remove
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for removing a credential exchange record.
Parameters: request – aiohttp request object
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_retrieve
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for fetching a single credential exchange record.
Parameters: request – aiohttp request object Returns: The credential exchange record response
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_send
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for sending a credential.
Parameters: request – aiohttp request object Returns: The credential offer details.
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_send_offer
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for sending a credential offer.
Parameters: request – aiohttp request object Returns: The credential offer details.
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_send_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for sending a credential request.
Parameters: request – aiohttp request object Returns: The credential request details.
-
aries_cloudagent.protocols.credentials.routes.
credential_exchange_store
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for storing a credential request.
Parameters: request – aiohttp request object Returns: The credential request details.
-
aries_cloudagent.protocols.credentials.routes.
credentials_get
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for retrieving a credential.
Parameters: request – aiohttp request object Returns: The credential response
-
aries_cloudagent.protocols.credentials.routes.
credentials_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a84ce10>)[source]¶ Request handler for searching credential records.
Parameters: request – aiohttp request object Returns: The credential list response
aries_cloudagent.protocols.discovery package¶
Subpackages¶
aries_cloudagent.protocols.discovery.handlers package¶
Handler for incoming disclose messages.
-
class
aries_cloudagent.protocols.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.protocols.discovery.handlers.query_handler.
QueryHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming query messages.
aries_cloudagent.protocols.discovery.messages package¶
Represents a feature discovery disclosure message.
-
class
aries_cloudagent.protocols.discovery.messages.disclose.
Disclose
(*, protocols: Sequence[Mapping[str, Mapping[KT, VT_co]]] = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Represents a feature discovery disclosure, the response to a query message.
-
class
aries_cloudagent.protocols.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.protocols.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 feature discovery query message.
-
class
aries_cloudagent.protocols.discovery.messages.query.
Query
(*, query: str = None, comment: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Represents a feature discovery query.
Used for inspecting what message types are supported by the agent.
-
class
aries_cloudagent.protocols.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.'})>¶
-
Submodules¶
aries_cloudagent.protocols.discovery.message_types module¶
Message type identifiers for Feature Discovery.
aries_cloudagent.protocols.discovery.routes module¶
Feature discovery admin routes.
-
class
aries_cloudagent.protocols.discovery.routes.
QueryResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for the protocol list.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
aries_cloudagent.protocols.introduction package¶
Subpackages¶
aries_cloudagent.protocols.introduction.handlers package¶
Handler for incoming forward invitation messages.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.introduction.handlers.invitation_request_handler.
InvitationRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming invitation request messages.
aries_cloudagent.protocols.introduction.messages package¶
Represents a forwarded invitation from another agent.
-
class
aries_cloudagent.protocols.introduction.messages.forward_invitation.
ForwardInvitation
(*, invitation: aries_cloudagent.protocols.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.protocols.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.protocols.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
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
message
= <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
Represents an invitation returned to the introduction service.
-
class
aries_cloudagent.protocols.introduction.messages.invitation.
Invitation
(*, invitation: aries_cloudagent.protocols.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.protocols.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
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
message
= <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
Represents an request for an invitation from the introduction service.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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
= <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.'})>¶
-
responder
= <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
Submodules¶
aries_cloudagent.protocols.introduction.base_service module¶
Introduction service base classes.
-
class
aries_cloudagent.protocols.introduction.base_service.
BaseIntroductionService
(context: aries_cloudagent.messaging.request_context.RequestContext)[source]¶ Bases:
abc.ABC
Service handler for allowing connections to exchange invitations.
-
return_invitation
(target_connection_id: str, invitation: aries_cloudagent.protocols.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.protocols.introduction.base_service.
IntroductionError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Generic introduction service error.
aries_cloudagent.protocols.introduction.demo_service module¶
Introduction service demo classes.
-
class
aries_cloudagent.protocols.introduction.demo_service.
DemoIntroductionService
(context: aries_cloudagent.messaging.request_context.RequestContext)[source]¶ Bases:
aries_cloudagent.protocols.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.protocols.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
-
aries_cloudagent.protocols.introduction.message_types module¶
Message type identifiers for Introductions.
aries_cloudagent.protocols.introduction.routes module¶
Introduction service admin routes.
aries_cloudagent.protocols.issue_credential package¶
Subpackages¶
aries_cloudagent.protocols.issue_credential.v1_0 package¶
Credential ack message handler.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_ack_handler.
CredentialAckHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential acks.
Credential issue message handler.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_issue_handler.
CredentialIssueHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential offers.
Credential offer message handler.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_offer_handler.
CredentialOfferHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential offers.
Credential proposal message handler.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_proposal_handler.
CredentialProposalHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential proposals.
Credential request message handler.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_request_handler.
CredentialRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for credential requests.
A credential preview inner object.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.inner.credential_preview.
CredAttrSpec
(*, name: str, value: str, mime_type: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing a preview of an attibute.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.inner.credential_preview.
CredAttrSpecSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Attribute preview schema.
-
class
Meta
[source]¶ Bases:
object
Attribute preview schema metadata.
-
model_class
¶ alias of
CredAttrSpec
-
-
mime_type
= <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.'})>¶
-
name
= <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.'})>¶
-
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.protocols.issue_credential.v1_0.messages.inner.credential_preview.
CredentialPreview
(*, _type: str = None, attributes: Sequence[aries_cloudagent.protocols.issue_credential.v1_0.messages.inner.credential_preview.CredAttrSpec] = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing a credential preview inner object.
-
class
Meta
[source]¶ Bases:
object
Credential preview metadata.
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/credential-preview'¶
-
schema_class
= 'CredentialPreviewSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.inner.credential_preview.
CredentialPreviewSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Credential preview schema.
-
class
Meta
[source]¶ Bases:
object
Credential preview schema metadata.
-
model_class
¶ alias of
CredentialPreview
-
-
attributes
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
A credential ack message.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_ack.
CredentialAck
(**kwargs)[source]¶ Bases:
aries_cloudagent.messaging.ack.message.Ack
Class representing a credential ack message.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_ack.
CredentialAckSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.ack.message.AckSchema
Credential ack schema.
-
class
Meta
[source]¶ Bases:
object
Schema metadata.
-
model_class
¶ alias of
CredentialAck
-
-
class
A credential content message.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_issue.
CredentialIssue
(_id: str = None, *, comment: str = None, credentials_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = 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.protocols.issue_credential.v1_0.handlers.credential_issue_handler.CredentialIssueHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/issue-credential'¶
-
schema_class
= 'CredentialIssueSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.issue_credential.v1_0.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
-
-
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.'})>¶
-
credentials_attach
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
A credential offer content message.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_offer.
CredentialOffer
(_id: str = None, *, comment: str = None, credential_preview: aries_cloudagent.protocols.issue_credential.v1_0.messages.inner.credential_preview.CredentialPreview = None, offers_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = 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.protocols.issue_credential.v1_0.handlers.credential_offer_handler.CredentialOfferHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/offer-credential'¶
-
schema_class
= 'CredentialOfferSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.issue_credential.v1_0.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
= <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.'})>¶
-
credential_preview
= <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.'})>¶
-
offers_attach
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
A credential proposal content message.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_proposal.
CredentialProposal
(_id: str = None, *, comment: str = None, credential_proposal: aries_cloudagent.protocols.issue_credential.v1_0.messages.inner.credential_preview.CredentialPreview = None, schema_id: str = None, schema_issuer_did: str = None, schema_name: str = None, schema_version: str = None, cred_def_id: str = None, issuer_did: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a credential proposal.
-
class
Meta
[source]¶ Bases:
object
CredentialProposal metadata.
-
handler_class
= 'aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_proposal_handler.CredentialProposalHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/propose-credential'¶
-
schema_class
= 'CredentialProposalSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_proposal.
CredentialProposalSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Credential proposal schema.
-
class
Meta
[source]¶ Bases:
object
Credential proposal schema metadata.
-
model_class
¶ alias of
CredentialProposal
-
-
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.'})>¶
-
cred_def_id
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredDefId object>, 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.'})>¶
-
credential_proposal
= <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.'})>¶
-
issuer_did
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID object>, 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.'})>¶
-
schema_id
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndySchemaId object>, 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.'})>¶
-
schema_issuer_did
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID object>, 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.'})>¶
-
schema_name
= <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.'})>¶
-
schema_version
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyVersion object>, 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.'})>¶
-
class
A credential request content message.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_request.
CredentialRequest
(_id: str = None, *, comment: str = None, requests_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = 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.protocols.issue_credential.v1_0.handlers.credential_request_handler.CredentialRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/issue-credential/1.0/request-credential'¶
-
schema_class
= 'CredentialRequestSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.issue_credential.v1_0.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
= <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.'})>¶
-
requests_attach
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
Aries#0036 v1.0 credential exchange information with non-secrets storage.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.
V10CredentialExchange
(*, credential_exchange_id: str = None, connection_id: str = None, thread_id: str = None, parent_thread_id: str = None, initiator: str = None, role: str = None, state: str = None, credential_definition_id: str = None, schema_id: str = None, credential_proposal_dict: dict = 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, auto_offer: bool = False, auto_issue: bool = False, error_msg: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecord
Represents an Aries#0036 credential exchange.
-
INITIATOR_EXTERNAL
= 'external'¶
-
INITIATOR_SELF
= 'self'¶
-
class
Meta
[source]¶ Bases:
object
CredentialExchange metadata.
-
schema_class
= 'V10CredentialExchangeSchema'¶
-
-
RECORD_ID_NAME
= 'credential_exchange_id'¶
-
RECORD_TYPE
= 'credential_exchange_v10'¶
-
ROLE_HOLDER
= 'holder'¶
-
ROLE_ISSUER
= 'issuer'¶
-
STATE_ACKED
= 'credential_acked'¶
-
STATE_CREDENTIAL_RECEIVED
= 'credential_received'¶
-
STATE_ISSUED
= 'credential_issued'¶
-
STATE_OFFER_RECEIVED
= 'offer_received'¶
-
STATE_OFFER_SENT
= 'offer_sent'¶
-
STATE_PROPOSAL_RECEIVED
= 'proposal_received'¶
-
STATE_PROPOSAL_SENT
= 'proposal_sent'¶
-
STATE_REQUEST_RECEIVED
= 'request_received'¶
-
STATE_REQUEST_SENT
= 'request_sent'¶
-
TAG_NAMES
= {'thread_id'}¶
-
WEBHOOK_TOPIC
= 'issue_credential'¶
-
credential_exchange_id
¶ Accessor for the ID associated with this exchange.
-
record_value
¶ Accessor for the JSON record value generated for this credential exchange.
-
classmethod
retrieve_by_connection_and_thread
(context: aries_cloudagent.config.injection_context.InjectionContext, connection_id: str, thread_id: str) → aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange[source]¶ Retrieve a credential exchange record by connection and thread ID.
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.
V10CredentialExchangeSchema
(*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
V10CredentialExchangeSchema metadata.
-
model_class
¶ alias of
V10CredentialExchange
-
-
auto_issue
= <fields.Boolean(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 boolean.'})>¶
-
auto_offer
= <fields.Boolean(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 boolean.'})>¶
-
connection_id
= <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.'})>¶
-
credential
= <fields.Dict(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 mapping type.'})>¶
-
credential_definition_id
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredDefId object>, 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.'})>¶
-
credential_exchange_id
= <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.'})>¶
-
credential_id
= <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.'})>¶
-
credential_offer
= <fields.Dict(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 mapping type.'})>¶
-
credential_proposal_dict
= <fields.Dict(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 mapping type.'})>¶
-
credential_request
= <fields.Dict(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 mapping type.'})>¶
-
credential_request_metadata
= <fields.Dict(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 mapping type.'})>¶
-
error_msg
= <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.'})>¶
-
initiator
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['self', 'external'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
parent_thread_id
= <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.'})>¶
-
raw_credential
= <fields.Dict(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 mapping type.'})>¶
-
role
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['holder', 'issuer'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
schema_id
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndySchemaId object>, 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.'})>¶
-
state
= <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.'})>¶
-
thread_id
= <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.'})>¶
-
class
Classes to manage credentials.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.manager.
CredentialManager
(context: aries_cloudagent.config.injection_context.InjectionContext)[source]¶ Bases:
object
Class for managing credentials.
-
context
¶ Accessor for the current request context.
Returns: The request context for this connection
-
create_offer
(credential_exchange_record: aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, comment: str = None) → Tuple[aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_offer.CredentialOffer][source]¶ Create a credential offer, update credential exchange record.
Parameters: - credential_exchange_record – Credential exchange to create offer for
- comment – optional human-readable comment to set in offer message
Returns: A tuple (credential exchange record, credential offer message)
-
create_proposal
(connection_id: str, *, auto_offer: bool = None, comment: str = None, credential_preview: aries_cloudagent.protocols.issue_credential.v1_0.messages.inner.credential_preview.CredentialPreview = None, schema_id: str = None, schema_issuer_did: str = None, schema_name: str = None, schema_version: str = None, cred_def_id: str = None, issuer_did: str = None) → aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange[source]¶ Create a credential proposal.
Parameters: - connection_id – Connection to create proposal for
- auto_offer – Should this proposal request automatically be handled to offer a credential
- comment – Optional human-readable comment to include in proposal
- credential_preview – The credential preview to use to create the credential proposal
- schema_id – Schema id for credential proposal
- schema_issuer_did – Schema issuer DID for credential proposal
- schema_name – Schema name for credential proposal
- schema_version – Schema version for credential proposal
- cred_def_id – Credential definition id for credential proposal
- issuer_did – Issuer DID for credential proposal
Returns: Resulting credential exchange record including credential proposal
-
create_request
(credential_exchange_record: aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, holder_did: str) → Tuple[aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_request.CredentialRequest][source]¶ Create a credential request.
Parameters: - credential_exchange_record – Credential exchange record for which to create request
- holder_did – holder DID
Returns: A tuple (credential exchange record, credential request message)
-
issue_credential
(credential_exchange_record: aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, *, comment: str = None, credential_values: dict) → Tuple[aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_issue.CredentialIssue][source]¶ Issue a credential.
Parameters: - credential_exchange_record – The credential exchange record for which to issue a credential
- comment – optional human-readable comment pertaining to credential issue
- credential_values – dict of credential attribute {name: value} pairs
Returns: (Updated credential exchange record, credential message)
Return type: Tuple
-
prepare_send
(connection_id: str, credential_proposal: aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_proposal.CredentialProposal) → Tuple[aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_offer.CredentialOffer][source]¶ Set up a new credential exchange for an automated send.
Parameters: - connection_id – Connection to create offer for
- credential_proposal – The credential proposal with preview on attribute values to use if auto_issue is enabled
Returns: A tuple of the new credential exchange record and credential offer message
-
receive_credential
() → aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange[source]¶ Receive a credential from an issuer.
Hold in storage potentially to be processed by controller before storing.
Returns: Credential exchange record, retrieved and updated
-
receive_credential_ack
() → aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange[source]¶ Receive credential ack from holder.
Returns: credential exchange record, retrieved and updated
-
receive_offer
() → aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange[source]¶ Receive a credential offer.
Returns: The credential exchange record, updated
-
receive_proposal
() → aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange[source]¶ Receive a credential proposal from message in context on manager creation.
Returns: The resulting credential exchange record, created
-
receive_request
()[source]¶ Receive a credential request.
Parameters: credential_request_message – Credential request to receive Returns: credential exchange record, retrieved and updated
-
store_credential
(credential_exchange_record: aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, credential_id: str = None) → Tuple[aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_ack.CredentialAck][source]¶ Store a credential in holder wallet; send ack to issuer.
Parameters: credential_exchange_record – credential exchange record with credential to store and ack Returns: (Updated credential exchange record, credential ack message) Return type: Tuple
-
-
exception
aries_cloudagent.protocols.issue_credential.v1_0.manager.
CredentialManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Credential error.
Message and inner object type identifiers for Connections.
Credential exchange admin routes.
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10AttributeMimeTypesResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for credential attribute MIME types by credential definition.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10CredentialExchangeListResultSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for Aries#0036 v1.0 credential exchange query.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10CredentialIssueRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending credential issue admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10CredentialOfferRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending credential offer admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10CredentialProblemReportRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending problem report.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10CredentialProposalRequestMandSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialProposalRequestSchemaBase
Request schema for sending credential proposal on mandatory proposal preview.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10CredentialProposalRequestOptSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialProposalRequestSchemaBase
Request schema for sending credential proposal on optional proposal preview.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10CredentialProposalRequestSchemaBase
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Base class for request schema for sending credential proposal admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.issue_credential.v1_0.routes.
V10CredentialStoreRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a credential store admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
attribute_mime_types_get
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for getting credential attribute MIME types.
Parameters: request – aiohttp request object Returns: The MIME types response
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_issue
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for sending credential.
Parameters: request – aiohttp request object Returns: The credential exchange record
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for searching connection records.
Parameters: request – aiohttp request object Returns: The connection list response
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_problem_report
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for sending problem report.
Parameters: request – aiohttp request object
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_remove
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for removing a credential exchange record.
Parameters: request – aiohttp request object
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_retrieve
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for fetching single connection record.
Parameters: request – aiohttp request object Returns: The credential exchange record
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_send
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for sending credential from issuer to holder from attr values.
If both issuer and holder are configured for automatic responses, the operation ultimately results in credential issue; otherwise, the result waits on the first response not automated; the credential exchange record retains state regardless.
Parameters: request – aiohttp request object Returns: The credential exchange record
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_send_bound_offer
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for sending bound credential offer.
A holder initiates this sequence with a credential proposal; this message responds with an offer bound to the proposal.
Parameters: request – aiohttp request object Returns: The credential exchange record
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_send_free_offer
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for sending free credential offer.
An issuer initiates a such a credential offer, free from any holder-initiated corresponding credential proposal with preview.
Parameters: request – aiohttp request object Returns: The credential exchange record
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_send_proposal
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for sending credential proposal.
Parameters: request – aiohttp request object Returns: The credential exchange record
-
aries_cloudagent.protocols.issue_credential.v1_0.routes.
credential_exchange_send_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a18f208>)[source]¶ Request handler for sending credential request.
Parameters: request – aiohttp request object Returns: The credential exchange record
Submodules¶
aries_cloudagent.protocols.issue_credential.message_types module¶
All issue_credential message types.
aries_cloudagent.protocols.present_proof package¶
Subpackages¶
aries_cloudagent.protocols.present_proof.v1_0 package¶
Presentation ack message handler.
-
class
aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_ack_handler.
PresentationAckHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for presentation acks.
Presentation message handler.
-
class
aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_handler.
PresentationHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for presentations.
Presentation proposal message handler.
-
class
aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_proposal_handler.
PresentationProposalHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for presentation proposals.
Presentation request message handler.
-
class
aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_request_handler.
PresentationRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for Aries#0037 v1.0 presentation requests.
A presentation preview inner object.
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.
PresAttrSpec
(name: str, *, cred_def_id: str = None, mime_type: str = None, value: str = None, referent: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing an attibute specification within a presentation preview.
-
class
Posture
[source]¶ Bases:
enum.Enum
Attribute posture: self-attested, revealed claim or unrevealed claim.
-
REVEALED_CLAIM
= 1¶
-
SELF_ATTESTED
= 0¶
-
UNREVEALED_CLAIM
= 2¶
-
-
static
list_plain
(plain: dict, cred_def_id: str, referent: str = None)[source]¶ Return a list of PresAttrSpec on input cred def id.
Parameters: - plain – dict mapping names to values
- cred_def_id – credential definition identifier to specify
- referent – single referent to use, omit for none
Returns: List of PresAttrSpec on input cred def id with no MIME types
-
posture
¶ self-attested, revealed claim, or unrevealed claim.
Type: Attribute posture
-
class
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.
PresAttrSpecSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Attribute specifiation schema.
-
class
Meta
[source]¶ Bases:
object
Attribute specifiation schema metadata.
-
model_class
¶ alias of
PresAttrSpec
-
-
cred_def_id
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredDefId object>, 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.'})>¶
-
mime_type
= <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.'})>¶
-
name
= <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.'})>¶
-
referent
= <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=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.'})>¶
-
class
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.
PresPredSpec
(name: str, *, cred_def_id: str, predicate: str, threshold: int, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing a predicate specification within a presentation preview.
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.
PresPredSpecSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Predicate specifiation schema.
-
class
Meta
[source]¶ Bases:
object
Predicate specifiation schema metadata.
-
model_class
¶ alias of
PresPredSpec
-
-
cred_def_id
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredDefId object>, 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.'})>¶
-
name
= <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.'})>¶
-
predicate
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyPredicate object>, 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.'})>¶
-
threshold
= <fields.Integer(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 integer.', 'too_large': 'Number too large.'})>¶
-
class
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.
PresentationPreview
(*, _type: str = None, attributes: Sequence[aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.PresAttrSpec] = None, predicates: Sequence[aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.PresPredSpec] = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Class representing presentation preview.
-
class
Meta
[source]¶ Bases:
object
Presentation preview metadata.
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/presentation-preview'¶
-
schema_class
= 'PresentationPreviewSchema'¶
-
-
has_attr_spec
(cred_def_id: str, name: str, value: str) → bool[source]¶ Return whether preview contains given attribute specification.
Parameters: - cred_def_id – credential definition identifier
- name – attribute name
- value – attribute value
Returns: Whether preview contains matching attribute specification.
-
indy_proof_request
(name: str = None, version: str = None, nonce: str = None, ledger: aries_cloudagent.ledger.indy.IndyLedger = None, timestamps: Mapping[str, int] = None) → dict[source]¶ Return indy proof request corresponding to presentation preview.
Typically the verifier turns the proof preview into a proof request.
Parameters: - name – for proof request
- version – version for proof request
- nonce – nonce for proof request
- ledger – ledger with credential definitions, to check for revocation support
- timestamps – dict mapping cred def ids to non-revocation timestamps to use (default current time where applicable)
Returns: Indy proof request dict.
-
class
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.
PresentationPreviewSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
Presentation preview schema.
-
class
Meta
[source]¶ Bases:
object
Presentation preview schema metadata.
-
model_class
¶ alias of
PresentationPreview
-
-
attributes
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
predicates
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
A (proof) presentation content message.
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation.
Presentation
(_id: str = None, *, comment: str = None, presentations_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a (proof) presentation.
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation.
PresentationSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
(Proof) presentation schema.
-
class
Meta
[source]¶ Bases:
object
Presentation schema metadata.
-
model_class
¶ alias of
Presentation
-
-
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.'})>¶
-
presentations_attach
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
Represents an explicit RFC 15 ack message, adopted into present-proof protocol.
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_ack.
PresentationAck
(status: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.ack.message.Ack
Base class representing an explicit ack message for present-proof protocol.
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_ack.
PresentationAckSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.ack.message.AckSchema
Schema for PresentationAck class.
-
class
Meta
[source]¶ Bases:
object
PresentationAck schema metadata.
-
model_class
¶ alias of
PresentationAck
-
-
class
A presentation proposal content message.
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_proposal.
PresentationProposal
(_id: str = None, *, comment: str = None, presentation_proposal: aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.PresentationPreview = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessage
Class representing a presentation proposal.
-
class
Meta
[source]¶ Bases:
object
PresentationProposal metadata.
-
handler_class
= 'aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_proposal_handler.PresentationProposalHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/propose-presentation'¶
-
schema_class
= 'PresentationProposalSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_proposal.
PresentationProposalSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Presentation proposal schema.
-
class
Meta
[source]¶ Bases:
object
Presentation proposal schema metadata.
-
model_class
¶ alias of
PresentationProposal
-
-
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.'})>¶
-
presentation_proposal
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
A presentation request content message.
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_request.
PresentationRequest
(_id: str = None, *, comment: str = None, request_presentations_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = 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.protocols.present_proof.v1_0.handlers.presentation_request_handler.PresentationRequestHandler'¶
-
message_type
= 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec/present-proof/1.0/request-presentation'¶
-
schema_class
= 'PresentationRequestSchema'¶
-
-
class
-
class
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_request.
PresentationRequestSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Presentation request schema.
-
class
Meta
[source]¶ Bases:
object
Presentation request schema metadata.
-
model_class
¶ alias of
PresentationRequest
-
-
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.'})>¶
-
request_presentations_attach
= <fields.Nested(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.', 'type': 'Invalid type.'})>¶
-
class
Aries#0037 v1.0 presentation exchange information with non-secrets storage.
-
class
aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.
V10PresentationExchange
(*, presentation_exchange_id: str = None, connection_id: str = None, thread_id: str = None, initiator: str = None, role: str = None, state: str = None, presentation_proposal_dict: dict = None, presentation_request: dict = None, presentation: dict = None, verified: str = None, auto_present: bool = False, error_msg: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecord
Represents an Aries#0037 v1.0 presentation exchange.
-
INITIATOR_EXTERNAL
= 'external'¶
-
INITIATOR_SELF
= 'self'¶
-
class
Meta
[source]¶ Bases:
object
V10PresentationExchange metadata.
-
schema_class
= 'V10PresentationExchangeSchema'¶
-
-
RECORD_ID_NAME
= 'presentation_exchange_id'¶
-
RECORD_TYPE
= 'presentation_exchange_v10'¶
-
ROLE_PROVER
= 'prover'¶
-
ROLE_VERIFIER
= 'verifier'¶
-
STATE_PRESENTATION_ACKED
= 'presentation_acked'¶
-
STATE_PRESENTATION_RECEIVED
= 'presentation_received'¶
-
STATE_PRESENTATION_SENT
= 'presentation_sent'¶
-
STATE_PROPOSAL_RECEIVED
= 'proposal_received'¶
-
STATE_PROPOSAL_SENT
= 'proposal_sent'¶
-
STATE_REQUEST_RECEIVED
= 'request_received'¶
-
STATE_REQUEST_SENT
= 'request_sent'¶
-
STATE_VERIFIED
= 'verified'¶
-
TAG_NAMES
= {'thread_id'}¶
-
WEBHOOK_TOPIC
= 'present_proof'¶
-
presentation_exchange_id
¶ Accessor for the ID associated with this exchange.
-
record_value
¶ Accessor for JSON record value generated for this presentation exchange.
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.
V10PresentationExchangeSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecordSchema
Schema for de/serialization of v1.0 presentation exchange records.
-
class
Meta
[source]¶ Bases:
object
V10PresentationExchangeSchema metadata.
-
model_class
¶ alias of
V10PresentationExchange
-
-
auto_present
= <fields.Boolean(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 boolean.'})>¶
-
connection_id
= <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.'})>¶
-
error_msg
= <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.'})>¶
-
initiator
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['self', 'external'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
presentation
= <fields.Dict(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 mapping type.'})>¶
-
presentation_exchange_id
= <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.'})>¶
-
presentation_proposal_dict
= <fields.Dict(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 mapping type.'})>¶
-
presentation_request
= <fields.Dict(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 mapping type.'})>¶
-
role
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['prover', 'verifier'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
state
= <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.'})>¶
-
thread_id
= <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.'})>¶
-
verified
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['true', 'false'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
class
Utilities for dealing with indy conventions.
-
aries_cloudagent.protocols.present_proof.v1_0.util.indy.
indy_proof_req_preview2indy_requested_creds
(indy_proof_request: dict, preview: aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview.PresentationPreview = None, *, holder: aries_cloudagent.holder.base.BaseHolder)[source]¶ Build indy requested-credentials structure.
Given input proof request and presentation preview, use credentials in holder’s wallet to build indy requested credentials structure for input to proof creation.
Parameters: - indy_proof_request – indy proof request
- pres_preview – preview from presentation proposal, if applicable
- holder – holder injected into current context
Classes to manage presentations.
-
class
aries_cloudagent.protocols.present_proof.v1_0.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_bound_request
(presentation_exchange_record: aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.V10PresentationExchange, name: str = None, version: str = None, nonce: str = None, comment: str = None)[source]¶ Create a presentation request bound to a proposal.
Parameters: - presentation_exchange_record – Presentation exchange record for which to create presentation request
- name – name to use in presentation request (None for default)
- version – version to use in presentation request (None for default)
- nonce – nonce to use in presentation request (None to generate)
- comment – Optional human-readable comment pertaining to request creation
Returns: A tuple (updated presentation exchange record, presentation request message)
-
create_exchange_for_proposal
(connection_id: str, presentation_proposal_message: aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_proposal.PresentationProposal, auto_present: bool = None)[source]¶ Create a presentation exchange record for input presentation proposal.
Parameters: - connection_id – connection identifier
- presentation_proposal_message – presentation proposal to serialize to exchange record
- auto_present – whether to present proof upon receiving proof request (default to configuration setting)
Returns: Presentation exchange record, created
-
create_exchange_for_request
(connection_id: str, presentation_request_message: aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_request.PresentationRequest)[source]¶ Create a presentation exchange record for input presentation request.
Parameters: - connection_id – connection identifier
- presentation_request_message – presentation request to use in creating exchange record, extracting indy proof request and thread id
Returns: Presentation exchange record, updated
-
create_presentation
(presentation_exchange_record: aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.V10PresentationExchange, requested_credentials: dict, comment: str = None)[source]¶ Create a presentation.
Parameters: - presentation_exchange_record – Record to update
- requested_credentials – Indy formatted requested_credentials
- comment – optional human-readable comment
Example requested_credentials format:
{ "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" } } }
Returns: A tuple (updated presentation exchange record, presentation message)
-
receive_presentation
()[source]¶ Receive a presentation, from message in context on manager creation.
Returns: presentation exchange record, retrieved and updated
-
receive_presentation_ack
()[source]¶ Receive a presentation ack, from message in context on manager creation.
Returns: presentation exchange record, retrieved and updated
-
receive_proposal
()[source]¶ Receive a presentation proposal from message in context on manager creation.
Returns: Presentation exchange record, created
-
receive_request
(presentation_exchange_record: aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.V10PresentationExchange)[source]¶ Receive a presentation request.
Parameters: presentation_exchange_record – presentation exchange record with request to receive Returns: The presentation_exchange_record, updated
-
send_presentation_ack
(presentation_exchange_record: aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.V10PresentationExchange)[source]¶ Send acknowledgement of presentation receipt.
Parameters: presentation_exchange_record – presentation exchange record with thread id
-
verify_presentation
(presentation_exchange_record: aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.V10PresentationExchange)[source]¶ Verify a presentation.
Parameters: presentation_exchange_record – presentation exchange record with presentation request and presentation to verify Returns: presentation record, updated
-
-
exception
aries_cloudagent.protocols.present_proof.v1_0.manager.
PresentationManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Presentation error.
Message and inner object type identifiers for Connections.
Admin routes for presentations.
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
IndyProofReqAttrSpecSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Schema for attribute specification in indy proof request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
IndyProofReqNonRevoked
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Non-revocation times specification in indy proof request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
IndyProofReqPredSpecSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Schema for predicate specification in indy proof request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
IndyProofReqSpecRestrictionsSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Schema for restrictions in attr or pred specifier indy proof request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
IndyProofRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Schema for indy proof request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
IndyRequestedCredsRequestedAttrSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Schema for requested attributes within indy requested credentials structure.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
IndyRequestedCredsRequestedPredSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Schema for requested predicates within indy requested credentials structure.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
V10PresentationExchangeListSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for an Aries#0037 v1.0 presentation exchange query.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
V10PresentationProposalRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a presentation proposal admin message.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
V10PresentationRequestRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a proof request.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.present_proof.v1_0.routes.
V10PresentationRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a presentation.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_create_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for creating a free presentation request.
The presentation request will not be bound to any proposal or existing connection.
Parameters: request – aiohttp request object Returns: The presentation exchange details
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_credentials_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for searching applicable credential records.
Parameters: request – aiohttp request object Returns: The credential list response
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for searching presentation exchange records.
Parameters: request – aiohttp request object Returns: The presentation exchange list response
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_remove
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for removing a presentation exchange record.
Parameters: request – aiohttp request object
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_retrieve
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for fetching a single presentation exchange record.
Parameters: request – aiohttp request object Returns: The presentation exchange record response
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_send_bound_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for sending a presentation request free from any proposal.
Parameters: request – aiohttp request object Returns: The presentation exchange details
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_send_free_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for sending a presentation request free from any proposal.
Parameters: request – aiohttp request object Returns: The presentation exchange details
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_send_presentation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for sending a presentation.
Parameters: request – aiohttp request object Returns: The presentation exchange details
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_send_proposal
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for sending a presentation proposal.
Parameters: request – aiohttp request object Returns: The presentation exchange details
-
aries_cloudagent.protocols.present_proof.v1_0.routes.
presentation_exchange_verify_presentation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66ab8bbe0>)[source]¶ Request handler for verifying a presentation request.
Parameters: request – aiohttp request object Returns: The presentation exchange details
Submodules¶
aries_cloudagent.protocols.present_proof.message_types module¶
All present_proof message types.
aries_cloudagent.protocols.presentations package¶
Subpackages¶
aries_cloudagent.protocols.presentations.handlers package¶
Basic message handler.
-
class
aries_cloudagent.protocols.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.protocols.presentations.handlers.presentation_request_handler.
PresentationRequestHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Message handler class for presentation requests.
aries_cloudagent.protocols.presentations.messages package¶
A credential presentation message.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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
= <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.'})>¶
-
presentation
= <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
A presentation request content message.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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
= <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.'})>¶
-
request
= <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
aries_cloudagent.protocols.presentations.models package¶
Handle presentation exchange information interface with non-secrets storage.
-
class
aries_cloudagent.protocols.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'¶
-
TAG_NAMES
= {'thread_id'}¶
-
WEBHOOK_TOPIC
= 'presentations'¶
-
presentation_exchange_id
¶ Accessor for the ID associated with this exchange.
-
record_value
¶ Accessor for JSON record value generated for this presentation exchange.
-
-
class
aries_cloudagent.protocols.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
= <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.'})>¶
-
error_msg
= <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.'})>¶
-
initiator
= <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.'})>¶
-
presentation
= <fields.Dict(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 mapping type.'})>¶
-
presentation_exchange_id
= <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.'})>¶
-
presentation_request
= <fields.Dict(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 mapping type.'})>¶
-
state
= <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.'})>¶
-
thread_id
= <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.'})>¶
-
verified
= <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.'})>¶
-
class
Submodules¶
aries_cloudagent.protocols.presentations.manager module¶
Classes to manage presentations.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.presentations.manager.
PresentationManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Presentation error.
aries_cloudagent.protocols.presentations.message_types module¶
Message type identifiers for presentations.
aries_cloudagent.protocols.presentations.routes module¶
Admin routes for presentations.
-
class
aries_cloudagent.protocols.presentations.routes.
PresentationExchangeListSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Result schema for a presentation exchange query.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.presentations.routes.
PresentationRequestRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a proof request.
-
class
RequestedAttribute
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
RequestedAttribute model.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
RequestedPredicate
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
RequestedPredicate model.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
class
-
class
aries_cloudagent.protocols.presentations.routes.
SendPresentationRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for sending a presentation.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
aries_cloudagent.protocols.presentations.routes.
presentation_exchange_create_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a00a128>)[source]¶ Request handler for creating a presentation request.
Parameters: request – aiohttp request object Returns: The presentation exchange details.
-
aries_cloudagent.protocols.presentations.routes.
presentation_exchange_credentials_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a00a128>)[source]¶ Request handler for searching applicable credential records.
Parameters: request – aiohttp request object Returns: The credential list response
-
aries_cloudagent.protocols.presentations.routes.
presentation_exchange_list
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a00a128>)[source]¶ Request handler for searching presentation exchange records.
Parameters: request – aiohttp request object Returns: The presentation exchange list response
-
aries_cloudagent.protocols.presentations.routes.
presentation_exchange_remove
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a00a128>)[source]¶ Request handler for removing a presentation exchange record.
Parameters: request – aiohttp request object
-
aries_cloudagent.protocols.presentations.routes.
presentation_exchange_retrieve
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a00a128>)[source]¶ Request handler for fetching a single presentation exchange record.
Parameters: request – aiohttp request object Returns: The presentation exchange record response
-
aries_cloudagent.protocols.presentations.routes.
presentation_exchange_send_credential_presentation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a00a128>)[source]¶ Request handler for sending a credential presentation.
Parameters: request – aiohttp request object Returns: The presentation exchange details.
-
aries_cloudagent.protocols.presentations.routes.
presentation_exchange_send_request
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a00a128>)[source]¶ Request handler for creating and sending a presentation request.
Parameters: request – aiohttp request object Returns: The presentation exchange details.
-
aries_cloudagent.protocols.presentations.routes.
presentation_exchange_verify_credential_presentation
(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb66a00a128>)[source]¶ Request handler for verifying a presentation request.
Parameters: request – aiohttp request object Returns: The presentation exchange details.
aries_cloudagent.protocols.problem_report package¶
Submodules¶
aries_cloudagent.protocols.problem_report.handler module¶
Generic problem report handler.
-
class
aries_cloudagent.protocols.problem_report.handler.
ProblemReportHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Problem report handler class.
aries_cloudagent.protocols.problem_report.message module¶
Represents a generic problem report message.
-
class
aries_cloudagent.protocols.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.protocols.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
= <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.'})>¶
-
explain_l10n
= <fields.Dict(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 mapping type.'})>¶
-
explain_ltxt
= <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.'})>¶
-
fix_hint_ltxt
= <fields.Dict(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 mapping type.'})>¶
-
impact
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['message', 'thread', 'connection'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
locale
= <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.'})>¶
-
msg_catalog
= <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.'})>¶
-
problem_items
= <fields.List(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 list.'})>¶
-
time_noticed
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<Regexp(regex=re.compile('^\\d{4}-\\d\\d-\\d\\d(?:(?: \\d\\d:\\d\\d(?:\\:\\d\\d(?:\\.\\d{1,6})?)(?:[+=]\\d\\d:?\\d\\d|Z)?)?)$'), error='String does not match expected pattern.')>, 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.'})>¶
-
tracking_uri
= <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.'})>¶
-
where
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<Regexp(regex=re.compile('(you)|(me)|(other) - .+'), error='String does not match expected pattern.')>, 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.'})>¶
-
who_retries
= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['you', 'me', 'both', 'none'], labels=[], error='Must be one of: {choices}.')>, 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.'})>¶
-
class
aries_cloudagent.protocols.problem_report.message_types module¶
Message type identifiers for problem reports.
aries_cloudagent.protocols.routing package¶
Subpackages¶
aries_cloudagent.protocols.routing.handlers package¶
Handler for incoming forward messages.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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.protocols.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.protocols.routing.handlers.route_update_response_handler.
RouteUpdateResponseHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Handler for incoming route-update-response messages.
aries_cloudagent.protocols.routing.messages package¶
Represents a forward message.
-
class
aries_cloudagent.protocols.routing.messages.forward.
Forward
(*, to: str = None, msg: Union[dict, 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.protocols.routing.messages.forward.
ForwardSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Forward message schema used in serialization/deserialization.
-
handle_str_message
(data, **kwargs)[source]¶ Accept string value for msg, as produced by previous implementation.
-
msg
= <fields.Dict(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 mapping type.'})>¶
-
to
= <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.'})>¶
-
Query existing forwarding routes.
-
class
aries_cloudagent.protocols.routing.messages.route_query_request.
RouteQueryRequest
(*, filter: dict = None, paginate: aries_cloudagent.protocols.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.protocols.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.protocols.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.protocols.routing.messages.route_query_response.
RouteQueryResponse
(*, routes: Sequence[aries_cloudagent.protocols.routing.models.route_query_result.RouteQueryResult] = None, paginated: aries_cloudagent.protocols.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.protocols.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.protocols.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.protocols.routing.messages.route_update_request.
RouteUpdateRequest
(*, updates: Sequence[aries_cloudagent.protocols.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.protocols.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.protocols.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
= <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
Response for a route update request.
-
class
aries_cloudagent.protocols.routing.messages.route_update_response.
RouteUpdateResponse
(*, updated: Sequence[aries_cloudagent.protocols.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.protocols.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.protocols.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
aries_cloudagent.protocols.routing.models package¶
An object for containing the request pagination information.
-
class
aries_cloudagent.protocols.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.protocols.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.', 'too_large': 'Number too large.'})>¶
-
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.', 'too_large': 'Number too large.'})>¶
-
An object for containing the response pagination information.
-
class
aries_cloudagent.protocols.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.protocols.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.', 'too_large': 'Number too large.'})>¶
-
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.', 'too_large': 'Number too large.'})>¶
-
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.', 'too_large': 'Number too large.'})>¶
-
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.', 'too_large': 'Number too large.'})>¶
-
An object for containing returned route information.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.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.protocols.routing.models.route_record.
RouteRecordSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
RouteRecord schema.
-
connection_id
= <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.'})>¶
-
created_at
= <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.'})>¶
-
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.'})>¶
-
record_id
= <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.'})>¶
-
updated_at
= <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.'})>¶
-
An object for containing route information to be updated.
-
class
aries_cloudagent.protocols.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.protocols.routing.models.route_update.
RouteUpdateSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
RouteUpdate schema.
-
action
= <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.'})>¶
-
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.'})>¶
-
An object for containing updated route information.
-
class
aries_cloudagent.protocols.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.protocols.routing.models.route_updated.
RouteUpdatedSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
RouteUpdated schema.
-
action
= <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.'})>¶
-
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.'})>¶
-
result
= <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.'})>¶
-
Submodules¶
aries_cloudagent.protocols.routing.manager module¶
Routing manager classes for tracking and inspecting routing records.
-
exception
aries_cloudagent.protocols.routing.manager.
RouteNotFoundError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.protocols.routing.manager.RoutingManagerError
Requested route was not found.
-
class
aries_cloudagent.protocols.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.protocols.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.protocols.routing.models.route_record.RouteRecord)[source]¶ Remove an existing route record.
-
get_recipient
(recip_verkey: str) → aries_cloudagent.protocols.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.protocols.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.protocols.routing.models.route_update.RouteUpdate]) → Sequence[aries_cloudagent.protocols.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.protocols.routing.manager.
RoutingManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
Generic routing error.
aries_cloudagent.protocols.routing.message_types module¶
Message type identifiers for Routing.
aries_cloudagent.protocols.trustping package¶
Subpackages¶
aries_cloudagent.protocols.trustping.handlers package¶
Ping handler.
-
class
aries_cloudagent.protocols.trustping.handlers.ping_handler.
PingHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Ping handler class.
Ping response handler.
-
class
aries_cloudagent.protocols.trustping.handlers.ping_response_handler.
PingResponseHandler
[source]¶ Bases:
aries_cloudagent.messaging.base_handler.BaseHandler
Ping response handler class.
aries_cloudagent.protocols.trustping.messages package¶
Represents a trust ping message.
-
class
aries_cloudagent.protocols.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.protocols.trustping.messages.ping.
PingSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.agent_message.AgentMessageSchema
Schema for Ping class.
-
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.'})>¶
-
response_requested
= <fields.Boolean(default=True, 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 boolean.'})>¶
-
Represents an response to a trust ping message.
-
class
aries_cloudagent.protocols.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.protocols.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
Submodules¶
aries_cloudagent.protocols.trustping.message_types module¶
Message type identifiers for Trust Pings.
aries_cloudagent.protocols.trustping.routes module¶
Trust ping admin routes.
-
class
aries_cloudagent.protocols.trustping.routes.
PingRequestResponseSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for performing a ping.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-
-
class
aries_cloudagent.protocols.trustping.routes.
PingRequestSchema
(*, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)[source]¶ Bases:
marshmallow.schema.Schema
Request schema for performing a ping.
-
opts
= <marshmallow.schema.SchemaOpts object>¶
-