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

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.

start() → None[source]

Start the webserver.

Raises:AdminSetupError – If there was an error starting the webserver
stop() → None[source]

Stop the webserver.

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.request_context module

Admin request context class.

A request context provided by the admin server to admin route handlers.

class aries_cloudagent.admin.request_context.AdminRequestContext(profile: aries_cloudagent.core.profile.Profile, *, context: aries_cloudagent.config.injection_context.InjectionContext = None, settings: Mapping[str, object] = None)[source]

Bases: object

Context established by the Conductor and passed into message handlers.

inject(base_cls: Type[InjectType], settings: Mapping[str, object] = None, *, required: bool = True) → Optional[InjectType][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 the associated Injector instance.

profile

Accessor for the associated Profile instance.

session() → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with no transaction support requested.

settings

Accessor for the context settings.

classmethod test_context(session_inject: dict = None, profile: aries_cloudagent.core.profile.Profile = None) → aries_cloudagent.admin.request_context.AdminRequestContext[source]

Quickly set up a new admin request context for tests.

transaction() → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with commit and rollback support.

If the current backend does not support transactions, then commit and rollback operations of the session will not have any effect.

update_settings(settings: Mapping[str, object])[source]

Update the current scope with additional settings.

aries_cloudagent.admin.server module

Admin server classes.

class aries_cloudagent.admin.server.AdminConfigSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for the config endpoint.

config

Used by autodoc_mock_imports.

class aries_cloudagent.admin.server.AdminModulesSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for the modules endpoint.

result

Used by autodoc_mock_imports.

class aries_cloudagent.admin.server.AdminResetSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for the reset endpoint.

class aries_cloudagent.admin.server.AdminResponder(profile: aries_cloudagent.core.profile.Profile, send: Coroutine[T_co, T_contra, V_co], **kwargs)[source]

Bases: aries_cloudagent.messaging.responder.BaseResponder

Handle outgoing messages from message handlers.

send_fn

Accessor for async function to send outbound message.

send_outbound(message: aries_cloudagent.transport.outbound.message.OutboundMessage) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Send outbound message.

Parameters:message – The OutboundMessage to be sent
send_webhook(topic: str, payload: dict)[source]

Dispatch a webhook. DEPRECATED: use the event bus instead.

Parameters:
  • topic – the webhook topic identifier
  • payload – the webhook payload value
class aries_cloudagent.admin.server.AdminServer(host: str, port: int, context: aries_cloudagent.config.injection_context.InjectionContext, root_profile: aries_cloudagent.core.profile.Profile, outbound_message_router: Coroutine[T_co, T_contra, V_co], webhook_router: Callable, conductor_stop: Coroutine[T_co, T_contra, V_co], 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.

config_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>)[source]

Request handler for the server configuration.

Parameters:request – aiohttp request object
Returns:The web response
liveliness_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>)[source]

Request handler for liveliness check.

Parameters:request – aiohttp request object
Returns:The web response, always indicating True
make_application() → <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>[source]

Get the aiohttp application instance.

notify_fatal_error()[source]

Set our readiness flags to force a restart (openshift).

on_startup(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>)[source]

Perform webserver startup actions.

plugins_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>)[source]

Request handler for the loaded plugins list.

Parameters:request – aiohttp request object
Returns:The module list response
readiness_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>)[source]

Request handler for liveliness check.

Parameters:request – aiohttp request object
Returns:The web response, indicating readiness for further calls
redirect_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>)[source]

Perform redirect to documentation.

send_webhook(profile: aries_cloudagent.core.profile.Profile, topic: str, payload: dict = None)[source]

Add a webhook to the queue, to send to all registered targets.

shutdown_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>)[source]

Request handler for server shutdown.

Parameters:request – aiohttp request object
Returns:The web response (empty production)
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 0x7fb056712cd0>)[source]

Request handler for the server status information.

Parameters:request – aiohttp request object
Returns:The web response
status_reset_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>)[source]

Request handler for resetting the timing statistics.

Parameters:request – aiohttp request object
Returns:The web response
stop() → None[source]

Stop the webserver.

websocket_handler(request)[source]

Send notifications to admin client over websocket.

class aries_cloudagent.admin.server.AdminShutdownSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for admin Module.

class aries_cloudagent.admin.server.AdminStatusLivelinessSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for the liveliness endpoint.

alive

Used by autodoc_mock_imports.

class aries_cloudagent.admin.server.AdminStatusReadinessSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for the readiness endpoint.

ready

Used by autodoc_mock_imports.

class aries_cloudagent.admin.server.AdminStatusSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for the status endpoint.

conductor

Used by autodoc_mock_imports.

label

Used by autodoc_mock_imports.

timing

Used by autodoc_mock_imports.

version

Used by autodoc_mock_imports.

aries_cloudagent.admin.server.const_compare(string1, string2)[source]

Compare two strings in constant time.

aries_cloudagent.admin.server.debug_middleware(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>, handler: Coroutine[T_co, T_contra, V_co])[source]

Show request detail in debug log.

aries_cloudagent.admin.server.ready_middleware(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056712cd0>, handler: Coroutine[T_co, T_contra, V_co])[source]

Only continue if application is ready to take work.

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.

acquire(key: str)[source]

Acquire a lock on a given cache key.

clear(key: str)[source]

Remove an item from the cache, if present.

Parameters:key – the key to remove
flush()[source]

Remove all items from the cache.

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
release(key: str)[source]

Release the lock on a given cache key.

set(keys: Union[str, Sequence[str]], value: Any, ttl: int = None)[source]

Add an item to the cache with an optional ttl.

Parameters:
  • keys – the key or keys for which to set an item
  • value – the value to store in the cache
  • ttl – number of second that the record should persist
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.

release()[source]

Release the cache lock.

result

Fetch the current result, if any.

set_result(value: Any, ttl: int = None)[source]

Set the result, updating the cache and any waiters.

aries_cloudagent.cache.in_memory module

Basic in-memory cache implementation.

class aries_cloudagent.cache.in_memory.InMemoryCache[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
flush()[source]

Remove all items from the cache.

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.available_commands()[source]

Index available commands.

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.help.execute(argv: Sequence[str] = None)[source]

Execute the help command.

aries_cloudagent.commands.help.main()[source]

Execute the main line.

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.provision.execute(argv: Sequence[str] = None)[source]

Entrypoint.

aries_cloudagent.commands.provision.init_argument_parser(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0562e4950>)[source]

Initialize an argument parser with the module’s arguments.

aries_cloudagent.commands.provision.main()[source]

Execute the main line.

aries_cloudagent.commands.provision.provision(settings: dict)[source]

Perform provisioning.

aries_cloudagent.commands.start module

Entrypoint.

aries_cloudagent.commands.start.execute(argv: Sequence[str] = None)[source]

Entrypoint.

aries_cloudagent.commands.start.init_argument_parser(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05579bad0>)[source]

Initialize an argument parser with the module’s arguments.

aries_cloudagent.commands.start.main()[source]

Execute the main line.

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.commands.start.shutdown_app(conductor: aries_cloudagent.core.conductor.Conductor)[source]

Shut down.

aries_cloudagent.commands.start.start_app(conductor: aries_cloudagent.core.conductor.Conductor)[source]

Start up.

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'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add admin-specific command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>)[source]

Extract admin settings.

class aries_cloudagent.config.argparse.ArgumentGroup[source]

Bases: abc.ABC

A class representing a group of related command line arguments.

GROUP_NAME = None
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add arguments to the provided argument parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>) → dict[source]

Extract settings from the parsed arguments.

class aries_cloudagent.config.argparse.DebugGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Debug settings.

CATEGORIES = ('start',)
GROUP_NAME = 'Debug'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add debug command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>) → dict[source]

Extract debug settings.

class aries_cloudagent.config.argparse.GeneralGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

General settings.

CATEGORIES = ('general', 'start')
GROUP_NAME = 'General'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add general command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>) → dict[source]

Extract general settings.

class aries_cloudagent.config.argparse.LedgerGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Ledger settings.

CATEGORIES = ('start', 'general')
GROUP_NAME = 'Ledger'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add ledger-specific command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>) → dict[source]

Extract ledger settings.

class aries_cloudagent.config.argparse.LoggingGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Logging settings.

CATEGORIES = ('general', 'start')
GROUP_NAME = 'Logging'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add logging-specific command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>) → dict[source]

Extract logging settings.

class aries_cloudagent.config.argparse.MediationGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Mediation settings.

CATEGORIES = ('start',)
GROUP_NAME = 'Mediation'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add mediation command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>)[source]

Extract mediation settings.

class aries_cloudagent.config.argparse.MultitenantGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Multitenant settings.

CATEGORIES = ('start',)
GROUP_NAME = 'Multitenant'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add multitenant-specific command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>)[source]

Extract multitenant settings.

class aries_cloudagent.config.argparse.ProtocolGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Protocol settings.

CATEGORIES = ('start',)
GROUP_NAME = 'Protocol'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add protocol-specific command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>) → dict[source]

Get protocol settings.

class aries_cloudagent.config.argparse.StartupGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Startup settings.

CATEGORIES = ('start',)
GROUP_NAME = 'Start-up'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add startup-specific command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>)[source]

Extract startup settings.

class aries_cloudagent.config.argparse.TransportGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Transport settings.

CATEGORIES = ('start',)
GROUP_NAME = 'Transport'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add transport-specific command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>)[source]

Extract transport settings.

class aries_cloudagent.config.argparse.WalletGroup[source]

Bases: aries_cloudagent.config.argparse.ArgumentGroup

Wallet settings.

CATEGORIES = ('general', 'start')
GROUP_NAME = 'Wallet'
add_arguments(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>)[source]

Add wallet-specific command line arguments to the parser.

get_settings(args: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb056374450>) → dict[source]

Extract wallet settings.

aries_cloudagent.config.argparse.create_argument_parser(*, prog: str = None)[source]

Create am instance of an arg parser, force yaml format for external config.

class aries_cloudagent.config.argparse.group(*categories)[source]

Bases: object

Decorator for registering argument groups.

classmethod get_registered(category: str = None)[source]

Fetch the set of registered classes in a category.

aries_cloudagent.config.argparse.load_argument_groups(parser: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05646c610>, *groups)[source]

Log a set of argument groups into a parser.

Returns:A callable to convert loaded arguments into a settings dictionary
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[InjectType], settings: Mapping[str, object] = None, *, required: bool = True) → Optional[InjectType][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.BaseProvider[source]

Bases: abc.ABC

Base provider class.

provide(settings: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]

Provide the object instance given a config and injector.

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
get_str(*var_names, default=None) → str[source]

Fetch a setting as a string value.

Parameters:
  • var_names – A list of variable name alternatives
  • default – The default value to return if none are defined
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
Returns:

The setting value, if defined, otherwise the default value

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.InjectionError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.config.base.ConfigError

The base exception raised by Injector and Provider 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.

class aries_cloudagent.config.base_context.ContextBuilder(settings: Mapping[str, object] = None)[source]

Bases: abc.ABC

Base injection context builder class.

build_context() → aries_cloudagent.config.injection_context.InjectionContext[source]

Build the base injection context.

update_settings(settings: Mapping[str, object])[source]

Update the context builder with additional settings.

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.

build_context() → aries_cloudagent.config.injection_context.InjectionContext[source]

Build the base injection context; set DIDComm prefix to emit.

load_plugins(context: aries_cloudagent.config.injection_context.InjectionContext)[source]

Set up plugin registry and load plugins.

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[InjectType], settings: Mapping[str, object] = None, *, required: bool = True) → Optional[InjectType][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

update_settings(settings: Mapping[str, object])[source]

Update the scope with additional settings.

exception aries_cloudagent.config.injection_context.InjectionContextError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.config.base.InjectionError

Base class for issues in the injection context.

class aries_cloudagent.config.injection_context.Scope(name, injector)

Bases: tuple

injector

Alias for field number 1

name

Alias for field number 0

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_instance(base_cls: Type[InjectType], instance: InjectType)[source]

Add a static instance as a class binding.

bind_provider(base_cls: Type[InjectType], provider: aries_cloudagent.config.base.BaseProvider, *, cache: bool = False)[source]

Add a dynamic instance resolver as a class binding.

clear_binding(base_cls: Type[InjectType])[source]

Remove a previously-added binding.

copy() → aries_cloudagent.config.base.BaseInjector[source]

Produce a copy of the injector instance.

get_provider(base_cls: Type[InjectType])[source]

Find the provider associated with a class binding.

inject(base_cls: Type[InjectType], settings: Mapping[str, object] = None, *, required: bool = True) → Optional[InjectType][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.ledger.fetch_genesis_transactions(genesis_url: str) → str[source]

Get genesis transactions.

aries_cloudagent.config.ledger.get_genesis_transactions(settings: aries_cloudagent.config.settings.Settings) → str[source]

Fetch genesis transactions if necessary.

aries_cloudagent.config.ledger.ledger_config(profile: aries_cloudagent.core.profile.Profile, public_did: str, provision: bool = False) → bool[source]

Perform Indy ledger configuration.

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)
classmethod print_banner(agent_label, inbound_transports, outbound_transports, outbound_queue, public_did, admin_server=None, banner_length=40, border_character=':')[source]

Print a startup banner describing the configuration.

Parameters:
  • agent_label – Agent Label
  • inbound_transports – Configured inbound transports
  • outbound_transports – Configured outbound transports
  • outbound_queue – The outbound queue engine instance
  • 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
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, unique_settings_keys: tuple = ())[source]

Bases: aries_cloudagent.config.base.BaseProvider

Cache the result of another provider.

provide(config: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]

Provide the object instance given a config and injector.

Instances are cached keyed on a SHA256 digest of the relevant subset of settings.

class aries_cloudagent.config.provider.ClassProvider(instance_cls: Union[str, type], *ctor_args, init_method: str = None, **ctor_kwargs)[source]

Bases: aries_cloudagent.config.base.BaseProvider

Provider for a particular class.

class Inject(base_cls: type)[source]

Bases: object

A class for passing injected arguments to the constructor.

provide(config: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]

Provide the object instance given a config and injector.

class aries_cloudagent.config.provider.InstanceProvider(instance)[source]

Bases: aries_cloudagent.config.base.BaseProvider

Provider for a previously-created instance.

provide(config: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]

Provide the object instance given a config and injector.

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.

provide(config: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]

Provide the object instance given a config and injector.

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.

clear_value(var_name: str)[source]

Remove a setting.

Parameters:var_name – The name of the setting
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
set_default(var_name: str, value)[source]

Add a setting if not currently defined.

Parameters:
  • var_name – The name of the setting
  • value – The value to assign
set_value(var_name: str, value)[source]

Add a setting.

Parameters:
  • var_name – The name of the setting
  • value – The value to assign
update(other: Mapping[str, object])[source]

Update the settings in place.

aries_cloudagent.config.util module

Entrypoint.

class aries_cloudagent.config.util.BoundedInt(min: int = None, max: int = None)[source]

Bases: object

Argument value parser for a bounded integer.

class aries_cloudagent.config.util.ByteSize(min: int = 0, max: int = None)[source]

Bases: object

Argument value parser for byte sizes.

aries_cloudagent.config.util.common_config(settings: Mapping[str, Any])[source]

Perform common app configuration.

aries_cloudagent.config.wallet module

Wallet configuration.

aries_cloudagent.config.wallet.wallet_config(context: aries_cloudagent.config.injection_context.InjectionContext, provision: bool = False) → Tuple[aries_cloudagent.core.profile.Profile, aries_cloudagent.wallet.did_info.DIDInfo][source]

Initialize the root profile.

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() → dict[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

to_json() → str[source]

Dump current object as json (JSON-LD).

Returns:json representation of 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.

to_dict() → dict[source]

Return dict representation of public key to embed in DID document.

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.

get = <function PublicKeyType.get>[source]
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.

to_dict() → dict[source]

Return dict representation of service to embed in DID document.

type

Accessor for the service type.

Submodules
aries_cloudagent.connections.models.diddoc.diddoc module

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() → dict[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

to_json() → str[source]

Dump current object as json (JSON-LD).

Returns:json representation of current DIDDoc
aries_cloudagent.connections.models.diddoc.publickey module

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.

to_dict() → dict[source]

Return dict representation of public key to embed in DID document.

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.

get = <function PublicKeyType.get>[source]
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.

aries_cloudagent.connections.models.diddoc.service module

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.

to_dict() → dict[source]

Return dict representation of service to embed in DID document.

type

Accessor for the service type.

aries_cloudagent.connections.models.diddoc.util module

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.conn_record module

Handle connection information interface with non-secrets storage.

class aries_cloudagent.connections.models.conn_record.ConnRecord(*, connection_id: str = None, my_did: str = None, their_did: str = None, their_label: str = None, their_role: Union[str, ConnRecord.Role] = None, invitation_key: str = None, invitation_msg_id: str = None, request_id: str = None, state: Union[str, ConnRecord.State] = None, inbound_connection_id: str = None, error_msg: str = None, routing_state: str = None, accept: str = None, invitation_mode: str = None, alias: str = None, their_public_did: str = None, rfc23_state: str = None, initiator: str = None, connection_protocol: Union[str, ConnRecord.Protocol] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Represents a single pairwise connection.

ACCEPT_AUTO = 'auto'
ACCEPT_MANUAL = 'manual'
INVITATION_MODE_MULTI = 'multi'
INVITATION_MODE_ONCE = 'once'
INVITATION_MODE_STATIC = 'static'
LOG_STATE_FLAG = 'debug.connections'
class Meta[source]

Bases: object

ConnRecord metadata.

schema_class = 'ConnRecordSchema'
class Protocol[source]

Bases: enum.Enum

Supported Protocols for Connection.

RFC_0023 = 'didexchange/1.0'
RFC_0160 = 'connections/1.0'
aries_protocol

Return used connection protocol.

get = <bound method ConnRecord.Protocol.get of <enum 'Protocol'>>[source]
RECORD_ID_NAME = 'connection_id'
RECORD_TOPIC = 'connections'
RECORD_TYPE = 'connection'
RECORD_TYPE_INVITATION = 'connection_invitation'
RECORD_TYPE_METADATA = 'connection_metadata'
RECORD_TYPE_REQUEST = 'connection_request'
ROUTING_STATE_ACTIVE = 'active'
ROUTING_STATE_ERROR = 'error'
ROUTING_STATE_NONE = 'none'
ROUTING_STATE_REQUEST = 'request'
class Role[source]

Bases: enum.Enum

RFC 160 (inviter, invitee) = RFC 23 (responder, requester).

REQUESTER = ('invitee', 'requester')
RESPONDER = ('inviter', 'responder')
flip()[source]

Return opposite interlocutor role: theirs for ours, ours for theirs.

get = <bound method ConnRecord.Role.get of <enum 'Role'>>[source]
rfc160

Return RFC 160 (connection protocol) nomenclature.

rfc23

Return RFC 23 (DID exchange protocol) nomenclature.

class State[source]

Bases: enum.Enum

Collator for equivalent states between RFC 160 and RFC 23.

On the connection record, the state has to serve for both RFCs. Hence, internally, RFC23 requester/responder states collate to their RFC160 condensed equivalent.

ABANDONED = ('error', 'abandoned')
COMPLETED = ('active', 'completed')
INIT = ('init', 'start')
INVITATION = ('invitation', 'invitation')
REQUEST = ('request', 'request')
RESPONSE = ('response', 'response')
get = <bound method ConnRecord.State.get of <enum 'State'>>[source]
rfc160

Return RFC 160 (connection protocol) nomenclature.

rfc23

Return RFC 23 (DID exchange protocol) nomenclature to record logic.

rfc23strict(their_role: aries_cloudagent.connections.models.conn_record.ConnRecord.Role)[source]

Return RFC 23 (DID exchange protocol) nomenclature to role as per RFC.

TAG_NAMES = {'invitation_key', 'my_did', 'request_id', 'their_did'}
attach_invitation(session: aries_cloudagent.core.profile.ProfileSession, invitation: Union[aries_cloudagent.protocols.connections.v1_0.messages.connection_invitation.ConnectionInvitation, aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage])[source]

Persist the related connection invitation to storage.

Parameters:
  • session – The active profile session
  • invitation – The invitation to relate to this connection record
attach_request(session: aries_cloudagent.core.profile.ProfileSession, request: Union[aries_cloudagent.protocols.connections.v1_0.messages.connection_request.ConnectionRequest, aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest])[source]

Persist the related connection request to storage.

Parameters:
  • session – The active profile session
  • request – The request to relate to this connection record
connection_id

Accessor for the ID associated with this connection.

delete_record(session: aries_cloudagent.core.profile.ProfileSession)[source]

Perform connection record deletion actions.

Parameters:session (ProfileSession) – session
is_multiuse_invitation

Accessor for multi use invitation mode.

is_ready

Accessor for connection readiness.

metadata_delete(session: aries_cloudagent.core.profile.ProfileSession, key: str)[source]

Delete custom metadata associated with this connection.

Parameters:
  • session (ProfileSession) – session used for storage
  • key (str) – key of metadata to delete
metadata_get(session: aries_cloudagent.core.profile.ProfileSession, key: str, default: Any = None) → Any[source]

Retrieve arbitrary metadata associated with this connection.

Parameters:
  • session (ProfileSession) – session used for storage
  • key (str) – key identifying metadata
  • default (Any) – default value to get; type should be a JSON compatible value.
Returns:

metadata stored by key

Return type:

Any

metadata_get_all(session: aries_cloudagent.core.profile.ProfileSession) → dict[source]

Return all custom metadata associated with this connection.

Parameters:session (ProfileSession) – session used for storage
Returns:dictionary representation of all metadata values
Return type:dict
metadata_set(session: aries_cloudagent.core.profile.ProfileSession, key: str, value: Any)[source]

Set arbitrary metadata associated with this connection.

Parameters:
  • session (ProfileSession) – session used for storage
  • key (str) – key identifying metadata
  • value (Any) – value to set
post_save(session: aries_cloudagent.core.profile.ProfileSession, *args, **kwargs)[source]

Perform post-save actions.

Parameters:session – The active profile session
record_value

Accessor to for the JSON record value properties for this connection.

classmethod retrieve_by_did(session: aries_cloudagent.core.profile.ProfileSession, their_did: str = None, my_did: str = None, their_role: str = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Retrieve a connection record by target DID.

Parameters:
  • session – The active profile session
  • their_did – The target DID to filter by
  • my_did – One of our DIDs to filter by
  • my_role – Filter connections by their role
classmethod retrieve_by_invitation_key(session: aries_cloudagent.core.profile.ProfileSession, invitation_key: str, their_role: str = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Retrieve a connection record by invitation key.

Parameters:
  • session – The active profile session
  • invitation_key – The key on the originating invitation
  • initiator – Filter by the initiator value
classmethod retrieve_by_request_id(session: aries_cloudagent.core.profile.ProfileSession, request_id: str) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Retrieve a connection record from our previous request ID.

Parameters:
  • session – The active profile session
  • request_id – The ID of the originating connection request
retrieve_invitation(session: aries_cloudagent.core.profile.ProfileSession) → Union[aries_cloudagent.protocols.connections.v1_0.messages.connection_invitation.ConnectionInvitation, aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage][source]

Retrieve the related connection invitation.

Parameters:session – The active profile session
retrieve_request(session: aries_cloudagent.core.profile.ProfileSession) → Union[aries_cloudagent.protocols.connections.v1_0.messages.connection_request.ConnectionRequest, aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest][source]

Retrieve the related connection invitation.

Parameters:session – The active profile session
rfc23_state

RFC23 state per RFC text, potentially particular to role.

class aries_cloudagent.connections.models.conn_record.ConnRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

Schema to allow serialization/deserialization of connection records.

class Meta[source]

Bases: object

ConnRecordSchema metadata.

model_class

alias of ConnRecord

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.'})>
connection_protocol = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['c', 'o', 'n', 'n', 'e', 'c', 't', 'i', 'o', 'n', 's', '/', '1', '.', '0', 'd', 'i', 'd', 'e', 'x', 'c', 'h', 'a', 'n', 'g', 'e', '/', '1', '.', '0'], 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.'})>
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.'})>
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.'})>
invitation_msg_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.'})>
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.'})>
rfc23_state = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=True, 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=<OneOf(choices=['none', 'request', 'active', 'error'], 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.'})>
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_public_did = <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=<OneOf(choices=['invitee', 'requester', 'inviter', 'responder'], 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.'})>
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 Meta[source]

Bases: object

ConnectionTarget metadata.

schema_class = 'ConnectionTargetSchema'
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

unknown

Used by autodoc_mock_imports.

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.

Submodules
aries_cloudagent.connections.base_manager module

Class to provide some common utilities.

For Connection, DIDExchange and OutOfBand Manager.

class aries_cloudagent.connections.base_manager.BaseConnectionManager(session: aries_cloudagent.core.profile.ProfileSession)[source]

Bases: object

Class to provide utilities regarding connection_targets.

RECORD_TYPE_DID_DOC = 'did_doc'
RECORD_TYPE_DID_KEY = 'did_key'
SUPPORTED_KEY_TYPES = (<class 'pydid.verification_method.Ed25519VerificationKey2018'>,)
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
create_did_document(did_info: aries_cloudagent.wallet.did_info.DIDInfo, inbound_connection_id: str = None, svc_endpoints: Sequence[str] = None, mediation_records: List[aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord] = None) → aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc[source]

Create our DID doc 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
  • mediation_record – The record for mediation that contains routing_keys and service endpoint
Returns:

The prepared DIDDoc 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
fetch_connection_targets(connection: aries_cloudagent.connections.models.conn_record.ConnRecord) → Sequence[aries_cloudagent.connections.models.connection_target.ConnectionTarget][source]

Get a list of connection targets from a ConnRecord.

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_did_for_key(key: str) → str[source]

Find the DID previously associated with a key.

Parameters:key – The verkey to look up
remove_keys_for_did(did: str)[source]

Remove all keys associated with a DID.

Parameters:did – The DID for which to remove keys
resolve_invitation(did: str)[source]

Resolve invitation with the DID Resolver.

Parameters:did – Document ID to resolve
store_did_document(did_doc: aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc)[source]

Store a DID document.

Parameters:did_doc – The DIDDoc instance to persist
exception aries_cloudagent.connections.base_manager.BaseConnectionManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

BaseConnectionManager error.

aries_cloudagent.connections.util module

Class for providing base utilities for Mediator support.

aries_cloudagent.connections.util.mediation_record_if_id(session: aries_cloudagent.core.profile.ProfileSession, mediation_id: str = None, or_default: bool = False)[source]

Validate mediation and return record.

If mediation_id is not None, validate mediation record state and return record else, return None

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.

context

Accessor for the injection context.

dispatch_complete(message: aries_cloudagent.transport.inbound.message.InboundMessage, completed: aries_cloudagent.utils.task_queue.CompletedTask)[source]

Handle completion of message dispatch.

get_stats() → dict[source]

Get the current stats tracked by the conductor.

handle_not_delivered(profile: aries_cloudagent.core.profile.Profile, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Handle a message that failed delivery via outbound transports.

handle_not_returned(profile: aries_cloudagent.core.profile.Profile, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]

Handle a message that failed delivery via an inbound session.

inbound_message_router(profile: aries_cloudagent.core.profile.Profile, message: aries_cloudagent.transport.inbound.message.InboundMessage, can_respond: bool = False)[source]

Route inbound messages.

Parameters:
  • context – The context associated with the inbound message
  • message – The inbound message instance
  • can_respond – If the session supports return routing
outbound_message_router(profile: aries_cloudagent.core.profile.Profile, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage, inbound: aries_cloudagent.transport.inbound.message.InboundMessage = None) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Route an outbound message.

Parameters:
  • profile – The active profile for the request
  • message – An outbound message to be sent
  • inbound – The inbound message that produced this response, if available
queue_outbound(profile: aries_cloudagent.core.profile.Profile, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage, inbound: aries_cloudagent.transport.inbound.message.InboundMessage = None) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Queue an outbound message for transport.

Parameters:
  • profile – The active profile
  • message – An outbound message to be sent
  • inbound – The inbound message that produced this response, if available
setup()[source]

Initialize the global request context.

start() → None[source]

Start the agent.

stop(timeout=1.0)[source]

Stop the agent.

webhook_router(topic: str, payload: dict, endpoint: str, max_attempts: int = None, metadata: dict = 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
  • metadata – Additional metadata associated with the payload
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(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Dispatcher class.

Class responsible for dispatching messages to message handlers and responding to other agents.

complete(timeout: float = 0.1)[source]

Wait for pending tasks to complete.

handle_message(profile: aries_cloudagent.core.profile.Profile, inbound_message: aries_cloudagent.transport.inbound.message.InboundMessage, send_outbound: Coroutine[T_co, T_contra, V_co])[source]

Configure responder and message context and invoke the message handler.

Parameters:
  • profile – The profile associated with the inbound message
  • inbound_message – The inbound message instance
  • send_outbound – Async function to send outbound messages
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.base_message.BaseMessage[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 @type
  • MessageParseError – 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(profile: aries_cloudagent.core.profile.Profile, inbound_message: aries_cloudagent.transport.inbound.message.InboundMessage, send_outbound: Coroutine[T_co, T_contra, V_co], complete: Callable = None) → aries_cloudagent.utils.task_queue.PendingTask[source]

Add a message to the processing queue for handling.

Parameters:
  • profile – The profile associated with the inbound message
  • inbound_message – The inbound message instance
  • send_outbound – Async function to send outbound messages
  • complete – Function to call when the handler has completed
Returns:

A pending task instance resolving to the handler task

run_task(coro: Coroutine[T_co, T_contra, V_co], complete: Callable = None, ident: str = None) → _asyncio.Task[source]

Run a task in the task queue, potentially blocking other handlers.

setup()[source]

Perform async instance setup.

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], **kwargs)[source]

Bases: aries_cloudagent.messaging.responder.BaseResponder

Handle outgoing messages from message handlers.

create_outbound(message: Union[aries_cloudagent.messaging.agent_message.AgentMessage, aries_cloudagent.messaging.base_message.BaseMessage, str, bytes], **kwargs) → aries_cloudagent.transport.outbound.message.OutboundMessage[source]

Create an OutboundMessage from a message body.

Parameters:message – The message payload
send_outbound(message: aries_cloudagent.transport.outbound.message.OutboundMessage) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Send outbound message.

Parameters:message – The OutboundMessage to be sent
send_webhook(topic: str, payload: dict)[source]

Dispatch a webhook. DEPRECATED: use the event bus instead.

Parameters:
  • topic – the webhook topic identifier
  • payload – the webhook payload value
exception aries_cloudagent.core.dispatcher.ProblemReportParseError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.error.MessageParseError

Error to raise on failure to parse problem-report message.

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.

message

Accessor for the error message.

roll_up

Accessor for nested error messages rolled into one line.

For display: aiohttp.web errors truncate after newline.

exception aries_cloudagent.core.error.ProfileDuplicateError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.ProfileError

Profile with the given name already exists.

exception aries_cloudagent.core.error.ProfileError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Base error for profile operations.

exception aries_cloudagent.core.error.ProfileNotFoundError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.ProfileError

Requested profile was not found.

exception aries_cloudagent.core.error.ProfileSessionInactiveError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.ProfileError

Error raised when a profile session is not currently active.

exception aries_cloudagent.core.error.ProtocolDefinitionValidationError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Error raised when there is a problem validating a protocol definition.

exception aries_cloudagent.core.error.ProtocolMinorVersionNotSupported(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Minimum minor version protocol error.

Error raised when protocol support exists but minimum minor version is higher than in @type parameter.

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.in_memory module

Manage in-memory profile interaction.

class aries_cloudagent.core.in_memory.InMemoryProfile(*, context: aries_cloudagent.config.injection_context.InjectionContext = None, name: str = None)[source]

Bases: aries_cloudagent.core.profile.Profile

Provide access to in-memory profile management.

Used primarily for testing.

BACKEND_NAME = 'in_memory'
TEST_PROFILE_NAME = 'test-profile'
bind_providers()[source]

Initialize the profile-level instance providers.

session(context: aries_cloudagent.config.injection_context.InjectionContext = None) → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with no transaction support requested.

classmethod test_profile(settings: Mapping[str, Any] = None, bind: Mapping[Type[CT_co], Any] = None) → aries_cloudagent.core.in_memory.InMemoryProfile[source]

Used in tests to create a standard InMemoryProfile.

classmethod test_session(settings: Mapping[str, Any] = None, bind: Mapping[Type[CT_co], Any] = None) → aries_cloudagent.core.in_memory.InMemoryProfileSession[source]

Used in tests to quickly create InMemoryProfileSession.

transaction(context: aries_cloudagent.config.injection_context.InjectionContext = None) → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with commit and rollback support.

If the current backend does not support transactions, then commit and rollback operations of the session will not have any effect.

class aries_cloudagent.core.in_memory.InMemoryProfileManager[source]

Bases: aries_cloudagent.core.profile.ProfileManager

Manager for producing in-memory wallet/storage implementation.

open(context: aries_cloudagent.config.injection_context.InjectionContext, config: Mapping[str, Any] = None) → aries_cloudagent.core.profile.Profile[source]

Open an instance of an existing profile.

provision(context: aries_cloudagent.config.injection_context.InjectionContext, config: Mapping[str, Any] = None) → aries_cloudagent.core.profile.Profile[source]

Provision a new instance of a profile.

class aries_cloudagent.core.in_memory.InMemoryProfileSession(profile: aries_cloudagent.core.profile.Profile, *, context: aries_cloudagent.config.injection_context.InjectionContext = None, settings: Mapping[str, Any] = None)[source]

Bases: aries_cloudagent.core.profile.ProfileSession

An active connection to the profile management backend.

storage

Get the BaseStorage implementation (helper specific to in-memory profile).

wallet

Get the BaseWallet implementation (helper specific to in-memory profile).

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_protocol_version(context: aries_cloudagent.config.injection_context.InjectionContext, mod: module, version_definition: dict = None)[source]

Load a particular protocol version.

load_protocols(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.

post_process_routes(app)[source]

Call route binary file response OpenAPI fixups if applicable.

register_admin_routes(app)[source]

Call route registration methods on the current context.

register_package(package_name: str) → Sequence[module][source]

Register all modules (sub-packages) under a given package name.

register_plugin(module_name: str) → module[source]

Register a plugin module.

validate_version(version_list, module_name)[source]

Validate version dict format.

aries_cloudagent.core.profile module

Classes for managing profile information within a request context.

class aries_cloudagent.core.profile.Profile(*, context: aries_cloudagent.config.injection_context.InjectionContext = None, name: str = None, created: bool = False)[source]

Bases: abc.ABC

Base abstraction for handling identity-related state.

BACKEND_NAME = None
DEFAULT_NAME = 'default'
backend

Accessor for the backend implementation name.

close()[source]

Close the profile instance.

context

Accessor for the injection context.

created

Accessor for the created flag indicating a new profile.

inject(base_cls: Type[InjectType], settings: Mapping[str, object] = None, *, required: bool = True) → Optional[InjectType][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

name

Accessor for the profile name.

notify(topic: str, payload: Any)[source]

Signal an event.

remove()[source]

Remove the profile.

session(context: aries_cloudagent.config.injection_context.InjectionContext = None) → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with no transaction support requested.

settings

Accessor for scope-specific settings.

transaction(context: aries_cloudagent.config.injection_context.InjectionContext = None) → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with commit and rollback support.

If the current backend does not support transactions, then commit and rollback operations of the session will not have any effect.

class aries_cloudagent.core.profile.ProfileManager[source]

Bases: abc.ABC

Handle provision and open for profile instances.

open(context: aries_cloudagent.config.injection_context.InjectionContext, config: Mapping[str, Any] = None) → aries_cloudagent.core.profile.Profile[source]

Open an instance of an existing profile.

provision(context: aries_cloudagent.config.injection_context.InjectionContext, config: Mapping[str, Any] = None) → aries_cloudagent.core.profile.Profile[source]

Provision a new instance of a profile.

class aries_cloudagent.core.profile.ProfileManagerProvider[source]

Bases: aries_cloudagent.config.base.BaseProvider

The standard profile manager provider which keys off the selected wallet type.

MANAGER_TYPES = {'askar': 'aries_cloudagent.askar.profile.AskarProfileManager', 'in_memory': 'aries_cloudagent.core.in_memory.InMemoryProfileManager', 'indy': 'aries_cloudagent.indy.sdk.profile.IndySdkProfileManager'}
provide(settings: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]

Create the profile manager instance.

class aries_cloudagent.core.profile.ProfileSession(profile: aries_cloudagent.core.profile.Profile, *, context: aries_cloudagent.config.injection_context.InjectionContext = None, settings: Mapping[str, Any] = None)[source]

Bases: abc.ABC

An active connection to the profile management backend.

active

Accessor for the session active state.

commit()[source]

Commit any updates performed within the transaction.

If the current session is not a transaction, then nothing is performed.

context

Accessor for the associated injection context.

inject(base_cls: Type[InjectType], settings: Mapping[str, object] = None, *, required: bool = True) → Optional[InjectType][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

is_transaction

Check if the session supports commit and rollback operations.

profile

Accessor for the associated profile instance.

rollback()[source]

Roll back any updates performed within the transaction.

If the current session is not a transaction, then nothing is performed.

settings

Accessor for scope-specific settings.

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.

parse_type_string(message_type)[source]

Parse message type string and return dict with info.

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, version_definition=None)[source]

Add new controllers.

Parameters:controller_sets – Mappings of message families to coroutines
register_message_types(*typesets, version_definition=None)[source]

Add new supported message types.

Parameters:
  • typesets – Mappings of message types to register
  • version_definition – Optional version definition dict
resolve_message_class(message_type: str) → type[source]

Resolve a message_type to a message class.

Given a message type identifier, this method returns the corresponding registered message class.

Parameters:message_type – Message type to resolve
Returns:The resolved message class
aries_cloudagent.holder package
Submodules
aries_cloudagent.holder.routes module

Holder admin routes.

class aries_cloudagent.holder.routes.AttributeMimeTypesResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for credential attribute MIME type.

results = <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.'})>
class aries_cloudagent.holder.routes.CredInfoListSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for credential query.

results = <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 aries_cloudagent.holder.routes.CredRevokedQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request seeking cred revocation status.

fro = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.NumericStrWhole 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.'})>
to = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.NumericStrWhole 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 aries_cloudagent.holder.routes.CredRevokedResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for credential revoked request.

revoked = <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.'})>
class aries_cloudagent.holder.routes.CredentialsListQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for query string in credentials list query.

count = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.NumericStrNatural 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.'})>
start = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.NumericStrWhole 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.'})>
wql = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyWQL 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 aries_cloudagent.holder.routes.HolderCredIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking credential id.

credential_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.'})>
class aries_cloudagent.holder.routes.HolderModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Holder Module.

class aries_cloudagent.holder.routes.VCRecordListSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for W3C credential query.

results = <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 aries_cloudagent.holder.routes.W3CCredentialsListRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for W3C credentials request.

contexts = <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.'})>
given_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.'})>
issuer_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.'})>
max_results = <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.'})>
proof_types = <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.'})>
schema_ids = <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.'})>
subject_ids = <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.'})>
tag_query = <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.'})>
types = <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.'})>
aries_cloudagent.holder.routes.credentials_attr_mime_types_get(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Request handler for getting credential attribute MIME types.

Parameters:request – aiohttp request object
Returns:The MIME types response
aries_cloudagent.holder.routes.credentials_get(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Request handler for retrieving credential.

Parameters:request – aiohttp request object
Returns:The credential info
aries_cloudagent.holder.routes.credentials_list(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Request handler for searching credential records.

Parameters:request – aiohttp request object
Returns:The credential info list response
aries_cloudagent.holder.routes.credentials_remove(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Request handler for searching connection records.

Parameters:request – aiohttp request object
Returns:Empty production
aries_cloudagent.holder.routes.credentials_revoked(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Request handler for querying revocation status of credential.

Parameters:request – aiohttp request object
Returns:Empty production
aries_cloudagent.holder.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Amend swagger API.

aries_cloudagent.holder.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Register routes.

aries_cloudagent.holder.routes.w3c_cred_get(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Request handler for retrieving W3C credential.

Parameters:request – aiohttp request object
Returns:Verifiable credential record
aries_cloudagent.holder.routes.w3c_cred_remove(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Request handler for deleting W3C credential.

Parameters:request – aiohttp request object
Returns:Empty production
aries_cloudagent.holder.routes.w3c_creds_list(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa8050>)[source]

Request handler for searching W3C credential records.

Parameters:request – aiohttp request object
Returns:The credential record list response
aries_cloudagent.indy package
Subpackages
aries_cloudagent.indy.sdk package
Submodules
aries_cloudagent.indy.sdk.error module

Indy error handling.

class aries_cloudagent.indy.sdk.error.IndyErrorHandler(message: str = None, error_cls: Type[aries_cloudagent.core.error.BaseError] = <class 'aries_cloudagent.core.error.BaseError'>)[source]

Bases: object

Trap IndyError and raise an appropriate LedgerError instead.

classmethod wrap_error(err_value: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054d58d90>, message: str = None, error_cls: Type[aries_cloudagent.core.error.BaseError] = <class 'aries_cloudagent.core.error.BaseError'>) → aries_cloudagent.core.error.BaseError[source]

Create an instance of BaseError from an IndyError.

aries_cloudagent.indy.sdk.holder module

Indy SDK holder implementation.

class aries_cloudagent.indy.sdk.holder.IndySdkHolder(wallet: aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet)[source]

Bases: aries_cloudagent.indy.holder.IndyHolder

Indy-SDK holder implementation.

create_credential_request(credential_offer: dict, credential_definition: dict, holder_did: str) → Tuple[str, str][source]

Create a credential request for the given credential offer.

Parameters:
  • credential_offer – The credential offer to create request for
  • credential_definition – The credential definition to create an offer for
  • holder_did – the DID of the agent making the request
Returns:

A tuple of the credential request and credential request metadata

create_presentation(presentation_request: dict, requested_credentials: dict, schemas: dict, credential_definitions: dict, rev_states: dict = None) → str[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 credential definitions JSON
  • rev_states – Indy format revocation states JSON
create_revocation_state(cred_rev_id: str, rev_reg_def: dict, rev_reg_delta: dict, timestamp: int, tails_file_path: str) → str[source]

Create current revocation state for a received credential.

Parameters:
  • cred_rev_id – credential revocation id in revocation registry
  • rev_reg_def – revocation registry definition
  • rev_reg_delta – revocation delta
  • timestamp – delta timestamp
Returns:

the revocation state

credential_revoked(ledger: aries_cloudagent.ledger.base.BaseLedger, credential_id: str, fro: int = None, to: int = None) → bool[source]

Check ledger for revocation status of credential by cred id.

Parameters:credential_id – Credential id to check
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) → 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: dict, credential_data: dict, credential_request_metadata: dict, credential_attr_mime_types=None, credential_id: str = None, rev_reg_def: dict = None) → str[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
  • credential_id – optionally override the stored credential id
  • rev_reg_def – revocation registry definition in json
Returns:

the ID of the stored credential

aries_cloudagent.indy.sdk.issuer module

Indy SDK issuer implementation.

class aries_cloudagent.indy.sdk.issuer.IndySdkIssuer(profile: aries_cloudagent.indy.sdk.profile.IndySdkProfile)[source]

Bases: aries_cloudagent.indy.issuer.IndyIssuer

Indy-SDK issuer implementation.

create_and_store_credential_definition(origin_did: str, schema: dict, signature_type: str = None, tag: str = None, support_revocation: bool = False) → Tuple[str, str][source]

Create a new credential definition and store it in the wallet.

Parameters:
  • origin_did – the DID issuing the credential definition
  • schema – the schema used as a basis
  • signature_type – the credential definition signature type (default ‘CL’)
  • tag – the credential definition tag
  • support_revocation – whether to enable revocation for this credential def
Returns:

A tuple of the credential definition ID and JSON

create_and_store_revocation_registry(origin_did: str, cred_def_id: str, revoc_def_type: str, tag: str, max_cred_num: int, tails_base_path: str) → Tuple[str, str, str][source]

Create a new revocation registry and store it in the wallet.

Parameters:
  • origin_did – the DID issuing the revocation registry
  • cred_def_id – the identifier of the related credential definition
  • revoc_def_type – the revocation registry type (default CL_ACCUM)
  • tag – the unique revocation registry tag
  • max_cred_num – the number of credentials supported in the registry
  • tails_base_path – where to store the tails file
Returns:

A tuple of the revocation registry ID, JSON, and entry JSON

create_credential(schema: dict, credential_offer: dict, credential_request: dict, credential_values: dict, cred_ex_id: str, rev_reg_id: str = None, tails_file_path: str = None) → Tuple[str, str][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 cred_ex_id: credential exchange identifier to use in issuer cred rev rec rev_reg_id: ID of the revocation registry tails_file_path: Path to the local tails file
Returns:A tuple of created credential and revocation id
create_credential_offer(credential_definition_id: str) → str[source]

Create a credential offer for the given credential definition id.

Parameters:credential_definition_id – The credential definition to create an offer for
Returns:The created credential offer
create_schema(origin_did: str, schema_name: str, schema_version: str, attribute_names: Sequence[str]) → Tuple[str, str][source]

Create a new credential schema.

Parameters:
  • origin_did – the DID issuing the credential definition
  • schema_name – the schema name
  • schema_version – the schema version
  • attribute_names – a sequence of schema attribute names
Returns:

A tuple of the schema ID and JSON

credential_definition_in_wallet(credential_definition_id: str) → bool[source]

Check whether a given credential definition ID is present in the wallet.

Parameters:credential_definition_id – The credential definition ID to check
merge_revocation_registry_deltas(fro_delta: str, to_delta: str) → str[source]

Merge revocation registry deltas.

Parameters:
  • fro_delta – original delta in JSON format
  • to_delta – incoming delta in JSON format
Returns:

Merged delta in JSON format

revoke_credentials(rev_reg_id: str, tails_file_path: str, cred_rev_ids: Sequence[str]) -> (<class 'str'>, typing.Sequence[str])[source]

Revoke a set of credentials in a revocation registry.

Parameters:
  • rev_reg_id – ID of the revocation registry
  • tails_file_path – path to the local tails file
  • cred_rev_ids – sequences of credential indexes in the revocation registry
Returns:

Tuple with the combined revocation delta, list of cred rev ids not revoked

aries_cloudagent.indy.sdk.profile module

Manage Indy-SDK profile interaction.

class aries_cloudagent.indy.sdk.profile.IndySdkProfile(opened: aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet, context: aries_cloudagent.config.injection_context.InjectionContext = None)[source]

Bases: aries_cloudagent.core.profile.Profile

Provide access to Indy profile interaction methods.

BACKEND_NAME = 'indy'
bind_providers()[source]

Initialize the profile-level instance providers.

close()[source]

Close the profile instance.

init_ledger_pool()[source]

Initialize the ledger pool.

name

Accessor for the profile name.

remove()[source]

Remove the profile associated with this instance.

session(context: aries_cloudagent.config.injection_context.InjectionContext = None) → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with no transaction support requested.

transaction(context: aries_cloudagent.config.injection_context.InjectionContext = None) → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with commit and rollback support.

If the current backend does not support transactions, then commit and rollback operations of the session will not have any effect.

wallet

Accessor for the opened wallet instance.

class aries_cloudagent.indy.sdk.profile.IndySdkProfileManager[source]

Bases: aries_cloudagent.core.profile.ProfileManager

Manager for Indy-SDK wallets.

open(context: aries_cloudagent.config.injection_context.InjectionContext, config: Mapping[str, Any] = None) → aries_cloudagent.core.profile.Profile[source]

Open an instance of an existing profile.

provision(context: aries_cloudagent.config.injection_context.InjectionContext, config: Mapping[str, Any] = None) → aries_cloudagent.core.profile.Profile[source]

Provision a new instance of a profile.

class aries_cloudagent.indy.sdk.profile.IndySdkProfileSession(profile: aries_cloudagent.core.profile.Profile, *, context: aries_cloudagent.config.injection_context.InjectionContext = None, settings: Mapping[str, Any] = None)[source]

Bases: aries_cloudagent.core.profile.ProfileSession

An active connection to the profile management backend.

aries_cloudagent.indy.sdk.util module

Indy utilities.

aries_cloudagent.indy.sdk.util.create_tails_reader(tails_file_path: str) → int[source]

Get a handle for the blob_storage file reader.

aries_cloudagent.indy.sdk.util.create_tails_writer(tails_base_dir: str) → int[source]

Get a handle for the blob_storage file writer.

aries_cloudagent.indy.sdk.verifier module

Indy SDK verifier implementation.

class aries_cloudagent.indy.sdk.verifier.IndySdkVerifier(ledger: aries_cloudagent.ledger.indy.IndySdkLedger)[source]

Bases: aries_cloudagent.indy.verifier.IndyVerifier

Indy-SDK verifier implementation.

verify_presentation(pres_req, pres, schemas, credential_definitions, rev_reg_defs, rev_reg_entries) → bool[source]

Verify a presentation.

Parameters:
  • pres_req – Presentation request data
  • pres – Presentation data
  • schemas – Schema data
  • credential_definitions – credential definition data
  • rev_reg_defs – revocation registry definitions
  • rev_reg_entries – revocation registry entries
aries_cloudagent.indy.sdk.wallet_plugin module

Utility for loading Postgres wallet plug-in.

aries_cloudagent.indy.sdk.wallet_plugin.file_ext()[source]

Determine file extension based on platform.

aries_cloudagent.indy.sdk.wallet_plugin.load_postgres_plugin(storage_config, storage_creds, raise_exc=False)[source]

Load postgres dll and configure postgres wallet.

aries_cloudagent.indy.sdk.wallet_setup module

Indy-SDK wallet setup and configuration.

class aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet(config: aries_cloudagent.indy.sdk.wallet_setup.IndyWalletConfig, created, handle, master_secret_id: str)[source]

Bases: object

Handle and metadata for an opened Indy wallet.

close()[source]

Close previously-opened wallet, removing it if so configured.

name

Accessor for the opened wallet name.

class aries_cloudagent.indy.sdk.wallet_setup.IndyWalletConfig(config: Mapping[str, Any] = None)[source]

Bases: object

A helper class for handling Indy-SDK wallet configuration.

DEFAULT_FRESHNESS = False
DEFAULT_KEY = ''
DEFAULT_KEY_DERIVATION = 'ARGON2I_MOD'
DEFAULT_STORAGE_TYPE = None
KEY_DERIVATION_ARGON2I_INT = 'ARGON2I_INT'
KEY_DERIVATION_ARGON2I_MOD = 'ARGON2I_MOD'
KEY_DERIVATION_RAW = 'RAW'
create_wallet() → aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet[source]

Create a new wallet.

Raises:
  • ProfileDuplicateError – If there was an existing wallet with the same name
  • ProfileError – If there was a problem removing the wallet
  • ProfileError – If there was another libindy error
open_wallet(created: bool = False) → aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet[source]

Open wallet, removing and/or creating it if so configured.

Raises:
  • ProfileError – If wallet not found after creation
  • ProfileNotFoundError – If the wallet is not found
  • ProfileError – If the wallet is already open
  • ProfileError – If there is another libindy error
remove_wallet()[source]

Remove an existing wallet.

Raises:
  • ProfileNotFoundError – If the wallet could not be found
  • ProfileError – If there was another libindy error
wallet_access

Accessor the Indy wallet access info.

wallet_config

Accessor for the Indy wallet config.

Submodules
aries_cloudagent.indy.holder module

Base Indy Holder class.

class aries_cloudagent.indy.holder.IndyHolder[source]

Bases: abc.ABC

Base class for holder.

CHUNK = 256
RECORD_TYPE_MIME_TYPES = 'attribute-mime-types'
create_credential_request(credential_offer: dict, credential_definition: dict, holder_did: str) → Tuple[str, str][source]

Create a credential request for the given credential offer.

Parameters:
  • credential_offer – The credential offer to create request for
  • credential_definition – The credential definition to create an offer for
  • holder_did – the DID of the agent making the request
Returns:

A tuple of the credential request and credential request metadata

create_presentation(presentation_request: dict, requested_credentials: dict, schemas: dict, credential_definitions: dict, rev_states: dict = None) → str[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 credential definitions JSON
  • rev_states – Indy format revocation states JSON
create_revocation_state(cred_rev_id: str, rev_reg_def: dict, rev_reg_delta: dict, timestamp: int, tails_file_path: str) → str[source]

Create current revocation state for a received credential.

Parameters:
  • cred_rev_id – credential revocation id in revocation registry
  • rev_reg_def – revocation registry definition
  • rev_reg_delta – revocation delta
  • timestamp – delta timestamp
Returns:

the revocation state

credential_revoked(ledger: aries_cloudagent.ledger.base.BaseLedger, credential_id: str, fro: int = None, to: int = None) → bool[source]

Check ledger for revocation status of credential by cred id.

Parameters:credential_id – Credential id to check
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) → str[source]

Get a credential stored in the wallet.

Parameters:credential_id – Credential id to retrieve
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: dict, credential_data: dict, credential_request_metadata: dict, credential_attr_mime_types=None, credential_id: str = None, rev_reg_def: dict = 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
  • credential_id – optionally override the stored credential id
  • rev_reg_def – revocation registry definition in json
Returns:

the ID of the stored credential

exception aries_cloudagent.indy.holder.IndyHolderError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Base class for holder exceptions.

aries_cloudagent.indy.issuer module

Base Indy Issuer class.

class aries_cloudagent.indy.issuer.IndyIssuer[source]

Bases: abc.ABC

Base class for Indy Issuer.

create_and_store_credential_definition(origin_did: str, schema: dict, signature_type: str = None, tag: str = None, support_revocation: bool = False) → Tuple[str, str][source]

Create a new credential definition and store it in the wallet.

Parameters:
  • origin_did – the DID issuing the credential definition
  • schema_json – the schema used as a basis
  • signature_type – the credential definition signature type (default ‘CL’)
  • tag – the credential definition tag
  • support_revocation – whether to enable revocation for this credential def
Returns:

A tuple of the credential definition ID and JSON

create_and_store_revocation_registry(origin_did: str, cred_def_id: str, revoc_def_type: str, tag: str, max_cred_num: int, tails_base_path: str) → Tuple[str, str, str][source]

Create a new revocation registry and store it in the wallet.

Parameters:
  • origin_did – the DID issuing the revocation registry
  • cred_def_id – the identifier of the related credential definition
  • revoc_def_type – the revocation registry type (default CL_ACCUM)
  • tag – the unique revocation registry tag
  • max_cred_num – the number of credentials supported in the registry
  • tails_base_path – where to store the tails file
Returns:

A tuple of the revocation registry ID, JSON, and entry JSON

create_credential(schema: dict, credential_offer: dict, credential_request: dict, credential_values: dict, cred_ex_id: str, revoc_reg_id: str = None, tails_file_path: str = None) → Tuple[str, str][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 cred_ex_id: credential exchange identifier to use in issuer cred rev rec revoc_reg_id: ID of the revocation registry tails_file_path: The location of the tails file
Returns:A tuple of created credential and revocation id
create_credential_offer(credential_definition_id) → str[source]

Create a credential offer for the given credential definition id.

Parameters:credential_definition_id – The credential definition to create an offer for
Returns:The created credential offer
create_schema(origin_did: str, schema_name: str, schema_version: str, attribute_names: Sequence[str]) → Tuple[str, str][source]

Create a new credential schema and store it in the wallet.

Parameters:
  • origin_did – the DID issuing the credential definition
  • schema_name – the schema name
  • schema_version – the schema version
  • attribute_names – a sequence of schema attribute names
Returns:

A tuple of the schema ID and JSON

credential_definition_in_wallet(credential_definition_id: str) → bool[source]

Check whether a given credential definition ID is present in the wallet.

Parameters:credential_definition_id – The credential definition ID to check
make_credential_definition_id(origin_did: str, schema: dict, signature_type: str = None, tag: str = None) → str[source]

Derive the ID for a credential definition.

make_schema_id(origin_did: str, schema_name: str, schema_version: str) → str[source]

Derive the ID for a schema.

merge_revocation_registry_deltas(fro_delta: str, to_delta: str) → str[source]

Merge revocation registry deltas.

Parameters:
  • fro_delta – original delta in JSON format
  • to_delta – incoming delta in JSON format
Returns:

Merged delta in JSON format

revoke_credentials(revoc_reg_id: str, tails_file_path: str, cred_rev_ids: Sequence[str]) -> (<class 'str'>, typing.Sequence[str])[source]

Revoke a set of credentials in a revocation registry.

Parameters:
  • revoc_reg_id – ID of the revocation registry
  • tails_file_path – path to the local tails file
  • cred_rev_ids – sequences of credential indexes in the revocation registry
Returns:

Tuple with the combined revocation delta, list of cred rev ids not revoked

exception aries_cloudagent.indy.issuer.IndyIssuerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Generic issuer error.

exception aries_cloudagent.indy.issuer.IndyIssuerRevocationRegistryFullError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.indy.issuer.IndyIssuerError

Revocation registry is full when issuing a new credential.

aries_cloudagent.indy.util module

Utilities for dealing with Indy conventions.

aries_cloudagent.indy.util.generate_pr_nonce() → str[source]

Generate a nonce for a proof request.

aries_cloudagent.indy.util.indy_client_dir(subpath: str = None, create: bool = False) → str[source]

Return ‘/’-terminated subdirectory of indy-client directory.

Parameters:
  • subpath – subpath within indy-client structure
  • create – whether to create subdirectory if absent
aries_cloudagent.indy.util.tails_path(rev_reg_id: str) → str[source]

Return path to indy tails file for input rev reg id.

aries_cloudagent.indy.verifier module

Base Indy Verifier class.

class aries_cloudagent.indy.verifier.IndyVerifier[source]

Bases: abc.ABC

Base class for Indy Verifier.

check_timestamps(ledger: aries_cloudagent.ledger.base.BaseLedger, pres_req: Mapping[KT, VT_co], pres: Mapping[KT, VT_co], rev_reg_defs: Mapping[KT, VT_co])[source]

Check for suspicious, missing, and superfluous timestamps.

Raises ValueError on timestamp in the future, prior to rev reg creation, superfluous or missing.

Parameters:
  • ledger – the base ledger for retrieving revocation registry definitions
  • pres_req – indy proof request
  • pres – indy proof request
  • rev_reg_defs – rev reg defs by rev reg id, augmented with transaction times
non_revoc_intervals(pres_req: dict, pres: dict)[source]

Remove superfluous non-revocation intervals in presentation request.

Irrevocable credentials constitute proof of non-revocation, but indy rejects proof requests with non-revocation intervals lining up with non-revocable credentials in proof: seek and remove.

Parameters:
  • pres_req – presentation request
  • pres – corresponding presentation
pre_verify(pres_req: dict, pres: dict)[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
verify_presentation(presentation_request, presentation, schemas, credential_definitions, rev_reg_defs, rev_reg_entries)[source]

Verify a presentation.

Parameters:
  • presentation_request – Presentation request data
  • presentation – Presentation data
  • schemas – Schema data
  • credential_definitions – credential definition data
  • rev_reg_defs – revocation registry definitions
  • rev_reg_entries – revocation registry entries
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.

BACKEND_NAME = None
accept_txn_author_agreement(taa_record: dict, mechanism: str, accept_time: int = None)[source]

Save a new record recording the acceptance of the TAA.

backend

Accessor for the ledger backend name.

create_and_send_credential_definition(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_id: str, signature_type: str = None, tag: str = None, support_revocation: bool = False, write_ledger: bool = True, endorser_did: str = None) → Tuple[str, dict, bool][source]

Send credential definition to ledger and store relevant key matter in wallet.

Parameters:
  • issuer – The issuer instance to use for credential definition creation
  • schema_id – The schema id of the schema to create cred def for
  • signature_type – The signature type to use on the credential definition
  • tag – Optional tag to distinguish multiple credential definitions
  • support_revocation – Optional flag to enable revocation for this cred def
Returns:

Tuple with cred def id, cred def structure, and whether it’s novel

create_and_send_schema(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_name: str, schema_version: str, attribute_names: Sequence[str], write_ledger: bool = True, endorser_did: str = None) → Tuple[str, dict][source]

Send schema to ledger.

Parameters:
  • issuer – The issuer instance to use for schema creation
  • schema_name – The schema name
  • schema_version – The schema version
  • attribute_names – A list of schema attributes
did_to_nym(did: str) → str[source]

Remove the ledger’s DID prefix to produce a nym.

fetch_txn_author_agreement()[source]

Fetch the current AML and TAA from the ledger.

get_all_endpoints_for_did(did: str) → dict[source]

Fetch all endpoints for a ledger DID.

Parameters:did – The DID to look up on the ledger or in the cache
get_credential_definition(credential_definition_id: str) → dict[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, endpoint_type: aries_cloudagent.ledger.endpoint_type.EndpointType = <EndpointType.ENDPOINT: EndpointTypeName(w3c='Endpoint', indy='endpoint')>) → str[source]

Fetch the endpoint for a ledger DID.

Parameters:
  • did – The DID to look up on the ledger or in the cache
  • endpoint_type – The type of the endpoint (default ‘endpoint’)
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
get_latest_txn_author_acceptance()[source]

Look up the latest TAA acceptance.

get_nym_role(did: str)[source]

Return the role registered to input public DID on the ledger.

Parameters:did – DID to register on the ledger.
get_revoc_reg_def(revoc_reg_id: str) → dict[source]

Look up a revocation registry definition by ID.

get_revoc_reg_delta(revoc_reg_id: str, timestamp_from=0, timestamp_to=None) → Tuple[dict, int][source]

Look up a revocation registry delta by ID.

get_revoc_reg_entry(revoc_reg_id: str, timestamp: int) → Tuple[dict, int][source]

Get revocation registry entry by revocation registry ID and timestamp.

get_schema(schema_id: str) → dict[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_txn_author_agreement(reload: bool = False)[source]

Get the current transaction author agreement, fetching it if necessary.

nym_to_did(nym: str) → str[source]

Format a nym with the ledger’s DID prefix.

read_only

Accessor for the ledger read-only flag.

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.
rotate_public_did_keypair(next_seed: str = None) → None[source]

Rotate keypair for public DID: create new key, submit to ledger, update wallet.

Parameters:next_seed – seed for incoming ed25519 keypair (default random)
send_revoc_reg_def(revoc_reg_def: dict, issuer_did: str = None, write_ledger: bool = True, endorser_did: str = None)[source]

Publish a revocation registry definition to the ledger.

send_revoc_reg_entry(revoc_reg_id: str, revoc_def_type: str, revoc_reg_entry: dict, issuer_did: str = None, write_ledger: bool = True, endorser_did: str = None)[source]

Publish a revocation registry entry to the ledger.

taa_digest(version: str, text: str)[source]

Generate the digest of a TAA record.

txn_endorse(request_json: str) → str[source]

Endorse (sign) the provided transaction.

txn_submit(request_json: str, sign: bool, taa_accept: bool, sign_did: aries_cloudagent.wallet.did_info.DIDInfo = <object object>) → str[source]

Write the provided (signed and possibly endorsed) transaction to the ledger.

update_endpoint_for_did(did: str, endpoint: str, endpoint_type: aries_cloudagent.ledger.endpoint_type.EndpointType = <EndpointType.ENDPOINT: EndpointTypeName(w3c='Endpoint', indy='endpoint')>) → bool[source]

Check and update the endpoint on the ledger.

Parameters:
  • did – The ledger DID
  • endpoint – The endpoint address
  • endpoint_type – The type of the endpoint (default ‘endpoint’)
class aries_cloudagent.ledger.base.Role[source]

Bases: enum.Enum

Enum for indy roles.

ENDORSER = (101,)
NETWORK_MONITOR = (201,)
ROLE_REMOVE = ('',)
STEWARD = (2,)
TRUSTEE = (0,)
USER = (None, '')
get = <function Role.get>[source]
to_indy_num_str() → str[source]

Return (typically, numeric) string value that indy-sdk associates with role.

Recall that None signifies USER and “” signifies a role undergoing reset.

token() → str[source]

Return token identifying role to indy-sdk.

aries_cloudagent.ledger.endpoint_type module

Ledger utilities.

class aries_cloudagent.ledger.endpoint_type.EndpointType[source]

Bases: enum.Enum

Enum for endpoint/service types.

ENDPOINT = EndpointTypeName(w3c='Endpoint', indy='endpoint')
LINKED_DOMAINS = EndpointTypeName(w3c='LinkedDomains', indy='linked_domains')
PROFILE = EndpointTypeName(w3c='Profile', indy='profile')
get = <function EndpointType.get>[source]
indy

internally-facing, on ledger and in wallet.

Type:Indy name of endpoint type
w3c

externally-facing.

Type:W3C name of endpoint type
class aries_cloudagent.ledger.endpoint_type.EndpointTypeName(w3c, indy)

Bases: tuple

indy

Alias for field number 1

w3c

Alias for field number 0

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.IndySdkLedger(pool: aries_cloudagent.ledger.indy.IndySdkLedgerPool, wallet: aries_cloudagent.wallet.indy.IndySdkWallet)[source]

Bases: aries_cloudagent.ledger.base.BaseLedger

Indy ledger class.

BACKEND_NAME = 'indy'
accept_txn_author_agreement(taa_record: dict, mechanism: str, accept_time: int = None)[source]

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]) → Tuple[str, dict][source]

Check if a schema has already been published.

create_and_send_credential_definition(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_id: str, signature_type: str = None, tag: str = None, support_revocation: bool = False, write_ledger: bool = True, endorser_did: str = None) → Tuple[str, dict, bool][source]

Send credential definition to ledger and store relevant key matter in wallet.

Parameters:
  • issuer – The issuer instance to use for credential definition creation
  • schema_id – The schema id of the schema to create cred def for
  • signature_type – The signature type to use on the credential definition
  • tag – Optional tag to distinguish multiple credential definitions
  • support_revocation – Optional flag to enable revocation for this cred def
Returns:

Tuple with cred def id, cred def structure, and whether it’s novel

create_and_send_schema(issuer: aries_cloudagent.indy.issuer.IndyIssuer, schema_name: str, schema_version: str, attribute_names: Sequence[str], write_ledger: bool = True, endorser_did: str = None) → Tuple[str, dict][source]

Send schema to ledger.

Parameters:
  • issuer – The issuer instance creating the schema
  • schema_name – The schema name
  • schema_version – The schema version
  • attribute_names – A list of schema attributes
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) → dict[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) → dict[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_txn_author_agreement() → dict[source]

Fetch the current AML and TAA from the ledger.

get_all_endpoints_for_did(did: str) → dict[source]

Fetch all endpoints for a ledger DID.

Parameters:did – The DID to look up on the ledger or in the cache
get_credential_definition(credential_definition_id: str) → dict[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, endpoint_type: aries_cloudagent.ledger.endpoint_type.EndpointType = None) → str[source]

Fetch the endpoint for a ledger DID.

Parameters:
  • did – The DID to look up on the ledger or in the cache
  • endpoint_type – The type of the endpoint. If none given, returns all
get_indy_storage() → aries_cloudagent.storage.indy.IndySdkStorage[source]

Get an IndySdkStorage 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
get_latest_txn_author_acceptance() → dict[source]

Look up the latest TAA acceptance.

get_nym_role(did: str) → aries_cloudagent.ledger.base.Role[source]

Return the role of the input public DID’s NYM on the ledger.

Parameters:did – DID to query for role on the ledger.
get_revoc_reg_def(revoc_reg_id: str) → dict[source]

Get revocation registry definition by ID; augment with ledger timestamp.

get_revoc_reg_delta(revoc_reg_id: str, fro=0, to=None) → Tuple[dict, int][source]

Look up a revocation registry delta by ID.

:param revoc_reg_id revocation registry id :param fro earliest EPOCH time of interest :param to latest EPOCH time of interest

:returns delta response, delta timestamp

get_revoc_reg_entry(revoc_reg_id: str, timestamp: int)[source]

Get revocation registry entry by revocation registry ID and timestamp.

get_schema(schema_id: str) → dict[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_txn_author_agreement(reload: bool = False) → dict[source]

Get the current transaction author agreement, fetching it if necessary.

nym_to_did(nym: str) → str[source]

Format a nym with the ledger’s DID prefix.

pool_handle

Accessor for the ledger pool handle.

pool_name

Accessor for the ledger pool name.

read_only

Accessor for the ledger read-only flag.

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.
rotate_public_did_keypair(next_seed: str = None) → None[source]

Rotate keypair for public DID: create new key, submit to ledger, update wallet.

Parameters:next_seed – seed for incoming ed25519 keypair (default random)
send_revoc_reg_def(revoc_reg_def: dict, issuer_did: str = None, write_ledger: bool = True, endorser_did: str = None)[source]

Publish a revocation registry definition to the ledger.

send_revoc_reg_entry(revoc_reg_id: str, revoc_def_type: str, revoc_reg_entry: dict, issuer_did: str = None, write_ledger: bool = True, endorser_did: str = None)[source]

Publish a revocation registry entry to the ledger.

taa_rough_timestamp() → int[source]

Get a timestamp accurate to the day.

Anything more accurate is a privacy concern.

txn_endorse(request_json: str) → str[source]

Endorse a (signed) ledger transaction.

txn_submit(request_json: str, sign: bool = None, taa_accept: bool = None, sign_did: aries_cloudagent.wallet.did_info.DIDInfo = <object object>) → str[source]

Submit a signed (and endorsed) transaction to the ledger.

update_endpoint_for_did(did: str, endpoint: str, endpoint_type: aries_cloudagent.ledger.endpoint_type.EndpointType = None) → bool[source]

Check and update the endpoint on the ledger.

Parameters:
  • did – The ledger DID
  • endpoint – The endpoint address
  • endpoint_type – The type of the endpoint
class aries_cloudagent.ledger.indy.IndySdkLedgerPool(name: str, *, checked: bool = False, keepalive: int = 0, cache: aries_cloudagent.cache.base.BaseCache = None, cache_duration: int = 600, genesis_transactions: str = None, read_only: bool = False)[source]

Bases: object

Indy ledger manager class.

check_pool_config() → bool[source]

Check if a pool config has been created.

close()[source]

Close the pool ledger.

context_close()[source]

Release the reference and schedule closing of the pool ledger.

context_open()[source]

Open the ledger if necessary and increase the number of active references.

create_pool_config(genesis_transactions: str, recreate: bool = False)[source]

Create the pool ledger configuration.

open()[source]

Open the pool ledger, creating it if necessary.

class aries_cloudagent.ledger.indy.IndySdkLedgerPoolProvider[source]

Bases: aries_cloudagent.config.base.BaseProvider

Indy ledger pool provider which keys off the selected pool name.

provide(settings: aries_cloudagent.config.base.BaseSettings, injector: aries_cloudagent.config.base.BaseInjector)[source]

Create and open the pool instance.

aries_cloudagent.ledger.routes module

Ledger admin routes.

class aries_cloudagent.ledger.routes.AMLRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Ledger AML record.

aml = <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.'})>
amlContext = <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.'})>
version = <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.ledger.routes.GetDIDEndpointResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema to get DID endpoint.

endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint object>, 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 aries_cloudagent.ledger.routes.GetDIDVerkeyResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema to get DID verkey.

verkey = <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=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 aries_cloudagent.ledger.routes.GetNymRoleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema to get nym role operation.

role = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['STEWARD', 'TRUSTEE', 'ENDORSER', 'NETWORK_MONITOR', 'USER', 'ROLE_REMOVE'], 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.ledger.routes.LedgerModulesResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for the modules endpoint.

class aries_cloudagent.ledger.routes.QueryStringDIDSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for query string with DID only.

did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID 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.'})>
class aries_cloudagent.ledger.routes.QueryStringEndpointSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for query string with DID and endpoint type.

did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID 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.'})>
endpoint_type = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.EndpointType 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 aries_cloudagent.ledger.routes.RegisterLedgerNymQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query string parameters and validators for register ledger nym request.

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.'})>
did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID 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.'})>
role = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['STEWARD', 'TRUSTEE', 'ENDORSER', 'NETWORK_MONITOR', 'reset'], 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.'})>
verkey = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRawPublicKey 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.'})>
class aries_cloudagent.ledger.routes.RegisterLedgerNymResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for ledger nym registration.

success = <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.'})>
class aries_cloudagent.ledger.routes.TAAAcceptSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Input schema for accepting the TAA.

mechanism = <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.'})>
text = <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.'})>
version = <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.ledger.routes.TAAAcceptanceSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

TAA acceptance record.

mechanism = <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.'})>
time = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IntEpoch 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 integer.', 'too_large': 'Number too large.'})>
class aries_cloudagent.ledger.routes.TAAInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Transaction author agreement info.

aml_record = <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.'})>
taa_accepted = <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.'})>
taa_record = <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.'})>
taa_required = <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.'})>
class aries_cloudagent.ledger.routes.TAARecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Ledger TAA record.

digest = <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.'})>
text = <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.'})>
version = <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.ledger.routes.TAAResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for a transaction author agreement.

result = <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.'})>
aries_cloudagent.ledger.routes.get_did_endpoint(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0548881d0>)[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 0x7fb0548881d0>)[source]

Request handler for getting a verkey for a DID from the ledger.

Parameters:request – aiohttp request object
aries_cloudagent.ledger.routes.get_nym_role(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0548881d0>)[source]

Request handler for getting the role from the NYM registration of a public DID.

Parameters:request – aiohttp request object
aries_cloudagent.ledger.routes.ledger_accept_taa(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0548881d0>)[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 0x7fb0548881d0>)[source]

Request handler for fetching the transaction author agreement.

Parameters:request – aiohttp request object
Returns:The TAA information including the AML
aries_cloudagent.ledger.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0548881d0>)[source]

Amend swagger API.

aries_cloudagent.ledger.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0548881d0>)[source]

Register routes.

aries_cloudagent.ledger.routes.register_ledger_nym(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0548881d0>)[source]

Request handler for registering a NYM with the ledger.

Parameters:request – aiohttp request object
aries_cloudagent.ledger.routes.rotate_public_did_keypair(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0548881d0>)[source]

Request handler for rotating key pair associated with public DID.

Parameters:request – aiohttp request object
aries_cloudagent.ledger.util module

Ledger utilities.

aries_cloudagent.messaging package
Subpackages
aries_cloudagent.messaging.ack package
Submodules
aries_cloudagent.messaging.ack.message module

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 Meta[source]

Bases: object

Ack metadata.

schema_class = 'AckSchema'
class aries_cloudagent.messaging.ack.message.AckSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Schema for Ack base class.

class Meta[source]

Bases: object

Ack schema metadata.

model_class

alias of Ack

unknown = 'exclude'
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
Submodules
aries_cloudagent.messaging.credential_definitions.routes module

Credential definition admin routes.

class aries_cloudagent.messaging.credential_definitions.routes.CreateCredDefTxnForEndorserOptionSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Class for user to input whether to create a transaction for endorser or not.

create_transaction_for_endorser = <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.'})>
class aries_cloudagent.messaging.credential_definitions.routes.CredDefConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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 aries_cloudagent.messaging.credential_definitions.routes.CredDefIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking cred def id.

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.'})>
class aries_cloudagent.messaging.credential_definitions.routes.CredentialDefinitionGetResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for schema get request.

credential_definition = <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.'})>
class aries_cloudagent.messaging.credential_definitions.routes.CredentialDefinitionSendRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for schema send request.

revocation_registry_size = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegSize 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 integer.', 'too_large': 'Number too large.'})>
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.'})>
support_revocation = <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.'})>
tag = <fields.String(default='default', 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.messaging.credential_definitions.routes.CredentialDefinitionSendResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema content for schema send request with auto-endorse.

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.'})>
class aries_cloudagent.messaging.credential_definitions.routes.CredentialDefinitionsCreatedResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for cred-defs-created request.

credential_definition_ids = <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 aries_cloudagent.messaging.credential_definitions.routes.TxnOrCredentialDefinitionSendResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for credential definition send request.

sent = <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.'})>
txn = <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.'})>
aries_cloudagent.messaging.credential_definitions.routes.credential_definitions_created(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546b3d10>)[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 0x7fb0546b3d10>)[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 0x7fb0546b3d10>)[source]

Request handler for sending a credential definition to the ledger.

Parameters:request – aiohttp request object
Returns:The credential definition identifier
aries_cloudagent.messaging.credential_definitions.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546b3d10>)[source]

Amend swagger API.

aries_cloudagent.messaging.credential_definitions.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546b3d10>)[source]

Register routes.

aries_cloudagent.messaging.credential_definitions.util module

Credential definition utilities.

class aries_cloudagent.messaging.credential_definitions.util.CredDefQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query string parameters for credential definition searches.

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.'})>
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.'})>
aries_cloudagent.messaging.decorators package
Submodules
aries_cloudagent.messaging.decorators.attach_decorator module

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.

class Meta[source]

Bases: object

AttachDecorator metadata.

schema_class = 'AttachDecoratorSchema'
content

Return attachment content.

Returns:data attachment, decoded if necessary and json-loaded, or data links and sha-256 hash.
classmethod data_base64(mapping: Mapping[KT, VT_co], *, ident: str = None, description: str = None, filename: str = None, lastmod_time: str = None, byte_count: int = None)[source]

Create AttachDecorator instance on base64-encoded data from input mapping.

Given mapping, JSON dump, base64-encode, and embed it as data; mark application/json MIME type.

Parameters:
  • mapping – (dict) data structure; e.g., indy production
  • 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
classmethod data_json(mapping: dict, *, ident: str = None, description: str = None, filename: str = None, lastmod_time: str = None, byte_count: int = None)[source]

Create AttachDecorator instance on json-encoded data from input mapping.

Given message object (dict), JSON dump, and embed it as data; mark application/json MIME type.

Parameters:
  • mapping – (dict) data structure; e.g., Aries message
  • 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

Create AttachDecorator instance on json-encoded data from input mapping.

Given message object (dict), JSON dump, and embed it as data; mark application/json MIME type.

Parameters:
  • links – URL or list of URLs
  • sha256 – optional sha-256 hash for content
  • ident – optional attachment identifier (default random UUID4)
  • mime_type – optional MIME type
  • description – optional attachment description
  • filename – optional attachment filename
  • lastmod_time – optional attachment last modification time
  • byte_count – optional attachment byte count
class aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorData(*, jws_: aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWS = None, sha256_: str = None, links_: Union[Sequence[str], str] = None, base64_: str = None, json_: dict = 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_map(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.

jws

Accessor for JWS, or None.

Accessor for links decorator data, or None.

sha256

Accessor for sha256 decorator data, or None.

sign(verkeys: Union[str, Sequence[str]], wallet: aries_cloudagent.wallet.base.BaseWallet)[source]

Sign base64 data value of attachment.

Parameters:
  • verkeys – verkey(s) of the signing party (in raw or DID key format)
  • wallet – The wallet to use for the signature
signatures

Accessor for number of signatures.

signed

Accessor for signed content (payload), None for unsigned.

verify(wallet: aries_cloudagent.wallet.base.BaseWallet) → bool[source]

Verify the signature(s).

Parameters:wallet – Wallet to use to verify signature
Returns:True if verification succeeds else False
class aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorData1JWS(*, header: aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWSHeader, protected: str = None, signature: str)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Single Detached JSON Web Signature for inclusion in attach decorator data.

class Meta[source]

Bases: object

AttachDecoratorData1JWS metadata.

schema_class = 'AttachDecoratorData1JWSSchema'
class aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorData1JWSSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Single attach decorator data JWS schema.

class Meta[source]

Bases: object

Single attach decorator data JWS schema metadata.

model_class

alias of AttachDecoratorData1JWS

unknown = 'exclude'
header = <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.'})>
protected = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Base64URLNoPad 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.'})>
signature = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Base64URLNoPad 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.'})>
class aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWS(*, header: aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWSHeader = None, protected: str = None, signature: str = None, signatures: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorData1JWS] = None)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Detached JSON Web Signature for inclusion in attach decorator data.

May hold one signature in flattened format, or multiple signatures in the “signatures” member.

class Meta[source]

Bases: object

AttachDecoratorDataJWS metadata.

schema_class = 'AttachDecoratorDataJWSSchema'
class aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWSHeader(kid: str)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Attach decorator data JWS header.

class Meta[source]

Bases: object

AttachDecoratorDataJWS metadata.

schema_class = 'AttachDecoratorDataJWSHeaderSchema'
class aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWSHeaderSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Attach decorator data JWS header schema.

class Meta[source]

Bases: object

Attach decorator data schema metadata.

model_class

alias of AttachDecoratorDataJWSHeader

unknown = 'exclude'
kid = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.JWSHeaderKid 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.'})>
class aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWSSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Schema for detached JSON Web Signature for inclusion in attach decorator data.

class Meta[source]

Bases: object

Metadata for schema for detached JWS for inclusion in attach deco data.

model_class

alias of AttachDecoratorDataJWS

unknown = 'exclude'
header = <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.'})>
protected = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Base64URLNoPad 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.'})>
signature = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Base64URLNoPad 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.'})>
signatures = <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.'})>
validate_single_xor_multi_sig(data: Mapping[KT, VT_co], **kwargs)[source]

Ensure model is for either 1 or many sigatures, not mishmash of both.

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

unknown = 'exclude'
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.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.'})>
jws_ = <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.'})>
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.'})>
validate_data_spec(data: Mapping[KT, VT_co], **kwargs)[source]

Ensure model chooses exactly one of base64, json, or links.

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

unknown = 'exclude'
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.'})>
aries_cloudagent.messaging.decorators.attach_decorator.did_key(verkey: str) → str[source]

Qualify verkey into DID key if need be.

aries_cloudagent.messaging.decorators.attach_decorator.raw_key(verkey: str) → str[source]

Strip qualified key to raw key if need be.

aries_cloudagent.messaging.decorators.base module

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 0x7fb0566b4890>] = 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.

has_field(name: str) → bool[source]

Check for the existence of a named decorator field.

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.

remove_field(name: str)[source]

Remove a named decorated field.

remove_model(key: str)[source]

Remove a registered decorator model.

to_dict(prefix: str = None) → collections.OrderedDict[source]

Convert to a dictionary (serialize).

Raises:BaseModelError – on decorator validation errors
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.

aries_cloudagent.messaging.decorators.default module

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.

aries_cloudagent.messaging.decorators.localization_decorator module

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 Meta[source]

Bases: object

LocalizationDecorator metadata.

schema_class = 'LocalizationDecoratorSchema'
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

unknown

Used by autodoc_mock_imports.

catalogs

Used by autodoc_mock_imports.

locale

Used by autodoc_mock_imports.

localizable

Used by autodoc_mock_imports.

aries_cloudagent.messaging.decorators.please_ack_decorator module

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 Meta[source]

Bases: object

PleaseAckDecorator metadata.

schema_class = 'PleaseAckDecoratorSchema'
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

unknown = 'exclude'
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.'})>
aries_cloudagent.messaging.decorators.signature_decorator module

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 = '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

decode() -> (<class 'object'>, <class 'int'>)[source]

Decode the signature to its timestamp and value.

Returns:A tuple of (decoded message, timestamp)
verify(wallet: aries_cloudagent.wallet.base.BaseWallet) → bool[source]

Verify the signature against the signer’s public key.

Parameters:wallet – Wallet to use to verify signature
Returns:True if verification succeeds else False
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

unknown

Used by autodoc_mock_imports.

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.

aries_cloudagent.messaging.decorators.thread_decorator module

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.

class Meta[source]

Bases: object

ThreadDecorator metadata.

schema_class = 'ThreadDecoratorSchema'
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

unknown

Used by autodoc_mock_imports.

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.

aries_cloudagent.messaging.decorators.timing_decorator module

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 Meta[source]

Bases: object

TimingDecorator metadata.

schema_class = 'TimingDecoratorSchema'
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

unknown

Used by autodoc_mock_imports.

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.

aries_cloudagent.messaging.decorators.trace_decorator module

A message decorator for trace events.

A trace decorator identifies a responsibility on the processor to record information on message processing events.

class aries_cloudagent.messaging.decorators.trace_decorator.TraceDecorator(*, target: str = None, full_thread: bool = True, trace_reports: Sequence[T_co] = None)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Class representing trace decorator.

class Meta[source]

Bases: object

TraceDecorator metadata.

schema_class = 'TraceDecoratorSchema'
append_trace_report(trace_report: aries_cloudagent.messaging.decorators.trace_decorator.TraceReport)[source]

Append a trace report to this decorator.

full_thread

Accessor for full_thread flag.

Returns:The full_thread flag
target

Accessor for trace target.

Returns:The target for tracing messages
trace_reports

Set of trace reports for this message.

Returns:The trace reports that have been logged on this message/thread so far. (Only for target=”message”.)
class aries_cloudagent.messaging.decorators.trace_decorator.TraceDecoratorSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Trace decorator schema used in serialization/deserialization.

class Meta[source]

Bases: object

TraceDecoratorSchema metadata.

model_class

alias of TraceDecorator

unknown

Used by autodoc_mock_imports.

full_thread

Used by autodoc_mock_imports.

target

Used by autodoc_mock_imports.

trace_reports

Used by autodoc_mock_imports.

class aries_cloudagent.messaging.decorators.trace_decorator.TraceReport(*, msg_id: str = None, thread_id: str = None, traced_type: str = None, timestamp: str = None, str_time: str = None, handler: str = None, ellapsed_milli: int = None, outcome: str = None)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Class representing a Trace Report.

class Meta[source]

Bases: object

TraceReport metadata.

schema_class = 'TraceReport'
ellapsed_milli

Accessor for ellapsed_milli.

Returns:The sender ellapsed_milli
handler

Accessor for handler.

Returns:The sender handler
msg_id

Accessor for msg_id.

Returns:The msg_id
outcome

Accessor for outcome.

Returns:The sender outcome
str_time

Accessor for str_time.

Returns:Formatted representation of the sender timestamp
thread_id

Accessor for thread_id.

Returns:The thread_id
timestamp

Accessor for timestamp.

Returns:The sender timestamp
traced_type

Accessor for traced_type.

Returns:The sender traced_type
class aries_cloudagent.messaging.decorators.trace_decorator.TraceReportSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Trace report schema.

class Meta[source]

Bases: object

TraceReportSchema metadata.

model_class

alias of TraceReport

unknown

Used by autodoc_mock_imports.

ellapsed_milli

Used by autodoc_mock_imports.

handler

Used by autodoc_mock_imports.

msg_id

Used by autodoc_mock_imports.

outcome

Used by autodoc_mock_imports.

str_time

Used by autodoc_mock_imports.

thread_id

Used by autodoc_mock_imports.

timestamp

Used by autodoc_mock_imports.

traced_type

Used by autodoc_mock_imports.

aries_cloudagent.messaging.decorators.transport_decorator module

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 Meta[source]

Bases: object

TransportDecorator metadata.

schema_class = 'TransportDecoratorSchema'
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

unknown

Used by autodoc_mock_imports.

queued_message_count

Used by autodoc_mock_imports.

return_route

Used by autodoc_mock_imports.

return_route_thread

Used by autodoc_mock_imports.

aries_cloudagent.messaging.jsonld package
Submodules
aries_cloudagent.messaging.jsonld.create_verify_data module

Contains the functions needed to produce and verify a json-ld signature.

This file was ported from https://github.com/transmute-industries/Ed25519Signature2018/blob/master/

src/createVerifyData/index.js
aries_cloudagent.messaging.jsonld.create_verify_data.create_verify_data(data, signature_options, document_loader=None)[source]

Encapsulate process of constructing string used during sign and verify.

aries_cloudagent.messaging.jsonld.credential module

Sign and verify functions for json-ld based credentials.

aries_cloudagent.messaging.jsonld.credential.b64decode(bytes)[source]

Url Safe B64 Decode.

aries_cloudagent.messaging.jsonld.credential.b64encode(str)[source]

Url Safe B64 Encode.

aries_cloudagent.messaging.jsonld.credential.create_jws(encoded_header, verify_data)[source]

Compose JWS.

aries_cloudagent.messaging.jsonld.credential.did_key(verkey: str) → str[source]

Qualify verkey into DID key if need be.

aries_cloudagent.messaging.jsonld.credential.jws_sign(session, verify_data, verkey)[source]

Sign JWS.

aries_cloudagent.messaging.jsonld.credential.jws_verify(session, verify_data, signature, public_key)[source]

Detatched jws verify handling.

aries_cloudagent.messaging.jsonld.credential.sign_credential(session, credential, signature_options, verkey)[source]

Sign Credential.

aries_cloudagent.messaging.jsonld.credential.verify_credential(session, doc, verkey)[source]

Verify credential.

aries_cloudagent.messaging.jsonld.credential.verify_jws_header(header)[source]

Check header requirements.

aries_cloudagent.messaging.jsonld.routes module

jsonld admin routes.

class aries_cloudagent.messaging.jsonld.routes.DocSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for LD doc to sign.

credential = <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.'})>
options = <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_cloudagent.messaging.jsonld.routes.SignRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for signing a jsonld doc.

doc = <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.'})>
verkey = <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.messaging.jsonld.routes.SignResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for a signed jsonld doc.

error = <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.'})>
signed_doc = <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.'})>
class aries_cloudagent.messaging.jsonld.routes.SignatureOptionsSchema(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict[KT, VT] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)[source]

Bases: marshmallow.schema.Schema

Schema for LD signature options.

opts = <marshmallow.schema.SchemaOpts object>
class aries_cloudagent.messaging.jsonld.routes.SignedDocSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Verifiable doc schema.

class Meta[source]

Bases: object

Keep unknown values.

unknown = 'include'
proof = <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_cloudagent.messaging.jsonld.routes.VerifyRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for signing a jsonld doc.

doc = <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.'})>
verkey = <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.messaging.jsonld.routes.VerifyResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for verification result.

error = <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.'})>
valid = <fields.Boolean(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 boolean.'})>
aries_cloudagent.messaging.jsonld.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055003150>)[source]

Amend swagger API.

aries_cloudagent.messaging.jsonld.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055003150>)[source]

Register routes.

aries_cloudagent.messaging.jsonld.routes.sign(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055003150>)[source]

Request handler for signing a jsonld doc.

Parameters:request – aiohttp request object
aries_cloudagent.messaging.jsonld.routes.verify(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055003150>)[source]

Request handler for signing a jsonld doc.

Parameters:request – aiohttp request object
aries_cloudagent.messaging.models package

Common code for messaging models.

Submodules
aries_cloudagent.messaging.models.base module

Base classes for Models and Schemas.

class aries_cloudagent.messaging.models.base.BaseModel[source]

Bases: abc.ABC

Base model that provides convenience methods.

class Meta[source]

Bases: object

BaseModel meta data.

schema_class = None
Schema

Accessor for the model’s schema class.

Returns:The schema class
classmethod deserialize(obj, unknown: str = None, none2none: str = False)[source]

Convert from JSON representation to a model instance.

Parameters:
  • obj – The dict to load into a model instance
  • unknown – Behaviour for unknown attributes
  • none2none – Deserialize None to None
Returns:

A model instance for this data

classmethod from_json(json_repr: Union[str, bytes], unknown: str = None)[source]

Parse a JSON string into a model instance.

Parameters:json_repr – JSON string
Returns:A model instance representation of this JSON
classmethod serde(obj: Union[BaseModel, Mapping[KT, VT_co]]) → aries_cloudagent.messaging.models.base.SerDe[source]

Return serialized, deserialized representations of input object.

serialize(as_string=False, unknown: str = None) → dict[source]

Create a JSON-compatible dict representation of the model instance.

Parameters:as_string – Return a string of JSON instead of a dict
Returns:A dict representation of this model, or a JSON string if as_string is True
to_json(unknown: str = None) → str[source]

Create a JSON representation of the model instance.

Returns:A JSON representation of this message
validate(unknown: str = None)[source]

Validate a constructed model.

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
remove_skipped_values(data, **kwargs)[source]

Remove values that are are marked to skip.

Returns:Returns this modified data
skip_dump_only(data, **kwargs)[source]

Skip fields that are only expected during serialization.

Parameters:data – The incoming data to clean
Returns:The modified data
class aries_cloudagent.messaging.models.base.SerDe(ser, de)

Bases: tuple

de

Alias for field number 1

ser

Alias for field number 0

aries_cloudagent.messaging.models.base.resolve_class(the_cls, relative_cls: type = None)[source]

Resolve a class.

Parameters:
  • the_cls – The class to resolve
  • relative_cls – Relative class to resolve from
Returns:

The resolved class

Raises:

ClassNotFoundError – If the class could not be loaded

aries_cloudagent.messaging.models.base.resolve_meta_property(obj, prop_name: str, defval=None)[source]

Resolve a meta property.

Parameters:
  • prop_name – The property to resolve
  • defval – The default value
Returns:

The meta property

aries_cloudagent.messaging.models.base_record module

Classes for BaseStorage-based record management.

class aries_cloudagent.messaging.models.base_record.BaseExchangeRecord(id: str = None, state: str = None, *, trace: bool = False, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Represents a base record with event tracing capability.

class aries_cloudagent.messaging.models.base_record.BaseExchangeSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

Base schema for exchange records.

class Meta[source]

Bases: object

BaseExchangeSchema metadata.

model_class

alias of BaseExchangeRecord

trace

Used by autodoc_mock_imports.

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.

DEFAULT_CACHE_TTL = 60
EVENT_NAMESPACE = 'acapy::record'
LOG_STATE_FLAG = None
class Meta[source]

Bases: object

BaseRecord metadata.

RECORD_ID_NAME = 'id'
RECORD_TOPIC = None
RECORD_TYPE = None
TAG_NAMES = {'state'}
classmethod clear_cached_key(session: aries_cloudagent.core.profile.ProfileSession, cache_key: str)[source]

Shortcut method to clear a cached key value, if any.

Parameters:
  • session – The profile session to use
  • cache_key – The unique cache identifier
delete_record(session: aries_cloudagent.core.profile.ProfileSession)[source]

Remove the stored record.

Parameters:session – The profile session to use
emit_event(session: aries_cloudagent.core.profile.ProfileSession, payload: Any = None)[source]

Emit an event.

Parameters:
  • session – The profile session to use
  • payload – The event payload
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(session: aries_cloudagent.core.profile.ProfileSession, cache_key: str)[source]

Shortcut method to fetch a cached key value.

Parameters:
  • session – The profile session to use
  • cache_key – The unique cache identifier
classmethod get_tag_map() → Mapping[str, str][source]

Accessor for the set of defined tags.

classmethod log_state(msg: str, params: dict = None, settings: aries_cloudagent.config.base.BaseSettings = None, override: bool = False)[source]

Print a message with increased visibility (for testing).

post_save(session: aries_cloudagent.core.profile.ProfileSession, new_record: bool, last_state: Optional[str], event: bool = None)[source]

Perform post-save actions.

Parameters:
  • session – The profile session to use
  • new_record – Flag indicating if the record was just created
  • last_state – The previous state value
  • event – Flag to override whether the event is sent
classmethod prefix_tag_filter(tag_filter: dict)[source]

Prefix unencrypted tags used in the tag filter.

classmethod query(session: aries_cloudagent.core.profile.ProfileSession, tag_filter: dict = None, *, post_filter_positive: dict = None, post_filter_negative: dict = None, alt: bool = False) → Sequence[aries_cloudagent.messaging.models.base_record.BaseRecord][source]

Query stored records.

Parameters:
  • session – The profile session to use
  • tag_filter – An optional dictionary of tag filter clauses
  • post_filter_positive – Additional value filters to apply matching positively
  • post_filter_negative – Additional value filters to apply matching negatively
  • alt – set to match any (positive=True) value or miss all (positive=False) values in post_filter
record_tags

Accessor to define implementation-specific tags.

record_value

Accessor to define custom properties for the JSON record value.

classmethod retrieve_by_id(session: aries_cloudagent.core.profile.ProfileSession, record_id: str) → aries_cloudagent.messaging.models.base_record.BaseRecord[source]

Retrieve a stored record by ID.

Parameters:
  • session – The profile session to use
  • record_id – The ID of the record to find
classmethod retrieve_by_tag_filter(session: aries_cloudagent.core.profile.ProfileSession, tag_filter: dict, post_filter: dict = None) → aries_cloudagent.messaging.models.base_record.BaseRecord[source]

Retrieve a record by tag filter.

Parameters:
  • session – The profile session to use
  • tag_filter – The filter dictionary to apply
  • post_filter – Additional value filters to apply matching positively, with sequence values specifying alternatives to match (hit any)
save(session: aries_cloudagent.core.profile.ProfileSession, *, reason: str = None, log_params: Mapping[str, Any] = None, log_override: bool = False, event: bool = None) → str[source]

Persist the record to storage.

Parameters:
  • session – The profile session to use
  • reason – A reason to add to the log
  • log_params – Additional parameters to log
  • override – Override configured logging regimen, print to stderr instead
  • event – Flag to override whether the event is sent
classmethod set_cached_key(session: aries_cloudagent.core.profile.ProfileSession, cache_key: str, value: Any, ttl=None)[source]

Shortcut method to set a cached key value.

Parameters:
  • session – The profile session 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.

classmethod strip_tag_prefix(tags: dict)[source]

Strip tilde from unencrypted tag names.

tags

Accessor for the record tags generated for this record.

value

Accessor for the JSON record value generated for this record.

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.

class Meta[source]

Bases: object

BaseRecordSchema metadata.

model_class = None
created_at

Used by autodoc_mock_imports.

state

Used by autodoc_mock_imports.

updated_at

Used by autodoc_mock_imports.

aries_cloudagent.messaging.models.base_record.match_post_filter(record: dict, post_filter: dict, positive: bool = True, alt: bool = False) → bool[source]

Determine if a record value matches the post-filter.

Parameters:
  • record – record to check
  • post_filter – filter to apply (empty or None filter matches everything)
  • positive – whether matching all filter criteria positively or negatively
  • alt – set to match any (positive=True) value or miss all (positive=False) values in post_filter
aries_cloudagent.messaging.models.openapi module

Base class for OpenAPI artifact schema.

class aries_cloudagent.messaging.models.openapi.OpenAPISchema(*args, **kwargs)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Schema for OpenAPI artifacts: excluding unknown fields, not raising exception.

class Meta[source]

Bases: object

OpenAPISchema metadata.

model_class = None
unknown

Used by autodoc_mock_imports.

aries_cloudagent.messaging.schemas package
Submodules
aries_cloudagent.messaging.schemas.routes module

Credential schema admin routes.

class aries_cloudagent.messaging.schemas.routes.CreateSchemaTxnForEndorserOptionSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Class for user to input whether to create a transaction for endorser or not.

create_transaction_for_endorser = <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.'})>
class aries_cloudagent.messaging.schemas.routes.SchemaConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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 aries_cloudagent.messaging.schemas.routes.SchemaGetResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for schema get request.

schema = <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.'})>
class aries_cloudagent.messaging.schemas.routes.SchemaIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking schema id.

schema_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<Regexp(regex=re.compile('^[1-9][0-9]*|[<sphinx.ext.autodoc.importer._MockObject object>]{21,22}:2:.+:[0-9.]+$'), error='String does not match expected pattern.')>, 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.messaging.schemas.routes.SchemaSendRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for schema send request.

attributes = <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.'})>
schema_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.'})>
schema_version = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyVersion 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.'})>
class aries_cloudagent.messaging.schemas.routes.SchemaSendResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema content for schema send request with auto-endorse.

schema = <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.'})>
schema_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndySchemaId 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.'})>
class aries_cloudagent.messaging.schemas.routes.SchemasCreatedResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for a schemas-created request.

schema_ids = <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 aries_cloudagent.messaging.schemas.routes.TxnOrSchemaSendResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for schema send request.

sent = <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.'})>
txn = <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.'})>
aries_cloudagent.messaging.schemas.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f64510>)[source]

Amend swagger API.

aries_cloudagent.messaging.schemas.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f64510>)[source]

Register routes.

aries_cloudagent.messaging.schemas.routes.schemas_created(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f64510>)[source]

Request handler for retrieving schemas that current agent created.

Parameters:request – aiohttp request object
Returns:The identifiers of matching schemas
aries_cloudagent.messaging.schemas.routes.schemas_get_schema(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f64510>)[source]

Request handler for sending a credential offer.

Parameters:request – aiohttp request object
Returns:The schema details.
aries_cloudagent.messaging.schemas.routes.schemas_send_schema(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f64510>)[source]

Request handler for sending a credential offer.

Parameters:request – aiohttp request object
Returns:The schema id sent
aries_cloudagent.messaging.schemas.util module

Schema utilities.

class aries_cloudagent.messaging.schemas.util.SchemaQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query string parameters for schema searches.

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.'})>
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, aries_cloudagent.messaging.base_message.BaseMessage

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
add_trace_decorator(target: str = 'log', full_thread: bool = True)[source]

Create a new trace decorator.

Parameters:
  • target – The trace target
  • full_thread – Full thread flag
add_trace_report(val: Union[aries_cloudagent.messaging.decorators.trace_decorator.TraceReport, dict])[source]

Append a new trace report.

Parameters:val – The trace target
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
assign_trace_decorator(context, trace)[source]

Copy trace from a json structure.

Parameters:trace – string containing trace json stucture
assign_trace_from(msg: aries_cloudagent.messaging.agent_message.AgentMessage)[source]

Copy trace information from a previous message.

Parameters:msg – The received message containing optional trace information
classmethod deserialize(value: dict, msg_format: aries_cloudagent.messaging.base_message.DIDCommVersion = <DIDCommVersion.v1: 1>, **kwargs)[source]

Return message object deserialized from value in format specified.

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
serialize(msg_format: aries_cloudagent.messaging.base_message.DIDCommVersion = <DIDCommVersion.v1: 1>, **kwargs)[source]

Return serialized message in format specified.

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 message
  • ValueError – If the verification fails
  • ValueError – 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
unknown

Used by autodoc_mock_imports.

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: Mapping[KT, VT_co], **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
populate_decorators(obj, **kwargs)[source]

Post-load hook to populate decorators on the message.

Parameters:obj – The AgentMessage object
Returns:The AgentMessage object with populated decorators
replace_signatures(data, **kwargs)[source]

Post-dump hook to write the signatures to the serialized output.

Parameters:obj – The serialized data
Returns:The modified data
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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Abstract method for handler logic.

Parameters:
  • context – Request context object
  • responder – A responder object
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(profile: aries_cloudagent.core.profile.Profile, *, context: aries_cloudagent.config.injection_context.InjectionContext = None, settings: Mapping[str, object] = None)[source]

Bases: object

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.

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
inject(base_cls: Type[InjectType], settings: Mapping[str, object] = None, *, required: bool = True) → Optional[InjectType][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 the associated Injector instance.

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
profile

Accessor for the associated Profile instance.

session() → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with no transaction support requested.

settings

Accessor for the context settings.

classmethod test_context() → aries_cloudagent.messaging.request_context.RequestContext[source]

Quickly set up a new request context for tests.

transaction() → aries_cloudagent.core.profile.ProfileSession[source]

Start a new interactive session with commit and rollback support.

If the current backend does not support transactions, then commit and rollback operations of the session will not have any effect.

update_settings(settings: Mapping[str, object])[source]

Update the scope with additional settings.

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.base_message.BaseMessage, str, bytes], *, connection_id: str = None, 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) → aries_cloudagent.transport.outbound.message.OutboundMessage[source]

Create an OutboundMessage from a message payload.

send(message: Union[aries_cloudagent.messaging.base_message.BaseMessage, str, bytes], **kwargs) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Convert a message to an OutboundMessage and send it.

send_outbound(message: aries_cloudagent.transport.outbound.message.OutboundMessage) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Send an outbound message.

Parameters:message – The OutboundMessage to be sent
send_reply(message: Union[aries_cloudagent.messaging.base_message.BaseMessage, 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) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Send a reply to an incoming message.

Parameters:
  • message – the BaseMessage, 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

send_webhook(topic: str, payload: dict)[source]

Dispatch a webhook. DEPRECATED: use the event bus instead.

Parameters:
  • topic – the webhook topic identifier
  • payload – the webhook payload value
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.base_message.BaseMessage, str, bytes], **kwargs) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Convert a message to an OutboundMessage and send it.

send_outbound(message: aries_cloudagent.transport.outbound.message.OutboundMessage) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Send an outbound message.

send_reply(message: Union[aries_cloudagent.messaging.base_message.BaseMessage, str, bytes], **kwargs) → aries_cloudagent.transport.outbound.status.OutboundSendStatus[source]

Send a reply to an incoming message.

send_webhook(topic: str, payload: dict)[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_now() → datetime.datetime[source]

Timestamp in UTC.

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.util.str_to_epoch(dt: Union[str, datetime.datetime]) → int[source]

Convert an indy-standard datetime string to epoch seconds.

Parameters:dt – May be a string or datetime to allow automatic conversion
aries_cloudagent.messaging.util.time_now() → str[source]

Timestamp in ISO format.

aries_cloudagent.messaging.valid module

Validators for schema fields.

class aries_cloudagent.messaging.valid.Base58SHA256Hash[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against base58 encoding of SHA-256 hash.

EXAMPLE = 'H3C2AVvLMv6gmMNam3uVAjZpfkcJCwDwnZn6z3wXmqPV'
PATTERN = '^[<sphinx.ext.autodoc.importer._MockObject object>]{43,44}$'
class aries_cloudagent.messaging.valid.Base64[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate base64 value.

EXAMPLE = 'ey4uLn0='
PATTERN = '^[a-zA-Z0-9+/]*={0,2}$'
class aries_cloudagent.messaging.valid.Base64URL[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate base64 value.

EXAMPLE = 'ey4uLn0='
PATTERN = '^[-_a-zA-Z0-9]*={0,2}$'
class aries_cloudagent.messaging.valid.Base64URLNoPad[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate base64 value.

EXAMPLE = 'ey4uLn0'
PATTERN = '^[-_a-zA-Z0-9]*$'
class aries_cloudagent.messaging.valid.CredentialContext[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Credential Context.

EXAMPLE = ['https://www.w3.org/2018/credentials/v1', 'https://www.w3.org/2018/credentials/examples/v1']
FIRST_CONTEXT = 'https://www.w3.org/2018/credentials/v1'
class aries_cloudagent.messaging.valid.CredentialSubject[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Credential subject.

EXAMPLE = {'alumniOf': {'id': 'did:example:c276e12ec21ebfeb1f712ebc6f1'}, 'id': 'did:example:ebfeb1f712ebc6f1c276e12ec21'}
class aries_cloudagent.messaging.valid.CredentialType[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Credential Type.

CREDENTIAL_TYPE = 'VerifiableCredential'
EXAMPLE = ['VerifiableCredential', 'AlumniCredential']
class aries_cloudagent.messaging.valid.DIDKey[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against DID key specification.

EXAMPLE = 'did:key:z6MkpTHR8VNsBxYAAWHut2Geadd9jSwuBV8xRoAnwWsdvktH'
PATTERN = re.compile('^did:key:z[<sphinx.ext.autodoc.importer._MockObject object>]+$')
class aries_cloudagent.messaging.valid.DIDPosture[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against defined DID postures.

EXAMPLE = 'wallet_only'
class aries_cloudagent.messaging.valid.DIDValidation[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against any valid DID spec.

EXAMPLE = 'did:peer:WgWxqztrNooG92RXvxSTWv'
FRAGMENT = '(\\#.*)?$'
METHOD = '([a-zA-Z0-9_]+)'
METHOD_ID = '([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)'
PARAMS = '((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)'
PATH = '(\\/[^#?]*)?'
PATTERN = re.compile('^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\\/[^#?]*)?([?][^#]*)?(\\#.*)?$$')
QUERY = '([?][^#]*)?'
class aries_cloudagent.messaging.valid.DIDWeb[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against did:web specification.

EXAMPLE = 'did:web:example.com'
PATTERN = re.compile('^(did:web:)([a-zA-Z0-9%._-]*:)*[a-zA-Z0-9%._-]+$')
class aries_cloudagent.messaging.valid.DictOrDictListField(*args, **kwargs)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Dict or Dict List field for Marshmallow.

class aries_cloudagent.messaging.valid.Endpoint[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against endpoint URL on any scheme.

EXAMPLE = 'https://myhost:8021'
PATTERN = '^[A-Za-z0-9\\.\\-\\+]+://([A-Za-z0-9][.A-Za-z0-9-]+[A-Za-z0-9])+(:[1-9][0-9]*)?(/[^?&#]+)?$'
class aries_cloudagent.messaging.valid.EndpointType[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against allowed endpoint/service types.

EXAMPLE = 'Endpoint'
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'
PATTERN = '^([<sphinx.ext.autodoc.importer._MockObject object>]{21,22}):3:CL:(([1-9][0-9]*)|([<sphinx.ext.autodoc.importer._MockObject object>]{21,22}:2:.+:[0-9.]+)):(.+)?$'
class aries_cloudagent.messaging.valid.IndyCredRevId[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against indy credential revocation identifier specification.

EXAMPLE = '12345'
PATTERN = '^[1-9][0-9]*$'
class aries_cloudagent.messaging.valid.IndyDID[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against indy DID.

EXAMPLE = 'WgWxqztrNooG92RXvxSTWv'
PATTERN = re.compile('^(did:sov:)?[<sphinx.ext.autodoc.importer._MockObject object>]{21,22}$')
class aries_cloudagent.messaging.valid.IndyExtraWQL[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value as potential extra WQL query in cred search for proof req.

EXAMPLE = '{"0_drink_uuid": {"attr::drink::value": "martini"}}'
PATTERN = '^{\\s*".*?"\\s*:\\s*{.*?}\\s*(,\\s*".*?"\\s*:\\s*{.*?}\\s*)*\\s*}$'
class aries_cloudagent.messaging.valid.IndyISO8601DateTime[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against ISO 8601 datetime format, indy profile.

EXAMPLE = '2021-07-15 14:59:18Z'
PATTERN = '^\\d{4}-\\d\\d-\\d\\d[T ]\\d\\d:\\d\\d(?:\\:(?:\\d\\d(?:\\.\\d{1,6})?))?(?:[+-]\\d\\d:?\\d\\d|Z|)$'
class aries_cloudagent.messaging.valid.IndyOrKeyDID[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Indy or Key DID class.

EXAMPLE = 'WgWxqztrNooG92RXvxSTWv'
PATTERN = '^did:key:z[<sphinx.ext.autodoc.importer._MockObject object>]+$|^(did:sov:)?[<sphinx.ext.autodoc.importer._MockObject object>]{21,22}$'
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'
PATTERN = '^[<sphinx.ext.autodoc.importer._MockObject object>]{43,44}$'
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'
PATTERN = '^([<sphinx.ext.autodoc.importer._MockObject object>]{21,22}):4:([<sphinx.ext.autodoc.importer._MockObject object>]{21,22}):3:CL:(([1-9][0-9]*)|([<sphinx.ext.autodoc.importer._MockObject object>]{21,22}:2:.+:[0-9.]+))(:.+)?:CL_ACCUM:(.+$)'
class aries_cloudagent.messaging.valid.IndyRevRegSize[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value as indy revocation registry size.

EXAMPLE = 1000
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'
PATTERN = '^[<sphinx.ext.autodoc.importer._MockObject object>]{21,22}:2:.+:[0-9.]+$'
class aries_cloudagent.messaging.valid.IndyVersion[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against indy version specification.

EXAMPLE = '1.0'
PATTERN = '^[0-9.]+$'
class aries_cloudagent.messaging.valid.IndyWQL[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value as potential WQL query.

EXAMPLE = '{"attr::name::value": "Alex"}'
PATTERN = '^{.*}$'
class aries_cloudagent.messaging.valid.IntEpoch[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against (integer) epoch format.

EXAMPLE = 1626361158
class aries_cloudagent.messaging.valid.JSONWebToken[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate JSON Web Token.

EXAMPLE = 'eyJhbGciOiJFZERTQSJ9.eyJhIjogIjAifQ.dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk'
PATTERN = '^[-_a-zA-Z0-9]*\\.[-_a-zA-Z0-9]*\\.[-_a-zA-Z0-9]*$'
class aries_cloudagent.messaging.valid.JWSHeaderKid[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against JWS header kid.

EXAMPLE = 'did:sov:LjgpST2rjsoxYegQDRm7EL#keys-4'
PATTERN = '^did:(?:key:z[<sphinx.ext.autodoc.importer._MockObject object>]+|sov:[<sphinx.ext.autodoc.importer._MockObject object>]{21,22}(;.*)?(\\?.*)?#.+)$'
class aries_cloudagent.messaging.valid.MaybeIndyDID[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against any valid DID spec or a short Indy DID.

EXAMPLE = 'did:peer:WgWxqztrNooG92RXvxSTWv'
PATTERN = re.compile('^(did:sov:)?[<sphinx.ext.autodoc.importer._MockObject object>]{21,22}$|^did:([a-zA-Z0-9_]+):([a-zA-Z0-9_.%-]+(:[a-zA-Z0-9_.%-]+)*)((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(\\/[^#?]*)
class aries_cloudagent.messaging.valid.NaturalNumber[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value as positive integer.

EXAMPLE = 10
class aries_cloudagent.messaging.valid.NumericStrNatural[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against natural number numeric string.

EXAMPLE = '1'
PATTERN = '^[1-9][0-9]*$'
class aries_cloudagent.messaging.valid.NumericStrWhole[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against whole number numeric string.

EXAMPLE = '0'
PATTERN = '^[0-9]*$'
class aries_cloudagent.messaging.valid.RFC3339DateTime[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against RFC3339 datetime format.

EXAMPLE = '2010-01-01T19:23:24Z'
PATTERN = '^([0-9]{4})-([0-9]{2})-([0-9]{2})([Tt ]([0-9]{2}):([0-9]{2}):([0-9]{2})(\\.[0-9]+)?)?(([Zz]|([+-])([0-9]{2}):([0-9]{2})))?$'
class aries_cloudagent.messaging.valid.SHA256Hash[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate (binhex-encoded) SHA256 value.

EXAMPLE = '617a48c7c8afe0521efdc03e5bb0ad9e655893e6b4b51f0e794d70fba132aacb'
PATTERN = '^[a-fA-F0-9+/]{64}$'
class aries_cloudagent.messaging.valid.StrOrDictField(*args, **kwargs)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

URI or Dict field for Marshmallow.

class aries_cloudagent.messaging.valid.StrOrNumberField(*args, **kwargs)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

String or Number field for Marshmallow.

class aries_cloudagent.messaging.valid.UUIDFour[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate UUID4: 8-4-4-4-12 hex digits, the 13th of which being 4.

EXAMPLE = '3fa85f64-5717-4562-b3fc-2c963f66afa6'
PATTERN = '[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-4[a-fA-F0-9]{3}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}'
class aries_cloudagent.messaging.valid.Uri[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value against URI on any scheme.

EXAMPLE = 'https://www.w3.org/2018/credentials/v1'
PATTERN = '\\w+:(\\/?\\/?)[^\\s]+'
class aries_cloudagent.messaging.valid.UriOrDictField(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.valid.StrOrDictField

URI or Dict field for Marshmallow.

class aries_cloudagent.messaging.valid.WholeNumber[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Validate value as non-negative integer.

EXAMPLE = 0
aries_cloudagent.multitenant package
Subpackages
aries_cloudagent.multitenant.admin package
Submodules
aries_cloudagent.multitenant.admin.routes module

Multitenant admin routes.

class aries_cloudagent.multitenant.admin.routes.CreateWalletRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for adding a new wallet which will be registered by the agent.

image_url = <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.'})>
key_management_mode = <fields.String(default='managed', attribute=None, validate=<OneOf(choices=('managed',), 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.'})>
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.'})>
validate_fields(data, **kwargs)[source]

Validate schema fields.

Parameters:data – The data to validate
Raises:ValidationError – If any of the fields do not validate
wallet_dispatch_type = <fields.String(default='default', attribute=None, validate=<OneOf(choices=['default', 'both', 'base'], 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.'})>
wallet_key = <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.'})>
wallet_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.'})>
wallet_type = <fields.String(default='in_memory', attribute=None, validate=<OneOf(choices=['askar', 'in_memory', 'indy'], 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.'})>
wallet_webhook_urls = <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 aries_cloudagent.multitenant.admin.routes.CreateWalletResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.wallet.models.wallet_record.WalletRecordSchema

Response schema for creating a wallet.

token = <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.multitenant.admin.routes.CreateWalletTokenRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for creating a wallet token.

wallet_key = <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.multitenant.admin.routes.CreateWalletTokenResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for creating a wallet token.

token = <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.multitenant.admin.routes.MultitenantModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for multitenant module.

class aries_cloudagent.multitenant.admin.routes.RemoveWalletRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for removing a wallet.

wallet_key = <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.multitenant.admin.routes.UpdateWalletRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for updating a existing wallet.

image_url = <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.'})>
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.'})>
wallet_dispatch_type = <fields.String(default='default', attribute=None, validate=<OneOf(choices=['default', 'both', 'base'], 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.'})>
wallet_webhook_urls = <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 aries_cloudagent.multitenant.admin.routes.WalletIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking wallet id.

wallet_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.'})>
class aries_cloudagent.multitenant.admin.routes.WalletListQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for wallet list request query string.

wallet_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.'})>
class aries_cloudagent.multitenant.admin.routes.WalletListSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for wallet list.

results = <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.'})>
aries_cloudagent.multitenant.admin.routes.format_wallet_record(wallet_record: aries_cloudagent.wallet.models.wallet_record.WalletRecord)[source]

Serialize a WalletRecord object.

aries_cloudagent.multitenant.admin.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053e87ad0>)[source]

Amend swagger API.

aries_cloudagent.multitenant.admin.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053e87ad0>)[source]

Register routes.

aries_cloudagent.multitenant.admin.routes.wallet_create(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053e87ad0>)[source]

Request handler for adding a new subwallet for handling by the agent.

Parameters:request – aiohttp request object
aries_cloudagent.multitenant.admin.routes.wallet_create_token(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053e87ad0>)[source]

Request handler for creating an authorization token for a specific subwallet.

Parameters:request – aiohttp request object
aries_cloudagent.multitenant.admin.routes.wallet_get(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053e87ad0>)[source]

Request handler for getting a single subwallet.

Parameters:request – aiohttp request object
Raises:HTTPNotFound – if wallet_id does not match any known wallets
aries_cloudagent.multitenant.admin.routes.wallet_remove(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053e87ad0>)[source]

Request handler to remove a subwallet from agent and storage.

Parameters:request – aiohttp request object.
aries_cloudagent.multitenant.admin.routes.wallet_update(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053e87ad0>)[source]

Request handler for updating a existing subwallet for handling by the agent.

Parameters:request – aiohttp request object
aries_cloudagent.multitenant.admin.routes.wallets_list(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053e87ad0>)[source]

Request handler for listing all internal subwallets.

Parameters:request – aiohttp request object
Submodules
aries_cloudagent.multitenant.error module

Multitenant error classes.

exception aries_cloudagent.multitenant.error.WalletKeyMissingError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Wallet key missing exception.

aries_cloudagent.multitenant.manager module

Manager for multitenancy.

class aries_cloudagent.multitenant.manager.MultitenantManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for handling multitenancy.

add_key(wallet_id: str, recipient_key: str, *, skip_if_exists: bool = False)[source]

Add a wallet key to map incoming messages to specific subwallets.

Parameters:
  • wallet_id – The wallet id the key corresponds to
  • recipient_key – The recipient key belonging to the wallet
  • skip_if_exists – Whether to skip the action if the key is already registered for relaying / mediation
create_auth_token(wallet_record: aries_cloudagent.wallet.models.wallet_record.WalletRecord, wallet_key: str = None) → str[source]

Create JWT auth token for specified wallet record.

Parameters:
  • wallet_record – The wallet record to create the token for
  • wallet_key – The wallet key to include in the token. Only required for “unmanaged” wallets
Raises:

WalletKeyMissingError – If the wallet key is missing. Only thrown for “unmanaged” wallets

Returns:

JWT auth token

Return type:

str

create_wallet(settings: dict, key_management_mode: str) → aries_cloudagent.wallet.models.wallet_record.WalletRecord[source]

Create new wallet and wallet record.

Parameters:
  • settings – The context settings for this wallet
  • key_management_mode – The mode to use for key management. Either “unmanaged” to not store the wallet key, or “managed” to store the wallet key
Raises:

MultitenantManagerError – If the wallet name already exists

Returns:

The newly created wallet record

Return type:

WalletRecord

get_default_mediator() → Optional[aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord][source]

Retrieve the default mediator used for subwallet routing.

Returns:retrieved default mediator or None if not set
Return type:Optional[MediationRecord]
get_profile_for_token(context: aries_cloudagent.config.injection_context.InjectionContext, token: str) → aries_cloudagent.core.profile.Profile[source]

Get the profile associated with a JWT header token.

Parameters:
  • context – The context to use for profile creation
  • token – The token
Raises:
  • WalletKeyMissingError – If the wallet_key is missing for an unmanaged wallet
  • InvalidTokenError – If there is an exception while decoding the token
Returns:

Profile associated with the token

get_wallet_profile(base_context: aries_cloudagent.config.injection_context.InjectionContext, wallet_record: aries_cloudagent.wallet.models.wallet_record.WalletRecord, extra_settings: dict = {}, *, provision=False) → aries_cloudagent.core.profile.Profile[source]

Get profile for a wallet record.

Parameters:
  • base_context – Base context to extend from
  • wallet_record – Wallet record to get the context for
  • extra_settings – Any extra context settings
Returns:

Profile for the wallet record

Return type:

Profile

get_wallets_by_message(message_body, wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat = None) → List[aries_cloudagent.wallet.models.wallet_record.WalletRecord][source]

Get the wallet records associated with the message boy.

Parameters:
  • message_body – The body of the message
  • wire_format – Wire format to use for recipient detection
Returns:

Wallet records associated with the message body

get_webhook_urls(base_context: aries_cloudagent.config.injection_context.InjectionContext, wallet_record: aries_cloudagent.wallet.models.wallet_record.WalletRecord) → list[source]

Get the webhook urls according to dispatch_type.

Parameters:
  • base_context – Base context to get base_webhook_urls
  • wallet_record – Wallet record to get dispatch_type and webhook_urls
Returns:

webhook urls according to dispatch_type

remove_wallet(wallet_id: str, wallet_key: str = None)[source]

Remove the wallet with specified wallet id.

Parameters:
  • wallet_id – The wallet id of the wallet record
  • wallet_key – The wallet key to open the wallet. Only required for “unmanaged” wallets
Raises:

WalletKeyMissingError – If the wallet key is missing. Only thrown for “unmanaged” wallets

update_wallet(wallet_id: str, new_settings: dict) → aries_cloudagent.wallet.models.wallet_record.WalletRecord[source]

Update a existing wallet and wallet record.

Parameters:
  • wallet_id – The wallet id of the wallet record
  • new_settings – The context settings to be updated for this wallet
Returns:

The updated wallet record

Return type:

WalletRecord

exception aries_cloudagent.multitenant.manager.MultitenantManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Generic multitenant error.

aries_cloudagent.protocols package
Subpackages
aries_cloudagent.protocols.actionmenu package
Subpackages
aries_cloudagent.protocols.actionmenu.v1_0 package
Subpackages
aries_cloudagent.protocols.actionmenu.v1_0.handlers package
Submodules
aries_cloudagent.protocols.actionmenu.v1_0.handlers.menu_handler module

Action menu message handler.

class aries_cloudagent.protocols.actionmenu.v1_0.handlers.menu_handler.MenuHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for action menus.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for action menus.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.actionmenu.v1_0.handlers.menu_request_handler module

Action menu request message handler.

class aries_cloudagent.protocols.actionmenu.v1_0.handlers.menu_request_handler.MenuRequestHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for action menu requests.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for action menu requests.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.actionmenu.v1_0.handlers.perform_handler module

Action menu perform request message handler.

class aries_cloudagent.protocols.actionmenu.v1_0.handlers.perform_handler.PerformHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for action menu perform requests.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for action menu perform requests.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.actionmenu.v1_0.messages package
Submodules
aries_cloudagent.protocols.actionmenu.v1_0.messages.menu module

Represents an action menu.

class aries_cloudagent.protocols.actionmenu.v1_0.messages.menu.Menu(*, title: str = None, description: str = None, errormsg: str = None, options: Sequence[aries_cloudagent.protocols.actionmenu.v1_0.models.menu_option.MenuOption] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing an action menu.

class Meta[source]

Bases: object

Metadata for an action menu.

handler_class = 'aries_cloudagent.protocols.actionmenu.v1_0.handlers.menu_handler.MenuHandler'
message_type = 'action-menu/1.0/menu'
schema_class = 'MenuSchema'
class aries_cloudagent.protocols.actionmenu.v1_0.messages.menu.MenuSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Menu schema class.

class Meta[source]

Bases: object

Menu schema metadata.

model_class

alias of Menu

unknown = 'exclude'
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.'})>
errormsg = <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.'})>
options = <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.'})>
title = <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.'})>
aries_cloudagent.protocols.actionmenu.v1_0.messages.menu_request module

Represents a request for an action menu.

class aries_cloudagent.protocols.actionmenu.v1_0.messages.menu_request.MenuRequest(**kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a request for an action menu.

class Meta[source]

Bases: object

Metadata for action menu request.

handler_class = 'aries_cloudagent.protocols.actionmenu.v1_0.handlers.menu_request_handler.MenuRequestHandler'
message_type = 'action-menu/1.0/menu-request'
schema_class = 'MenuRequestSchema'
class aries_cloudagent.protocols.actionmenu.v1_0.messages.menu_request.MenuRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

MenuRequest schema class.

class Meta[source]

Bases: object

MenuRequest schema metadata.

model_class

alias of MenuRequest

unknown = 'exclude'
aries_cloudagent.protocols.actionmenu.v1_0.messages.perform module

Represents a request to perform a menu action.

class aries_cloudagent.protocols.actionmenu.v1_0.messages.perform.Perform(*, name: str = None, params: Mapping[str, str] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a request to perform a menu action.

class Meta[source]

Bases: object

Perform metadata.

handler_class = 'aries_cloudagent.protocols.actionmenu.v1_0.handlers.perform_handler.PerformHandler'
message_type = 'action-menu/1.0/perform'
schema_class = 'PerformSchema'
class aries_cloudagent.protocols.actionmenu.v1_0.messages.perform.PerformSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Perform schema class.

class Meta[source]

Bases: object

Perform schema metadata.

model_class

alias of Perform

unknown = 'exclude'
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.'})>
params = <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.'})>
aries_cloudagent.protocols.actionmenu.v1_0.models package
Submodules
aries_cloudagent.protocols.actionmenu.v1_0.models.menu_form module

Record used to represent the form associated with an action menu option.

class aries_cloudagent.protocols.actionmenu.v1_0.models.menu_form.MenuForm(*, title: str = None, description: str = None, params: Sequence[aries_cloudagent.protocols.actionmenu.v1_0.models.menu_form_param.MenuFormParam] = None, submit_label: str = None)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Instance of a form associated with an action menu item.

class Meta[source]

Bases: object

Menu form metadata.

schema_class = 'MenuFormSchema'
class aries_cloudagent.protocols.actionmenu.v1_0.models.menu_form.MenuFormSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

MenuForm schema.

class Meta[source]

Bases: object

MenuFormSchema metadata.

model_class

alias of MenuForm

unknown = 'exclude'
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.'})>
params = <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.'})>
submit_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.'})>
title = <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.'})>
aries_cloudagent.protocols.actionmenu.v1_0.models.menu_form_param module

Record used to represent a parameter in a menu form.

class aries_cloudagent.protocols.actionmenu.v1_0.models.menu_form_param.MenuFormParam(*, name: str = None, title: str = None, default: str = None, description: str = None, input_type: str = None, required: bool = None)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Instance of a menu form param associated with an action menu option.

class Meta[source]

Bases: object

Menu form param metadata.

schema_class = 'MenuFormParamSchema'
class aries_cloudagent.protocols.actionmenu.v1_0.models.menu_form_param.MenuFormParamSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

MenuFormParam schema.

class Meta[source]

Bases: object

MenuFormParamSchema metadata.

model_class

alias of MenuFormParam

unknown = 'exclude'
default = <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.'})>
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.'})>
input_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.'})>
required = <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.'})>
title = <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.'})>
aries_cloudagent.protocols.actionmenu.v1_0.models.menu_option module

Record used to represent individual menu options in an action menu.

class aries_cloudagent.protocols.actionmenu.v1_0.models.menu_option.MenuOption(*, name: str = None, title: str = None, description: str = None, disabled: bool = None, form: aries_cloudagent.protocols.actionmenu.v1_0.models.menu_form.MenuForm = None)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Instance of a menu option associated with an action menu.

class Meta[source]

Bases: object

Menu option metadata.

schema_class = 'MenuOptionSchema'
class aries_cloudagent.protocols.actionmenu.v1_0.models.menu_option.MenuOptionSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

MenuOption schema.

class Meta[source]

Bases: object

MenuOptionSchema metadata.

model_class

alias of MenuOption

unknown = 'exclude'
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.'})>
disabled = <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.'})>
form = <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.'})>
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.'})>
title = <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.actionmenu.v1_0.base_service module

Base action menu service classes.

class aries_cloudagent.protocols.actionmenu.v1_0.base_service.BaseMenuService(context: aries_cloudagent.config.injection_context.InjectionContext)[source]

Bases: abc.ABC

Base action menu service interface.

get_active_menu(profile: aries_cloudagent.core.profile.Profile, connection: aries_cloudagent.connections.models.conn_record.ConnRecord = None, thread_id: str = None) → aries_cloudagent.protocols.actionmenu.v1_0.messages.menu.Menu[source]

Render the current menu.

Parameters:
  • profile – The profile
  • connection – The active connection record
  • thread_id – The thread identifier from the requesting message.
perform_menu_action(profile: aries_cloudagent.core.profile.Profile, action_name: str, action_params: dict, connection: aries_cloudagent.connections.models.conn_record.ConnRecord = None, thread_id: str = None) → aries_cloudagent.messaging.agent_message.AgentMessage[source]

Perform an action defined by the active menu.

Parameters:
  • profile – The profile
  • action_name – The unique name of the action being performed
  • action_params – A collection of parameters for the action
  • connection – The active connection record
  • thread_id – The thread identifier from the requesting message.
classmethod service_handler()[source]

Quick accessor for conductor to use.

aries_cloudagent.protocols.actionmenu.v1_0.controller module

Protocol controller for the action menu message family.

class aries_cloudagent.protocols.actionmenu.v1_0.controller.Controller(protocol: str)[source]

Bases: object

Action menu protocol controller.

determine_roles(context: aries_cloudagent.config.injection_context.InjectionContext) → Sequence[str][source]

Determine what action menu roles are defined.

aries_cloudagent.protocols.actionmenu.v1_0.driver_service module

Driver-based action menu service classes.

class aries_cloudagent.protocols.actionmenu.v1_0.driver_service.DriverMenuService(context: aries_cloudagent.config.injection_context.InjectionContext)[source]

Bases: aries_cloudagent.protocols.actionmenu.v1_0.base_service.BaseMenuService

Driver-based action menu service.

get_active_menu(profile: aries_cloudagent.core.profile.Profile, connection: aries_cloudagent.connections.models.conn_record.ConnRecord = None, thread_id: str = None) → aries_cloudagent.protocols.actionmenu.v1_0.messages.menu.Menu[source]

Render the current menu.

Parameters:
  • profile – The profile
  • connection – The active connection record
  • thread_id – The thread identifier from the requesting message.
perform_menu_action(profile: aries_cloudagent.core.profile.Profile, action_name: str, action_params: dict, connection: aries_cloudagent.connections.models.conn_record.ConnRecord = None, thread_id: str = None) → aries_cloudagent.messaging.agent_message.AgentMessage[source]

Perform an action defined by the active menu.

Parameters:
  • profile – The profile
  • action_name – The unique name of the action being performed
  • action_params – A collection of parameters for the action
  • connection – The active connection record
  • thread_id – The thread identifier from the requesting message.
aries_cloudagent.protocols.actionmenu.v1_0.message_types module

Message type identifiers for Action Menus.

aries_cloudagent.protocols.actionmenu.v1_0.routes module

Action menu admin routes.

class aries_cloudagent.protocols.actionmenu.v1_0.routes.ActionMenuFetchResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for action-menu fetch.

result = <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.'})>
class aries_cloudagent.protocols.actionmenu.v1_0.routes.ActionMenuModulesResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Schema for the modules endpoint.

class aries_cloudagent.protocols.actionmenu.v1_0.routes.MenuConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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.'})>
class aries_cloudagent.protocols.actionmenu.v1_0.routes.MenuJsonSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Matches MenuSchema but without the inherited AgentMessage properties.

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.'})>
errormsg = <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.'})>
options = <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.'})>
title = <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.protocols.actionmenu.v1_0.routes.PerformRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for performing a menu action.

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.'})>
params = <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.'})>
class aries_cloudagent.protocols.actionmenu.v1_0.routes.SendMenuSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for sending a menu to a connection.

menu = <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.'})>
aries_cloudagent.protocols.actionmenu.v1_0.routes.actionmenu_close(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f75d50>)[source]

Request handler for closing the menu associated with a connection.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.actionmenu.v1_0.routes.actionmenu_fetch(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f75d50>)[source]

Request handler for fetching the previously-received menu for a connection.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.actionmenu.v1_0.routes.actionmenu_perform(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f75d50>)[source]

Request handler for performing a menu action.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.actionmenu.v1_0.routes.actionmenu_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f75d50>)[source]

Request handler for requesting a menu from the connection target.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.actionmenu.v1_0.routes.actionmenu_send(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f75d50>)[source]

Request handler for requesting a menu from the connection target.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.actionmenu.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f75d50>)[source]

Amend swagger API.

aries_cloudagent.protocols.actionmenu.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053f75d50>)[source]

Register routes.

aries_cloudagent.protocols.actionmenu.v1_0.util module

Action menu utility methods.

aries_cloudagent.protocols.actionmenu.v1_0.util.retrieve_connection_menu(connection_id: str, context: aries_cloudagent.admin.request_context.AdminRequestContext) → aries_cloudagent.protocols.actionmenu.v1_0.messages.menu.Menu[source]

Retrieve the previously-received action menu.

aries_cloudagent.protocols.actionmenu.v1_0.util.save_connection_menu(menu: aries_cloudagent.protocols.actionmenu.v1_0.messages.menu.Menu, connection_id: str, context: aries_cloudagent.admin.request_context.AdminRequestContext)[source]

Save a received action menu.

Submodules
aries_cloudagent.protocols.actionmenu.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.basicmessage package
Subpackages
aries_cloudagent.protocols.basicmessage.v1_0 package
Subpackages
aries_cloudagent.protocols.basicmessage.v1_0.handlers package
Submodules
aries_cloudagent.protocols.basicmessage.v1_0.handlers.basicmessage_handler module

Basic message handler.

class aries_cloudagent.protocols.basicmessage.v1_0.handlers.basicmessage_handler.BasicMessageHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for basic messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for basic messages.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.basicmessage.v1_0.messages package
Submodules
aries_cloudagent.protocols.basicmessage.v1_0.messages.basicmessage module

Basic message.

class aries_cloudagent.protocols.basicmessage.v1_0.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 Meta[source]

Bases: object

Basic message metadata class.

handler_class = 'aries_cloudagent.protocols.basicmessage.v1_0.handlers.basicmessage_handler.BasicMessageHandler'
message_type = 'basicmessage/1.0/message'
schema_class = 'BasicMessageSchema'
class aries_cloudagent.protocols.basicmessage.v1_0.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

unknown = 'exclude'
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.'})>
Submodules
aries_cloudagent.protocols.basicmessage.v1_0.message_types module

Message type identifiers for Connections.

aries_cloudagent.protocols.basicmessage.v1_0.routes module

Basic message admin routes.

class aries_cloudagent.protocols.basicmessage.v1_0.routes.BasicConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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.'})>
class aries_cloudagent.protocols.basicmessage.v1_0.routes.BasicMessageModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Basic Message Module.

class aries_cloudagent.protocols.basicmessage.v1_0.routes.SendMessageSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for sending a message.

content = <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.'})>
aries_cloudagent.protocols.basicmessage.v1_0.routes.connections_send_message(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0541c3790>)[source]

Request handler for sending a basic message to a connection.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.basicmessage.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0541c3790>)[source]

Amend swagger API.

aries_cloudagent.protocols.basicmessage.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0541c3790>)[source]

Register routes.

Submodules
aries_cloudagent.protocols.basicmessage.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.connections package
Subpackages
aries_cloudagent.protocols.connections.v1_0 package
Subpackages
aries_cloudagent.protocols.connections.v1_0.handlers package
Submodules
aries_cloudagent.protocols.connections.v1_0.handlers.connection_invitation_handler module

Connect invitation handler.

class aries_cloudagent.protocols.connections.v1_0.handlers.connection_invitation_handler.ConnectionInvitationHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for connection invitations.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle connection invitation.

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.connections.v1_0.handlers.connection_request_handler module

Connection request handler.

class aries_cloudagent.protocols.connections.v1_0.handlers.connection_request_handler.ConnectionRequestHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for connection requests.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle connection request.

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.connections.v1_0.handlers.connection_response_handler module

Connection response handler.

class aries_cloudagent.protocols.connections.v1_0.handlers.connection_response_handler.ConnectionResponseHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for connection responses.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle connection response.

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.connections.v1_0.messages package
Submodules
aries_cloudagent.protocols.connections.v1_0.messages.connection_invitation module

Represents an invitation message for establishing connection.

class aries_cloudagent.protocols.connections.v1_0.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.v1_0.handlers.connection_invitation_handler.ConnectionInvitationHandler'
message_type = 'connections/1.0/invitation'
schema_class = 'ConnectionInvitationSchema'
classmethod from_url(url: str) → aries_cloudagent.protocols.connections.v1_0.messages.connection_invitation.ConnectionInvitation[source]

Parse a URL-encoded invitation into a ConnectionInvitation message.

Parameters:url – Url to decode
Returns:A ConnectionInvitation object.
to_url(base_url: str = None) → str[source]

Convert an invitation to URL format for sharing.

Returns:An invite url
class aries_cloudagent.protocols.connections.v1_0.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

unknown = 'exclude'
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.'})>
validate_fields(data, **kwargs)[source]

Validate schema fields.

Parameters:data – The data to validate
Raises:ValidationError – If any of the fields do not validate
aries_cloudagent.protocols.connections.v1_0.messages.connection_request module

Represents a connection request message.

class aries_cloudagent.protocols.connections.v1_0.messages.connection_request.ConnectionRequest(*, connection: aries_cloudagent.protocols.connections.v1_0.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.v1_0.handlers.connection_request_handler.ConnectionRequestHandler'
message_type = 'connections/1.0/request'
schema_class = 'ConnectionRequestSchema'
class aries_cloudagent.protocols.connections.v1_0.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

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.connections.v1_0.messages.connection_response module

Represents a connection response message.

class aries_cloudagent.protocols.connections.v1_0.messages.connection_response.ConnectionResponse(*, connection: aries_cloudagent.protocols.connections.v1_0.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.v1_0.handlers.connection_response_handler.ConnectionResponseHandler'
message_type = 'connections/1.0/response'
schema_class = 'ConnectionResponseSchema'
class aries_cloudagent.protocols.connections.v1_0.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',)
unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.connections.v1_0.messages.problem_report module

Represents a connection problem report message.

class aries_cloudagent.protocols.connections.v1_0.messages.problem_report.ConnectionProblemReport(*, 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 Meta[source]

Bases: object

Connection problem report metadata.

handler_class = 'aries_cloudagent.messaging.problem_report.handler.ProblemReportHandler'
message_type = 'connections/1.0/problem_report'
schema_class = 'ConnectionProblemReportSchema'
class aries_cloudagent.protocols.connections.v1_0.messages.problem_report.ConnectionProblemReportSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Schema for ConnectionProblemReport base class.

class Meta[source]

Bases: object

Metadata for connection problem report schema.

model_class

alias of ConnectionProblemReport

unknown = 'exclude'
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.v1_0.messages.problem_report.ProblemReportReason[source]

Bases: enum.Enum

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'
aries_cloudagent.protocols.connections.v1_0.models package
Submodules
aries_cloudagent.protocols.connections.v1_0.models.connection_detail module

An object for containing the connection request/response DID information.

class aries_cloudagent.protocols.connections.v1_0.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 aries_cloudagent.protocols.connections.v1_0.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

alias of ConnectionDetail

unknown = 'exclude'
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 aries_cloudagent.protocols.connections.v1_0.models.connection_detail.DIDDocWrapper(*, default: Any = <marshmallow.missing>, missing: Any = <marshmallow.missing>, data_key: str = None, attribute: str = None, validate: Union[Callable[[Any], Any], Iterable[Callable[[Any], Any]]] = None, required: bool = False, allow_none: bool = None, load_only: bool = False, dump_only: bool = False, error_messages: Dict[str, str] = None, **metadata)[source]

Bases: marshmallow.fields.Field

Field that loads and serializes DIDDoc.

Submodules
aries_cloudagent.protocols.connections.v1_0.manager module

Classes to manage connections.

class aries_cloudagent.protocols.connections.v1_0.manager.ConnectionManager(session: aries_cloudagent.core.profile.ProfileSession)[source]

Bases: aries_cloudagent.connections.base_manager.BaseConnectionManager

Class for managing connections.

accept_response(response: aries_cloudagent.protocols.connections.v1_0.messages.connection_response.ConnectionResponse, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.connections.models.conn_record.ConnRecord[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 ConnRecord representing the connection

Raises:
create_invitation(my_label: str = None, my_endpoint: str = None, auto_accept: bool = None, public: bool = False, multi_use: bool = False, alias: str = None, routing_keys: Sequence[str] = None, recipient_keys: Sequence[str] = None, metadata: dict = None, mediation_id: str = None) → Tuple[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.connections.v1_0.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": "https://didcomm.org/connections/1.0/invitation",
    "label": "Alice",
    "did": "did:sov:QmWbsNYhMrjHiqZDTUTEJs"
}

Or, in the case of a peer DID:

{
    "@type": "https://didcomm.org/connections/1.0/invitation",
    "label": "Alice",
    "did": "did:peer:oiSqsNYhMrjHiqZDTUthsw",
    "recipient_keys": ["8HH5gYEeNc3z7PYXmd54d4x6qAfCNrqQqEB3nS7Zfu7K"],
    "service_endpoint": "https://example.com/endpoint"
    "routing_keys": ["9EH5gYEeNc3z7PYXmd53d5x6qAfCNrqQqEB4nS7Zfu6K"],
}
Parameters:
  • my_label – label for this connection
  • my_endpoint – endpoint where other party can reach me
  • auto_accept – auto-accept a corresponding connection request (None to use config)
  • public – set 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 ConnRecord and ConnectionInvitation instances

create_request(connection: aries_cloudagent.connections.models.conn_record.ConnRecord, my_label: str = None, my_endpoint: str = None, mediation_id: str = None) → aries_cloudagent.protocols.connections.v1_0.messages.connection_request.ConnectionRequest[source]

Create a new connection request for a previously-received invitation.

Parameters:
  • connection – The ConnRecord 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.conn_record.ConnRecord, my_endpoint: str = None, mediation_id: str = None) → aries_cloudagent.protocols.connections.v1_0.messages.connection_response.ConnectionResponse[source]

Create a connection response for a received connection request.

Parameters:
  • connection – The ConnRecord with a pending connection request
  • my_endpoint – The endpoint I can be reached at
  • mediation_id – The record id for mediation that contains routing_keys and
  • endpoint (service) –
Returns:

A tuple of the updated ConnRecord 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_label: str = None, alias: str = None) → Tuple[aries_cloudagent.wallet.did_info.DIDInfo, aries_cloudagent.wallet.did_info.DIDInfo, aries_cloudagent.connections.models.conn_record.ConnRecord][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
  • alias – an alias for this connection record
Returns:

my DIDInfo, their DIDInfo, new ConnRecord instance

Return type:

Tuple

establish_inbound(connection: aries_cloudagent.connections.models.conn_record.ConnRecord, inbound_connection_id: str, outbound_handler: Coroutine[T_co, T_contra, V_co]) → str[source]

Assign the inbound routing connection for a connection record.

Returns: the current routing state (request or done)

find_connection(their_did: str, my_did: str = None, my_verkey: str = None, auto_complete=False) → aries_cloudagent.connections.models.conn_record.ConnRecord[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 ConnRecord, if any

find_inbound_connection(receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Deserialize an incoming message and further populate the request context.

Parameters:receipt – The message receipt
Returns:The ConnRecord associated with the expanded message, if any
get_connection_targets(*, connection_id: str = None, connection: aries_cloudagent.connections.models.conn_record.ConnRecord = None)[source]

Create a connection target from a ConnRecord.

Parameters:
  • connection_id – The connection ID to search for
  • connection – The connection record itself, if already available
get_endpoints(conn_id: str) → Tuple[str, str][source]

Get connection endpoints.

Parameters:conn_id – connection identifier
Returns:Their endpoint for this connection
receive_invitation(invitation: aries_cloudagent.protocols.connections.v1_0.messages.connection_invitation.ConnectionInvitation, their_public_did: str = None, auto_accept: bool = None, alias: str = None, mediation_id: str = None, mediation_record: aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Create a new connection record to track a received invitation.

Parameters:
  • invitation – The ConnectionInvitation to store
  • auto_accept – set to auto-accept the invitation (None to use config)
  • alias – optional alias to set on the record
Returns:

The new ConnRecord instance

receive_request(request: aries_cloudagent.protocols.connections.v1_0.messages.connection_request.ConnectionRequest, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt, mediation_id: str = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Receive and store a connection request.

Parameters:
  • request – The ConnectionRequest to accept
  • receipt – The message receipt
Returns:

The new or updated ConnRecord instance

resolve_inbound_connection(receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Populate the receipt DID information and find the related ConnRecord.

Parameters:receipt – The message receipt
Returns:The ConnRecord associated with the expanded message, if any
session

Accessor for the current profile session.

Returns:The profile session for this connection manager
update_inbound(inbound_connection_id: str, recip_verkey: str, routing_state: str)[source]

Activate connections once a route has been established.

Looks up pending connections associated with the inbound routing connection and marks the routing as complete.

exception aries_cloudagent.protocols.connections.v1_0.manager.ConnectionManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Connection error.

aries_cloudagent.protocols.connections.v1_0.message_types module

Message type identifiers for Connections.

aries_cloudagent.protocols.connections.v1_0.routes module

Connection handling admin routes.

class aries_cloudagent.protocols.connections.v1_0.routes.AcceptInvitationQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for accept invitation request query string.

mediation_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
my_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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.'})>
my_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.'})>
class aries_cloudagent.protocols.connections.v1_0.routes.AcceptRequestQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for accept conn-request web-request query string.

my_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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 aries_cloudagent.protocols.connections.v1_0.routes.ConnIdRefIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection and ref ids.

conn_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.'})>
ref_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.'})>
class aries_cloudagent.protocols.connections.v1_0.routes.ConnectionListSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for connection list.

results = <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 aries_cloudagent.protocols.connections.v1_0.routes.ConnectionMetadataQuerySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query schema for metadata.

key = <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.protocols.connections.v1_0.routes.ConnectionMetadataSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for connection metadata.

results = <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.'})>
class aries_cloudagent.protocols.connections.v1_0.routes.ConnectionMetadataSetRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request Schema for set metadata.

metadata = <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.'})>
class aries_cloudagent.protocols.connections.v1_0.routes.ConnectionModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for connection module.

class aries_cloudagent.protocols.connections.v1_0.routes.ConnectionStaticRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for a new static connection.

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.'})>
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.'})>
my_seed = <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_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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_seed = <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_verkey = <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.protocols.connections.v1_0.routes.ConnectionStaticResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for new static connection.

mv_verkey = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRawPublicKey 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.'})>
my_did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID 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.'})>
my_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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.'})>
record = <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.'})>
their_did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID 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.'})>
their_verkey = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRawPublicKey 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.'})>
class aries_cloudagent.protocols.connections.v1_0.routes.ConnectionsConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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.'})>
class aries_cloudagent.protocols.connections.v1_0.routes.ConnectionsListQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for connections list request query 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_protocol = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['connections/1.0', 'didexchange/1.0'], 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.'})>
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.'})>
state = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices={'invitation', 'abandoned', 'completed', 'error', 'active', 'request', 'start', 'init', 'response'}, 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.'})>
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_role = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['invitee', 'requester', 'inviter', 'responder'], 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.connections.v1_0.routes.CreateInvitationQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for create invitation request query 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.'})>
auto_accept = <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.'})>
multi_use = <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.'})>
public = <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.'})>
class aries_cloudagent.protocols.connections.v1_0.routes.CreateInvitationRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for invitation connection target.

mediation_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
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.'})>
my_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.'})>
service_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.'})>
class aries_cloudagent.protocols.connections.v1_0.routes.EndpointsResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for connection endpoints.

my_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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 aries_cloudagent.protocols.connections.v1_0.routes.InvitationResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for a new connection invitation.

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.'})>
invitation = <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.'})>
invitation_url = <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.protocols.connections.v1_0.routes.ReceiveInvitationQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for receive invitation request query 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.'})>
auto_accept = <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.'})>
mediation_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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 aries_cloudagent.protocols.connections.v1_0.routes.ReceiveInvitationRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.protocols.connections.v1_0.messages.connection_invitation.ConnectionInvitationSchema

Request schema for receive invitation request.

validate_fields(data, **kwargs)[source]

Bypass middleware field validation: marshmallow has no data yet.

aries_cloudagent.protocols.connections.v1_0.routes.connection_sort_key(conn)[source]

Get the sorting key for a particular connection.

aries_cloudagent.protocols.connections.v1_0.routes.connections_accept_invitation(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for accepting a stored connection invitation.

Parameters:request – aiohttp request object
Returns:The resulting connection record details
aries_cloudagent.protocols.connections.v1_0.routes.connections_accept_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for accepting a stored connection request.

Parameters:request – aiohttp request object
Returns:The resulting connection record details
aries_cloudagent.protocols.connections.v1_0.routes.connections_create_invitation(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for creating a new connection invitation.

Parameters:request – aiohttp request object
Returns:The connection invitation details
aries_cloudagent.protocols.connections.v1_0.routes.connections_create_static(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for creating a new static connection.

Parameters:request – aiohttp request object
Returns:The new connection record
aries_cloudagent.protocols.connections.v1_0.routes.connections_endpoints(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for fetching connection endpoints.

Parameters:request – aiohttp request object
Returns:The endpoints response
aries_cloudagent.protocols.connections.v1_0.routes.connections_establish_inbound(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for setting the inbound connection on a connection record.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.connections.v1_0.routes.connections_list(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for searching connection records.

Parameters:request – aiohttp request object
Returns:The connection list response
aries_cloudagent.protocols.connections.v1_0.routes.connections_metadata(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Handle fetching metadata associated with a single connection record.

aries_cloudagent.protocols.connections.v1_0.routes.connections_metadata_set(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Handle fetching metadata associated with a single connection record.

aries_cloudagent.protocols.connections.v1_0.routes.connections_receive_invitation(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for receiving a new connection invitation.

Parameters:request – aiohttp request object
Returns:The resulting connection record details
aries_cloudagent.protocols.connections.v1_0.routes.connections_remove(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for removing a connection record.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.connections.v1_0.routes.connections_retrieve(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Request handler for fetching a single connection record.

Parameters:request – aiohttp request object
Returns:The connection record response
aries_cloudagent.protocols.connections.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Amend swagger API.

aries_cloudagent.protocols.connections.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054fa2450>)[source]

Register routes.

Submodules
aries_cloudagent.protocols.connections.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.coordinate_mediation package
Subpackages
aries_cloudagent.protocols.coordinate_mediation.v1_0 package
Subpackages
aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers package
Submodules
aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_handler module

Handler for keylist message.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_handler.KeylistHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for keylist message.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle keylist message.

aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_query_handler module

Handler for keylist-query message.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_query_handler.KeylistQueryHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for keylist-query message.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle keylist-query message.

aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_update_handler module

Handler for keylist-update messages.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_update_handler.KeylistUpdateHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for keylist-update messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle keylist-update messages.

aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_update_response_handler module

Handler for keylist-update-response message.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_update_response_handler.KeylistUpdateResponseHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for keylist-update-response message.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle keylist-update-response message.

aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_deny_handler module

Handler for mediate-deny message.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_deny_handler.MediationDenyHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for mediate-deny message.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle mediate-deny message.

aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_grant_handler module

Handler for mediate-grant message.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_grant_handler.MediationGrantHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for mediate-grant message.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle mediate-grant message.

aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_request_handler module

Handler for mediate-request message.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_request_handler.MediationRequestHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for mediate-request message.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle mediate-request message.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages package
Subpackages
aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner package
Submodules
aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_key module

Inner structure of keylist message. Represents a single item in keylist.keys.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_key.KeylistKey(*, recipient_key: str = None, action: str = None, result: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Inner structure of Keylist keys attribute.

class Meta[source]

Bases: object

KeylistKey metadata.

schema_class = 'KeylistKeySchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_key.KeylistKeySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

KeylistKey schema.

class Meta[source]

Bases: object

KeylistKeySchema metadata.

model_class

alias of KeylistKey

unknown

Used by autodoc_mock_imports.

recipient_key

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_query_paginate module

Inner structure of KeylistQuery. Represents KeylistQuery.paginate.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_query_paginate.KeylistQueryPaginate(limit: int, offset: int, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Class representing a keylist query pagination.

class Meta[source]

Bases: object

Keylist query pagination metadata.

schema_class = 'KeylistQueryPaginateSchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_query_paginate.KeylistQueryPaginateSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Keylist query pagination schema.

class Meta[source]

Bases: object

Keylist query pagination schema metadata.

model_class

alias of KeylistQueryPaginate

limit

Used by autodoc_mock_imports.

offset

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_update_rule module

Inner structure of keylist-update message.

Represents single item of keylist-update.updates.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_update_rule.KeylistUpdateRule(recipient_key: str, action: str, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Class representing a keylist update rule.

class Meta[source]

Bases: object

Keylist update metadata.

schema_class = 'KeylistUpdateRuleSchema'
RULE_ADD = 'add'
RULE_REMOVE = 'remove'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_update_rule.KeylistUpdateRuleSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Keylist update specification schema.

class Meta[source]

Bases: object

Keylist update schema metadata.

model_class

alias of KeylistUpdateRule

action

Used by autodoc_mock_imports.

recipient_key

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_updated module

Inner structure of keylist-update-response.

Represents single item in keylist-update-response.updated list.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_updated.KeylistUpdated(*, 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.

class Meta[source]

Bases: object

KeylistUpdated metadata.

schema_class = 'KeylistUpdatedSchema'
RESULT_CLIENT_ERROR = 'client_error'
RESULT_NO_CHANGE = 'no_change'
RESULT_SERVER_ERROR = 'server_error'
RESULT_SUCCESS = 'success'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_updated.KeylistUpdatedSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

KeylistUpdated schema.

class Meta[source]

Bases: object

KeylistUpdatedSchema metadata.

model_class

alias of KeylistUpdated

unknown

Used by autodoc_mock_imports.

action

Used by autodoc_mock_imports.

recipient_key

Used by autodoc_mock_imports.

result

Used by autodoc_mock_imports.

Submodules
aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist module

Response to keylist-query message.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist.Keylist(*, keys: Sequence[str] = None, pagination: aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_query_paginate.KeylistQueryPaginate = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a keylist-query response.

class Meta[source]

Bases: object

Metadata for a keylist query response.

handler_class = 'aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_handler.KeylistHandler'
message_type = 'coordinate-mediation/1.0/keylist'
schema_class = 'KeylistSchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist.KeylistSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Keylist query response schema class.

class Meta[source]

Bases: object

Keylist query response schema metadata.

model_class

alias of Keylist

keys

Used by autodoc_mock_imports.

pagination

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_query module

keylist-query message used to request list of keys handled by mediator.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_query.KeylistQuery(*, filter: dict = None, paginate: aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_query_paginate.KeylistQueryPaginate = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a keylist query message.

class Meta[source]

Bases: object

Metadata for a keylist query.

handler_class = 'aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_query_handler.KeylistQueryHandler'
message_type = 'coordinate-mediation/1.0/keylist-query'
schema_class = 'KeylistQuerySchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_query.KeylistQuerySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Keylist query schema class.

class Meta[source]

Bases: object

Keylist query schema metadata.

model_class

alias of KeylistQuery

filter

Used by autodoc_mock_imports.

paginate

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update module

keylist-update message used to notify mediator of keylist changes.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update.KeylistUpdate(*, updates: Sequence[aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_update_rule.KeylistUpdateRule] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a keylist update message.

class Meta[source]

Bases: object

Metadata for a keylist update.

handler_class = 'aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_update_handler.KeylistUpdateHandler'
message_type = 'coordinate-mediation/1.0/keylist-update'
schema_class = 'KeylistUpdateSchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update.KeylistUpdateSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Keylist update schema class.

class Meta[source]

Bases: object

Keylist update schema metadata.

model_class

alias of KeylistUpdate

updates

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update_response module

Response to keylist-update used to notify mediation client of applied updates.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update_response.KeylistUpdateResponse(*, updated: Sequence[aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_updated.KeylistUpdated] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a keylist update result message.

class Meta[source]

Bases: object

Metadata for a keylist update result.

handler_class = 'aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.keylist_update_response_handler.KeylistUpdateResponseHandler'
message_type = 'coordinate-mediation/1.0/keylist-update-response'
schema_class = 'KeylistUpdateResponseSchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update_response.KeylistUpdateResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Keylist update result schema class.

class Meta[source]

Bases: object

Keylist update result schema metadata.

model_class

alias of KeylistUpdateResponse

updated

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_deny module

mediate-deny message used to notify mediation client of a denied mediation request.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_deny.MediationDeny(*, mediator_terms: Sequence[str] = None, recipient_terms: Sequence[str] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a mediation deny message.

class Meta[source]

Bases: object

Metadata for a mediation deny.

handler_class = 'aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_deny_handler.MediationDenyHandler'
message_type = 'coordinate-mediation/1.0/mediate-deny'
schema_class = 'MediationDenySchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_deny.MediationDenySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Mediation grant schema class.

class Meta[source]

Bases: object

Mediation deny schema metadata.

model_class

alias of MediationDeny

mediator_terms

Used by autodoc_mock_imports.

recipient_terms

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_grant module

mediate-grant message.

Used to notify mediation client of a granted mediation request.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_grant.MediationGrant(*, endpoint: str = None, routing_keys: Sequence[str] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a mediation grant message.

class Meta[source]

Bases: object

Metadata for a mediation grant.

handler_class = 'aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_grant_handler.MediationGrantHandler'
message_type = 'coordinate-mediation/1.0/mediate-grant'
schema_class = 'MediationGrantSchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_grant.MediationGrantSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Mediation grant schema class.

class Meta[source]

Bases: object

Mediation grant schema metadata.

model_class

alias of MediationGrant

endpoint

Used by autodoc_mock_imports.

routing_keys

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_request module

mediate-request message used to request mediation from a mediator.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_request.MediationRequest(*, mediator_terms: Sequence[str] = None, recipient_terms: Sequence[str] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Represents a request for mediation.

class Meta[source]

Bases: object

MediationRequest metadata.

handler_class = 'aries_cloudagent.protocols.coordinate_mediation.v1_0.handlers.mediation_request_handler.MediationRequestHandler'
message_type = 'coordinate-mediation/1.0/mediate-request'
schema_class = 'MediationRequestSchema'
class aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_request.MediationRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Mediation request schema class.

class Meta[source]

Bases: object

Mediation request schema metadata.

model_class

alias of MediationRequest

mediator_terms

Used by autodoc_mock_imports.

recipient_terms

Used by autodoc_mock_imports.

aries_cloudagent.protocols.coordinate_mediation.v1_0.models package
Submodules
aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record module

Store state for Mediation requests.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord(*, mediation_id: str = None, state: str = None, role: str = None, connection_id: str = None, mediator_terms: Sequence[str] = None, recipient_terms: Sequence[str] = None, routing_keys: Sequence[str] = None, endpoint: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Class representing stored mediation information.

class Meta[source]

Bases: object

RouteRecord metadata.

schema_class = 'MediationRecordSchema'
RECORD_ID_NAME = 'mediation_id'
RECORD_TYPE = 'mediation_requests'
ROLE_CLIENT = 'client'
ROLE_SERVER = 'server'
STATE_DENIED = 'denied'
STATE_GRANTED = 'granted'
STATE_REQUEST = 'request'
TAG_NAMES = {'connection_id', 'role', 'state'}
classmethod exists_for_connection_id(session: aries_cloudagent.core.profile.ProfileSession, connection_id: str) → bool[source]

Return whether a mediation record exists for the given connection.

Parameters:
Returns:

whether record exists

Return type:

bool

mediation_id

Get Mediation ID.

record_value

Return values of record as dictionary.

classmethod retrieve_by_connection_id(session: aries_cloudagent.core.profile.ProfileSession, connection_id: str) → aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord[source]

Retrieve a mediation record by connection ID.

Parameters:
Returns:

retrieved record

Return type:

MediationRecord

state

Get Mediation state.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

MediationRecordSchema schema.

class Meta[source]

Bases: object

MediationRecordSchema metadata.

model_class

alias of MediationRecord

unknown

Used by autodoc_mock_imports.

connection_id

Used by autodoc_mock_imports.

endpoint

Used by autodoc_mock_imports.

mediation_id

Used by autodoc_mock_imports.

mediator_terms

Used by autodoc_mock_imports.

recipient_terms

Used by autodoc_mock_imports.

role

Used by autodoc_mock_imports.

routing_keys

Used by autodoc_mock_imports.

Submodules
aries_cloudagent.protocols.coordinate_mediation.v1_0.manager module

Manager for Mediation coordination.

exception aries_cloudagent.protocols.coordinate_mediation.v1_0.manager.MediationAlreadyExists(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.protocols.coordinate_mediation.v1_0.manager.MediationManagerError

Raised on mediation record already exists for given connection.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.manager.MediationManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for handling Mediation.

MediationManager creates or retrieves a routing DID as a means to hand out a consistent routing key to mediation clients.

DEFAULT_MEDIATOR_RECORD_TYPE = 'default_mediator'
ROUTING_DID_RECORD_TYPE = 'routing_did'
SEND_REQ_AFTER_CONNECTION = 'send_mediation_request_on_connection'
SET_TO_DEFAULT_ON_GRANTED = 'set_to_default_on_granted'
add_key(recipient_key: str, message: Optional[aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update.KeylistUpdate] = None) → aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update.KeylistUpdate[source]

Prepare a keylist update add.

Parameters:
  • recipient_key (str) – key to add
  • message (Optional[KeylistUpdate]) – append update to message
Returns:

Message to send to mediator to notify of key addition.

Return type:

KeylistUpdate

clear_default_mediator()[source]

Clear the stored default mediator.

create_keylist_query_response(keylist: Sequence[aries_cloudagent.protocols.routing.v1_0.models.route_record.RouteRecord]) → aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist.Keylist[source]

Prepare a keylist message from keylist.

Parameters:keylist (Sequence[RouteRecord]) – keylist to format into message
Returns:message to return to client
Return type:Keylist
deny_request(mediation_id: str, *, mediator_terms: Sequence[str] = None, recipient_terms: Sequence[str] = None) → Tuple[aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord, aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_deny.MediationDeny][source]

Deny a mediation request and prepare a deny message.

Parameters:
  • mediation_id – mediation record ID to deny
  • mediator_terms (Sequence[str]) – updated mediator terms to return to
  • requester.
  • recipient_terms (Sequence[str]) – updated recipient terms to return to
  • requester.
Returns:

message to return to denied client.

Return type:

MediationDeny

get_default_mediator() → Optional[aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord][source]

Retrieve default mediator from the store.

Returns:retrieved default mediator or None if not set
Return type:Optional[MediationRecord]
get_default_mediator_id() → Optional[str][source]

Retrieve default mediator ID from the store.

Returns:retrieved default mediator ID or None if not set
Return type:Optional[str]
get_keylist(record: aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord) → Sequence[aries_cloudagent.protocols.routing.v1_0.models.route_record.RouteRecord][source]

Retrieve keylist for mediation client.

Parameters:record (MediationRecord) – record associated with client keylist
Returns:sequence of routes (the keylist)
Return type:Sequence[RouteRecord]
get_my_keylist(connection_id: Optional[str] = None) → Sequence[aries_cloudagent.protocols.routing.v1_0.models.route_record.RouteRecord][source]

Get my routed keys.

Parameters:connection_id (Optional[str]) – connection id of mediator
Returns:list of routes (the keylist)
Return type:Sequence[RouteRecord]
grant_request(mediation_id: str) → Tuple[aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord, aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_grant.MediationGrant][source]

Grant a mediation request and prepare grant message.

Parameters:mediation_id – mediation record ID to grant
Returns:updated mediation record and message to return to grantee
Return type:(MediationRecord, MediationGrant)
prepare_keylist_query(filter_: dict = None, paginate_limit: int = -1, paginate_offset: int = 0) → aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_query.KeylistQuery[source]

Prepare keylist query message.

Parameters:
  • filter (dict) – filter for keylist query
  • paginate_limit (int) – paginate_limit
  • paginate_offset (int) – paginate_offset
Returns:

message to send to mediator

Return type:

KeylistQuery

prepare_request(connection_id: str, mediator_terms: Sequence[str] = None, recipient_terms: Sequence[str] = None) → Tuple[aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord, aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_request.MediationRequest][source]

Prepare a MediationRequest Message, saving a new mediation record.

Parameters:
  • connection_id (str) – ID representing mediator
  • mediator_terms (Sequence[str]) – mediator_terms
  • recipient_terms (Sequence[str]) – recipient_terms
Returns:

message to send to mediator

Return type:

MediationRequest

receive_request(connection_id: str, request: aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_request.MediationRequest) → aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord[source]

Create a new mediation record to track this request.

Parameters:request (MediationRequest) – request message
Returns:record created during receipt of request.
Return type:MediationRecord
remove_key(recipient_key: str, message: Optional[aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update.KeylistUpdate] = None) → aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update.KeylistUpdate[source]

Prepare keylist update remove.

Parameters:
  • recipient_key (str) – key to remove
  • message (Optional[KeylistUpdate]) – append update to message
Returns:

Message to send to mediator to notify of key removal.

Return type:

KeylistUpdate

request_denied(record: aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord, deny: aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_deny.MediationDeny)[source]

Process mediation denied message.

Parameters:record (MediationRecord) – record representing the denied mediation request
request_granted(record: aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord, grant: aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.mediate_grant.MediationGrant)[source]

Process mediation grant message.

Parameters:record (MediationRecord) – record representing the granted mediation request
set_default_mediator(record: aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord)[source]

Set default mediator from record.

set_default_mediator_by_id(mediation_id: str)[source]

Set default mediator from ID.

store_update_results(connection_id: str, results: Sequence[aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_updated.KeylistUpdated])[source]

Store results of keylist update from keylist update response message.

Parameters:
  • connection_id (str) – connection ID of mediator sending results
  • results (Sequence[KeylistUpdated]) – keylist update results
  • session – An active profile session
update_keylist(record: aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord, updates: Sequence[aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.inner.keylist_update_rule.KeylistUpdateRule]) → aries_cloudagent.protocols.coordinate_mediation.v1_0.messages.keylist_update_response.KeylistUpdateResponse[source]

Update routes defined in keylist update rules.

Parameters:
Returns:

message to return to client

Return type:

KeylistUpdateResponse

exception aries_cloudagent.protocols.coordinate_mediation.v1_0.manager.MediationManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Generic Mediation error.

exception aries_cloudagent.protocols.coordinate_mediation.v1_0.manager.MediationNotGrantedError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.protocols.coordinate_mediation.v1_0.manager.MediationManagerError

Raised when mediation state should be granted and is not.

aries_cloudagent.protocols.coordinate_mediation.v1_0.message_types module

Message type identifiers for Coordinate Mediation protocol.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes module

coordinate mediation admin routes.

class aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.AdminMediationDenySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for Mediation deny admin request query string.

mediator_terms = <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.'})>
recipient_terms = <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 aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.GetKeylistQuerySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Get keylist query string paramaters.

conn_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
role = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['client', 'server'], labels=[], error='Must be one of: {choices}.')>, required=False, load_only=False, dump_only=False, missing=server, 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.coordinate_mediation.v1_0.routes.KeylistQueryFilterRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for keylist query filtering.

filter = <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.'})>
class aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.KeylistQueryPaginateQuerySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query string schema for keylist query pagination.

paginate_limit = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=-1, 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.'})>
paginate_offset = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=0, 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 aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.KeylistSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for mediation list query.

results = <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 aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.KeylistUpdateRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

keylist update request schema.

updates = <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 aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.MediationCreateRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for create Mediation request query string.

mediator_terms = <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.'})>
recipient_terms = <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 aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.MediationIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking mediation request id.

mediation_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
class aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.MediationListQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for mediation record list request query string.

conn_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
mediator_terms = <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.'})>
recipient_terms = <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.'})>
state = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['request', 'granted', 'denied'], 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.coordinate_mediation.v1_0.routes.MediationListSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for mediation list query.

results = <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.'})>
aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.clear_default_mediator(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Clear set default mediator.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.delete_mediation_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Delete a mediation request by ID.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.get_default_mediator(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Get default mediator.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.get_keylist(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Retrieve keylists by connection or role.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.list_mediation_requests(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

List mediation requests for either client or server role.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.mediation_request_deny(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Deny a stored mediation request.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.mediation_request_grant(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Grant a stored mediation request.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.mediation_sort_key(mediation: dict)[source]

Get the sorting key for a particular serialized mediation record.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Amend swagger API.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Register routes.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.request_mediation(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Request mediation from connection.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.retrieve_mediation_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Retrieve a single mediation request.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.send_keylist_query(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Send keylist query to mediator.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.send_keylist_update(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Send keylist update to mediator.

aries_cloudagent.protocols.coordinate_mediation.v1_0.routes.set_default_mediator(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0540b4950>)[source]

Set default mediator.

Submodules
aries_cloudagent.protocols.coordinate_mediation.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.didexchange package
Subpackages
aries_cloudagent.protocols.didexchange.v1_0 package
Subpackages
aries_cloudagent.protocols.didexchange.v1_0.handlers package
Submodules
aries_cloudagent.protocols.didexchange.v1_0.handlers.complete_handler module

Connection complete handler under RFC 23 (DID exchange).

class aries_cloudagent.protocols.didexchange.v1_0.handlers.complete_handler.DIDXCompleteHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for connection complete message under RFC 23 (DID exchange).

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle connection complete under RFC 23 (DID exchange).

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.didexchange.v1_0.handlers.invitation_handler module

Connect invitation handler under RFC 23 (DID exchange).

class aries_cloudagent.protocols.didexchange.v1_0.handlers.invitation_handler.InvitationHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for connection invitation message under RFC 23 (DID exchange).

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle connection invitation under RFC 23 (DID exchange).

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.didexchange.v1_0.handlers.request_handler module

Connection request handler under RFC 23 (DID exchange).

class aries_cloudagent.protocols.didexchange.v1_0.handlers.request_handler.DIDXRequestHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for connection request message under RFC 23 (DID exchange).

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle connection request under RFC 23 (DID exchange).

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.didexchange.v1_0.handlers.response_handler module

DID exchange response handler under RFC 23.

class aries_cloudagent.protocols.didexchange.v1_0.handlers.response_handler.DIDXResponseHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for DID exchange response message under RFC 23.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle DID exchange response under RFC 23.

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.didexchange.v1_0.messages package
Submodules
aries_cloudagent.protocols.didexchange.v1_0.messages.complete module

Represents a DID exchange complete message under RFC 23.

class aries_cloudagent.protocols.didexchange.v1_0.messages.complete.DIDXComplete(**kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a DID exchange completion.

class Meta[source]

Bases: object

Metadata for DID exchange completion.

handler_class = 'aries_cloudagent.protocols.didexchange.v1_0.handlers.complete_handler.DIDXCompleteHandler'
message_type = 'didexchange/1.0/complete'
schema_class = 'DIDXCompleteSchema'
class aries_cloudagent.protocols.didexchange.v1_0.messages.complete.DIDXCompleteSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

DID exchange complete schema class.

class Meta[source]

Bases: object

DID exchange complete schema metadata.

model_class

alias of DIDXComplete

unknown

Used by autodoc_mock_imports.

check_thread_deco(obj, **kwargs)[source]

Thread decorator, and its thid and pthid, are mandatory.

aries_cloudagent.protocols.didexchange.v1_0.messages.problem_report module
aries_cloudagent.protocols.didexchange.v1_0.messages.request module

Represents a DID exchange request message under RFC 23.

class aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest(*, label: str = None, did: str = None, did_doc_attach: aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a DID exchange request under RFC 23.

class Meta[source]

Bases: object

Metadata for DID exchange request under RFC 23.

handler_class = 'aries_cloudagent.protocols.didexchange.v1_0.handlers.request_handler.DIDXRequestHandler'
message_type = 'didexchange/1.0/request'
schema_class = 'DIDXRequestSchema'
class aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Schema class for DID exchange request under RFC 23.

class Meta[source]

Bases: object

DID exchange request schema class metadata.

model_class

alias of DIDXRequest

unknown

Used by autodoc_mock_imports.

did

Used by autodoc_mock_imports.

did_doc_attach

Used by autodoc_mock_imports.

label

Used by autodoc_mock_imports.

aries_cloudagent.protocols.didexchange.v1_0.messages.response module

Represents a DID exchange response message under RFC 23.

class aries_cloudagent.protocols.didexchange.v1_0.messages.response.DIDXResponse(*, did: str = None, did_doc_attach: aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a DID exchange response under RFC 23.

class Meta[source]

Bases: object

Metadata for DID exchange response under RFC 23.

handler_class = 'aries_cloudagent.protocols.didexchange.v1_0.handlers.response_handler.DIDXResponseHandler'
message_type = 'didexchange/1.0/response'
schema_class = 'DIDXResponseSchema'
class aries_cloudagent.protocols.didexchange.v1_0.messages.response.DIDXResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Schema class for DID exchange response under RFC 23.

class Meta[source]

Bases: object

DID exchange response schema class metadata.

model_class

alias of DIDXResponse

unknown

Used by autodoc_mock_imports.

did

Used by autodoc_mock_imports.

did_doc_attach

Used by autodoc_mock_imports.

Submodules
aries_cloudagent.protocols.didexchange.v1_0.manager module

Classes to manage connection establishment under RFC 23 (DID exchange).

class aries_cloudagent.protocols.didexchange.v1_0.manager.DIDXManager(session: aries_cloudagent.core.profile.ProfileSession)[source]

Bases: aries_cloudagent.connections.base_manager.BaseConnectionManager

Class for managing connections under RFC 23 (DID exchange).

accept_complete(complete: aries_cloudagent.protocols.didexchange.v1_0.messages.complete.DIDXComplete, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Accept a connection complete message under RFC 23 (DID exchange).

Process a DIDXComplete message by looking up the connection record and marking the exchange complete.

Parameters:
  • complete – The DIDXComplete to accept
  • receipt – The message receipt
Returns:

The updated ConnRecord representing the connection

Raises:

DIDXManagerError – If the corresponding connection does not exist or is not in the response-sent state

accept_response(response: aries_cloudagent.protocols.didexchange.v1_0.messages.response.DIDXResponse, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Accept a connection response under RFC 23 (DID exchange).

Process a DIDXResponse message by looking up the connection request and setting up the pairwise connection.

Parameters:
  • response – The DIDXResponse to accept
  • receipt – The message receipt
Returns:

The updated ConnRecord representing the connection

Raises:
  • DIDXManagerError – If there is no DID associated with the connection response
  • DIDXManagerError – If the corresponding connection is not in the request-sent state
create_request(conn_rec: aries_cloudagent.connections.models.conn_record.ConnRecord, my_label: str = None, my_endpoint: str = None, mediation_id: str = None) → aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest[source]

Create a new connection request for a previously-received invitation.

Parameters:
  • conn_rec – The ConnRecord representing the invitation to accept
  • my_label – My label for request
  • my_endpoint – My endpoint
  • mediation_id – The record id for mediation that contains routing_keys and service endpoint
Returns:

A new DIDXRequest message to send to the other agent

create_request_implicit(their_public_did: str, my_label: str = None, my_endpoint: str = None, mediation_id: str = None, use_public_did: bool = False) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Create and send a request against a public DID only (no explicit invitation).

Parameters:
  • their_public_did – public DID to which to request a connection
  • my_label – my label for request
  • my_endpoint – my endpoint
  • mediation_id – record id for mediation with routing_keys, service endpoint
  • use_public_did – use my public DID for this connection
Returns:

The new ConnRecord instance

create_response(conn_rec: aries_cloudagent.connections.models.conn_record.ConnRecord, my_endpoint: str = None, mediation_id: str = None) → aries_cloudagent.protocols.didexchange.v1_0.messages.response.DIDXResponse[source]

Create a connection response for a received connection request.

Parameters:
  • conn_rec – The ConnRecord with a pending connection request
  • my_endpoint – Current agent endpoint
  • mediation_id – The record id for mediation that contains routing_keys and service endpoint
Returns:

New DIDXResponse message

receive_invitation(invitation: aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage, their_public_did: str = None, auto_accept: bool = None, alias: str = None, mediation_id: str = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Create a new connection record to track a received invitation.

Parameters:
  • invitation – invitation to store
  • their_public_did – their public DID
  • auto_accept – set to auto-accept invitation (None to use config)
  • alias – optional alias to set on record
  • mediation_id – record id for mediation with routing_keys, service endpoint
Returns:

The new ConnRecord instance

receive_request(request: aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest, recipient_did: str, recipient_verkey: str = None, my_endpoint: str = None, alias: str = None, auto_accept_implicit: bool = None, mediation_id: str = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Receive and store a connection request.

Parameters:
  • request – The DIDXRequest to accept
  • recipient_did – The (unqualified) recipient DID
  • recipient_verkey – The recipient verkey: None for public recipient DID
  • my_endpoint – My endpoint
  • alias – Alias for the connection
  • auto_accept – Auto-accept request against implicit invitation
  • mediation_id – The record id for mediation that contains routing_keys and service endpoint
Returns:

The new or updated ConnRecord instance

session

Accessor for the current profile session.

Returns:The profile session for this did exchange manager
verify_diddoc(wallet: aries_cloudagent.wallet.base.BaseWallet, attached: aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator) → aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc[source]

Verify DIDDoc attachment and return signed data.

exception aries_cloudagent.protocols.didexchange.v1_0.manager.DIDXManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Connection error.

aries_cloudagent.protocols.didexchange.v1_0.message_types module

Message type identifiers for Connections.

aries_cloudagent.protocols.didexchange.v1_0.routes module

Connection handling admin routes.

class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXAcceptInvitationQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for accept invitation request query string.

my_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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.'})>
my_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.'})>
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXAcceptRequestQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for accept-request request query string.

mediation_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
my_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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 aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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.'})>
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXConnIdRefIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection and ref ids.

conn_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.'})>
ref_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.'})>
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXCreateRequestImplicitQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for create-request-implicit request query string.

mediation_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
my_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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.'})>
my_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_public_did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.MaybeIndyDID 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.'})>
use_public_did = <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.'})>
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXReceiveRequestImplicitQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for receive-request-implicit request query 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.'})>
auto_accept = <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.'})>
mediation_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
my_endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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.protocols.didexchange.v1_0.routes.didx_accept_invitation(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546d9c50>)[source]

Request handler for accepting a stored connection invitation.

Parameters:request – aiohttp request object
Returns:The resulting connection record details
aries_cloudagent.protocols.didexchange.v1_0.routes.didx_accept_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546d9c50>)[source]

Request handler for accepting a stored connection request.

Parameters:request – aiohttp request object
Returns:The resulting connection record details
aries_cloudagent.protocols.didexchange.v1_0.routes.didx_create_request_implicit(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546d9c50>)[source]

Request handler for creating and sending a request to an implicit invitation.

Parameters:request – aiohttp request object
Returns:The resulting connection record details
aries_cloudagent.protocols.didexchange.v1_0.routes.didx_receive_request_implicit(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546d9c50>)[source]

Request handler for receiving a request against public DID’s implicit invitation.

Parameters:request – aiohttp request object
Returns:The resulting connection record details
aries_cloudagent.protocols.didexchange.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546d9c50>)[source]

Amend swagger API.

aries_cloudagent.protocols.didexchange.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0546d9c50>)[source]

Register routes.

Submodules
aries_cloudagent.protocols.didexchange.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.discovery package
Subpackages
aries_cloudagent.protocols.discovery.v1_0 package
Subpackages
aries_cloudagent.protocols.discovery.v1_0.handlers package
Submodules
aries_cloudagent.protocols.discovery.v1_0.handlers.disclose_handler module

Handler for incoming disclose messages.

class aries_cloudagent.protocols.discovery.v1_0.handlers.disclose_handler.DiscloseHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming disclose messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.discovery.v1_0.handlers.query_handler module

Handler for incoming query messages.

class aries_cloudagent.protocols.discovery.v1_0.handlers.query_handler.QueryHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming query messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.discovery.v1_0.messages package
Submodules
aries_cloudagent.protocols.discovery.v1_0.messages.disclose module

Represents a feature discovery disclosure message.

class aries_cloudagent.protocols.discovery.v1_0.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 Meta[source]

Bases: object

Disclose metadata.

handler_class = 'aries_cloudagent.protocols.discovery.v1_0.handlers.disclose_handler.DiscloseHandler'
message_type = 'discover-features/1.0/disclose'
schema_class = 'DiscloseSchema'
class aries_cloudagent.protocols.discovery.v1_0.messages.disclose.DiscloseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Disclose message schema used in serialization/deserialization.

class Meta[source]

Bases: object

DiscloseSchema metadata.

model_class

alias of Disclose

unknown = 'exclude'
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.v1_0.messages.disclose.ProtocolDescriptorSchema(*, only: Union[Sequence[str], Set[str]] = None, exclude: Union[Sequence[str], Set[str]] = (), many: bool = False, context: Dict[KT, VT] = None, load_only: Union[Sequence[str], Set[str]] = (), dump_only: Union[Sequence[str], Set[str]] = (), partial: Union[bool, Sequence[str], Set[str]] = False, unknown: str = None)[source]

Bases: marshmallow.schema.Schema

Schema for an entry in the protocols list.

opts = <marshmallow.schema.SchemaOpts object>
aries_cloudagent.protocols.discovery.v1_0.messages.query module

Represents a feature discovery query message.

class aries_cloudagent.protocols.discovery.v1_0.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 Meta[source]

Bases: object

Query metadata.

handler_class = 'aries_cloudagent.protocols.discovery.v1_0.handlers.query_handler.QueryHandler'
message_type = 'discover-features/1.0/query'
schema_class = 'QuerySchema'
class aries_cloudagent.protocols.discovery.v1_0.messages.query.QuerySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Query message schema used in serialization/deserialization.

class Meta[source]

Bases: object

QuerySchema metadata.

model_class

alias of Query

unknown = 'exclude'
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.'})>
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.v1_0.message_types module

Message type identifiers for Feature Discovery.

aries_cloudagent.protocols.discovery.v1_0.routes module

Feature discovery admin routes.

class aries_cloudagent.protocols.discovery.v1_0.routes.QueryFeaturesQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query string parameters for feature query.

query = <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.protocols.discovery.v1_0.routes.QueryResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for the protocol list.

results = <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.'})>
aries_cloudagent.protocols.discovery.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054d49390>)[source]

Amend swagger API.

aries_cloudagent.protocols.discovery.v1_0.routes.query_features(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054d49390>)[source]

Request handler for inspecting supported protocols.

Parameters:request – aiohttp request object
Returns:The diclosed protocols response
aries_cloudagent.protocols.discovery.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054d49390>)[source]

Register routes.

Submodules
aries_cloudagent.protocols.discovery.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.introduction package
Subpackages
aries_cloudagent.protocols.introduction.v0_1 package
Subpackages
aries_cloudagent.protocols.introduction.v0_1.handlers package
Submodules
aries_cloudagent.protocols.introduction.v0_1.handlers.forward_invitation_handler module

Handler for incoming forward invitation messages.

class aries_cloudagent.protocols.introduction.v0_1.handlers.forward_invitation_handler.ForwardInvitationHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming forward invitation messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.introduction.v0_1.handlers.invitation_handler module

Handler for incoming invitation messages.

class aries_cloudagent.protocols.introduction.v0_1.handlers.invitation_handler.InvitationHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming invitation messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.introduction.v0_1.handlers.invitation_request_handler module

Handler for incoming invitation request messages.

class aries_cloudagent.protocols.introduction.v0_1.handlers.invitation_request_handler.InvitationRequestHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming invitation request messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.introduction.v0_1.messages package
Submodules
aries_cloudagent.protocols.introduction.v0_1.messages.forward_invitation module

Represents a forwarded invitation from another agent.

class aries_cloudagent.protocols.introduction.v0_1.messages.forward_invitation.ForwardInvitation(*, invitation: aries_cloudagent.protocols.connections.v1_0.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.v0_1.handlers.forward_invitation_handler.ForwardInvitationHandler'
message_type = 'introduction-service/0.1/forward-invitation'
schema_class = 'ForwardInvitationSchema'
class aries_cloudagent.protocols.introduction.v0_1.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.'})>
aries_cloudagent.protocols.introduction.v0_1.messages.invitation module

Represents an invitation returned to the introduction service.

class aries_cloudagent.protocols.introduction.v0_1.messages.invitation.Invitation(*, invitation: aries_cloudagent.protocols.connections.v1_0.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 Meta[source]

Bases: object

Metadata for an invitation.

handler_class = 'aries_cloudagent.protocols.introduction.v0_1.handlers.invitation_handler.InvitationHandler'
message_type = 'introduction-service/0.1/invitation'
schema_class = 'InvitationSchema'
class aries_cloudagent.protocols.introduction.v0_1.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

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.introduction.v0_1.messages.invitation_request module

Represents an request for an invitation from the introduction service.

class aries_cloudagent.protocols.introduction.v0_1.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.v0_1.handlers.invitation_request_handler.InvitationRequestHandler'
message_type = 'introduction-service/0.1/invitation-request'
schema_class = 'InvitationRequestSchema'
class aries_cloudagent.protocols.introduction.v0_1.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

unknown = 'exclude'
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.'})>
Submodules
aries_cloudagent.protocols.introduction.v0_1.base_service module

Introduction service base classes.

class aries_cloudagent.protocols.introduction.v0_1.base_service.BaseIntroductionService[source]

Bases: abc.ABC

Service handler for allowing connections to exchange invitations.

return_invitation(target_connection_id: str, invitation: aries_cloudagent.protocols.introduction.v0_1.messages.invitation.Invitation, session: aries_cloudagent.core.profile.ProfileSession, 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
  • session – Profile session to use for introduction records
  • outbound_handler – The outbound handler coroutine for sending a message
classmethod service_handler()[source]

Quick accessor for conductor to use.

start_introduction(init_connection_id: str, target_connection_id: str, outbound_handler, session: aries_cloudagent.core.profile.ProfileSession, 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
  • session – Profile session to use for connection, introduction records
  • message – The message to use when requesting the invitation
exception aries_cloudagent.protocols.introduction.v0_1.base_service.IntroductionError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Generic introduction service error.

aries_cloudagent.protocols.introduction.v0_1.demo_service module

Introduction service demo classes.

class aries_cloudagent.protocols.introduction.v0_1.demo_service.DemoIntroductionService[source]

Bases: aries_cloudagent.protocols.introduction.v0_1.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.v0_1.messages.invitation.Invitation, session: aries_cloudagent.core.profile.ProfileSession, 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 (Introduction) Invitation message
  • session – Profile session to use for introduction records
  • outbound_handler – The outbound handler coroutine for sending a message
start_introduction(init_connection_id: str, target_connection_id: str, message: str, session: aries_cloudagent.core.profile.ProfileSession, 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
  • session – Profile session to use for connection, introduction records
  • message – The message to use when requesting the invitation
aries_cloudagent.protocols.introduction.v0_1.message_types module

Message type identifiers for Introductions.

aries_cloudagent.protocols.introduction.v0_1.routes module

Introduction service admin routes.

class aries_cloudagent.protocols.introduction.v0_1.routes.IntroConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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.'})>
class aries_cloudagent.protocols.introduction.v0_1.routes.IntroModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Introduction Module.

class aries_cloudagent.protocols.introduction.v0_1.routes.IntroStartQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query string parameters for request to start introduction.

message = <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.'})>
target_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.'})>
aries_cloudagent.protocols.introduction.v0_1.routes.introduction_start(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054718910>)[source]

Request handler for starting an introduction.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.introduction.v0_1.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054718910>)[source]

Amend swagger API.

aries_cloudagent.protocols.introduction.v0_1.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054718910>)[source]

Register routes.

Submodules
aries_cloudagent.protocols.introduction.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.issue_credential package
Subpackages
aries_cloudagent.protocols.issue_credential.v1_0 package
aries_cloudagent.protocols.issue_credential.v1_0.problem_report_for_record(record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange], desc_en: str) → aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_problem_report.CredentialProblemReport[source]

Create problem report for record.

Parameters:
  • record – connection or exchange record
  • desc_en – description text to include in problem report
aries_cloudagent.protocols.issue_credential.v1_0.report_problem(err: aries_cloudagent.core.error.BaseError, desc_en: str, http_error_class, record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange], outbound_handler: Coroutine[T_co, T_contra, V_co])[source]

Send problem report response and raise corresponding HTTP error.

Parameters:
  • err – error for internal diagnostics
  • desc_en – description text to include in problem report (response)
  • http_error_class – HTTP error to raise
  • record – record to cite by thread in problem report
  • outbound_handler – outbound message handler
Subpackages
aries_cloudagent.protocols.issue_credential.v1_0.handlers package
Submodules
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_ack_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential acks.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_issue_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential offers.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_offer_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential offers.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_proposal_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential proposals.

Parameters:
  • context – proposal context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_request_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential requests.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v1_0.messages package
Subpackages
aries_cloudagent.protocols.issue_credential.v1_0.messages.inner package
Submodules
aries_cloudagent.protocols.issue_credential.v1_0.messages.inner.credential_preview module

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 Meta[source]

Bases: object

Attribute preview metadata.

schema_class = 'CredAttrSpecSchema'
b64_decoded_value() → str[source]

Value, base64-decoded if applicable.

static list_plain(plain: dict)[source]

Return a list of CredAttrSpec without MIME types from names/values.

Parameters:plain – dict mapping names to values
Returns:List of CredAttrSpecs with no MIME types
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

unknown = 'exclude'
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 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 = 'issue-credential/1.0/credential-preview'
schema_class = 'CredentialPreviewSchema'
attr_dict(decode: bool = False)[source]

Return name:value pair per attribute.

Parameters:decode – whether first to decode attributes with MIME type
mime_types()[source]

Return per-attribute mapping from name to MIME type.

Return empty dict if no attribute has MIME type.

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

unknown = 'exclude'
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.'})>
Submodules
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_ack module

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 Meta[source]

Bases: object

Credential ack metadata.

handler_class = 'aries_cloudagent.protocols.issue_credential.v1_0.handlers.credential_ack_handler.CredentialAckHandler'
message_type = 'issue-credential/1.0/ack'
schema_class = 'CredentialAckSchema'
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

unknown = 'exclude'
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_issue module

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 = 'issue-credential/1.0/issue-credential'
schema_class = 'CredentialIssueSchema'
indy_credential(index: int = 0)[source]

Retrieve and decode indy credential from attachment.

Parameters:index – ordinal in attachment list to decode and return (typically, list has length 1)
classmethod wrap_indy_credential(indy_cred: dict) → aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator[source]

Convert an indy credential offer to an attachment decorator.

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

unknown = 'exclude'
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.'})>
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.'})>
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_offer module

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 = 'issue-credential/1.0/offer-credential'
schema_class = 'CredentialOfferSchema'
indy_offer(index: int = 0) → dict[source]

Retrieve and decode indy offer from attachment.

Parameters:index – ordinal in attachment list to decode and return (typically, list has length 1)
classmethod wrap_indy_offer(indy_offer: dict) → aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator[source]

Convert an indy credential offer to an attachment decorator.

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

unknown = 'exclude'
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.'})>
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.'})>
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_proposal module

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 = 'issue-credential/1.0/propose-credential'
schema_class = 'CredentialProposalSchema'
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

unknown = 'exclude'
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.'})>
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.'})>
aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_request module

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 = 'issue-credential/1.0/request-credential'
schema_class = 'CredentialRequestSchema'
indy_cred_req(index: int = 0)[source]

Retrieve and decode indy credential request from attachment.

Parameters:index – ordinal in attachment list to decode and return (typically, list has length 1)
classmethod wrap_indy_cred_req(indy_cred_req: dict) → aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator[source]

Convert an indy credential request to an attachment decorator.

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

unknown = 'exclude'
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.'})>
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.'})>
aries_cloudagent.protocols.issue_credential.v1_0.models package

Package-wide code and data.

Submodules
aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange module

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: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_proposal.CredentialProposal] = None, credential_offer_dict: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_offer.CredentialOffer] = None, credential_offer: Union[Mapping[KT, VT_co], aries_cloudagent.indy.models.cred_abstract.IndyCredAbstract] = None, credential_request: [typing.Mapping, <class 'aries_cloudagent.indy.models.cred_request.IndyCredRequest'>] = None, credential_request_metadata: Mapping[KT, VT_co] = None, credential_id: str = None, raw_credential: Union[Mapping[KT, VT_co], aries_cloudagent.indy.models.cred.IndyCredential] = None, credential: Union[Mapping[KT, VT_co], aries_cloudagent.indy.models.cred_precis.IndyCredInfo] = None, revoc_reg_id: str = None, revocation_id: str = None, auto_offer: bool = False, auto_issue: bool = False, auto_remove: bool = True, error_msg: str = None, trace: bool = False, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeRecord

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_TOPIC = 'issue_credential'
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'}
credential

Accessor; get deserialized view.

credential_exchange_id

Accessor for the ID associated with this exchange.

credential_offer

Accessor; get deserialized view.

credential_offer_dict

Accessor; get deserialized view.

credential_proposal_dict

Accessor; get deserialized view.

credential_request

Accessor; get deserialized view.

raw_credential

Accessor; get deserialized view.

record_value

Accessor for the JSON record value generated for this invitation.

classmethod retrieve_by_connection_and_thread(session: aries_cloudagent.core.profile.ProfileSession, 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.

save_error_state(session: aries_cloudagent.core.profile.ProfileSession, *, reason: str = None, log_params: Mapping[str, Any] = None, log_override: bool = False)[source]

Save record error state if need be; log and swallow any storage error.

Parameters:
  • session – The profile session to use
  • reason – A reason to add to the log
  • log_params – Additional parameters to log
  • override – Override configured logging regimen, print to stderr instead
class aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchangeSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeSchema

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.'})>
auto_remove = <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.'})>
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.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.'})>
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.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.'})>
credential_offer_dict = <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.'})>
credential_proposal_dict = <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.'})>
credential_request = <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.'})>
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.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.'})>
revoc_reg_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.'})>
revocation_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.'})>
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.'})>
Submodules
aries_cloudagent.protocols.issue_credential.v1_0.manager module

Classes to manage credentials.

class aries_cloudagent.protocols.issue_credential.v1_0.manager.CredentialManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for managing credentials.

create_offer(cred_ex_record: aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, counter_proposal: aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_proposal.CredentialProposal = None, 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:
  • cred_ex_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, auto_remove: 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, trace: bool = False) → 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
  • auto_remove – Should the record be automatically removed on completion
  • 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(cred_ex_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:
  • cred_ex_record – Credential exchange record for which to create request
  • holder_did – holder DID
Returns:

A tuple (credential exchange record, credential request message)

issue_credential(cred_ex_record: aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange, *, comment: str = None, retries: int = 5) → 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:
  • cred_ex_record – The credential exchange record for which to issue a credential
  • comment – optional human-readable comment pertaining to credential issue
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, auto_remove: bool = None, 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]

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
  • auto_remove – Flag to automatically remove the record on completion
Returns:

A tuple of the new credential exchange record and credential offer message

profile

Accessor for the current profile instance.

Returns:The profile instance for this credential manager
receive_credential(message: aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_issue.CredentialIssue, connection_id: str) → 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(message: aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_ack.CredentialAck, connection_id: str) → 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(message: aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_offer.CredentialOffer, connection_id: str) → aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange[source]

Receive a credential offer.

Returns:The credential exchange record, updated
receive_problem_report(message: aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_problem_report.CredentialProblemReport, connection_id: str)[source]

Receive problem report.

Returns:credential exchange record, retrieved and updated
receive_proposal(message: aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_proposal.CredentialProposal, connection_id: str) → aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange[source]

Receive a credential proposal.

Returns:The resulting credential exchange record, created
receive_request(message: aries_cloudagent.protocols.issue_credential.v1_0.messages.credential_request.CredentialRequest, connection_id: str)[source]

Receive a credential request.

Parameters:credential_request_message – Credential request to receive
Returns:credential exchange record, retrieved and updated
send_credential_ack(cred_ex_record: aries_cloudagent.protocols.issue_credential.v1_0.models.credential_exchange.V10CredentialExchange)[source]

Create, send, and return ack message for input credential exchange record.

Delete credential exchange record if set to auto-remove.

Returns:cred ex record, credential ack message for tracing.
Return type:Tuple
store_credential(cred_ex_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:
  • cred_ex_record – credential exchange record with credential to store and ack
  • credential_id – optional credential identifier to override default on storage
Returns:

Updated credential exchange record

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.

aries_cloudagent.protocols.issue_credential.v1_0.message_types module

Message and inner object type identifiers for Connections.

aries_cloudagent.protocols.issue_credential.v1_0.routes module

Credential exchange admin routes.

class aries_cloudagent.protocols.issue_credential.v1_0.routes.CredExIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking credential exchange id.

cred_ex_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
class aries_cloudagent.protocols.issue_credential.v1_0.routes.CredIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking credential id.

credential_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.'})>
class aries_cloudagent.protocols.issue_credential.v1_0.routes.IssueCredentialModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Issue Credential Module.

class aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CreateFreeOfferResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for creating free offer.

oob_url = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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.'})>
response = <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.'})>
class aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialBoundOfferRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for sending bound credential offer admin message.

counter_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.'})>
class aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialCreateSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Base class for request schema for sending credential proposal admin message.

auto_remove = <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.'})>
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.'})>
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=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.'})>
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 aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialExchangeListQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for credential exchange list query.

connection_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
role = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['issuer', 'holder'], 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=<OneOf(choices=['proposal_sent', 'proposal_received', 'offer_sent', 'offer_received', 'request_sent', 'request_received', 'credential_issued', 'credential_received', 'credential_acked'], 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.'})>
thread_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
class aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialExchangeListResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for Aries#0036 v1.0 credential exchange query.

results = <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 aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialFreeOfferRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Request schema for sending free credential offer admin message.

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_remove = <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.'})>
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.'})>
connection_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
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.'})>
credential_preview = <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_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialIssueRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for sending credential issue admin message.

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 aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialProblemReportRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for sending problem report.

description = <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.issue_credential.v1_0.routes.V10CredentialProposalRequestMandSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialProposalRequestSchemaBase

Request schema for sending credential proposal on mandatory proposal preview.

credential_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 aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialProposalRequestOptSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialProposalRequestSchemaBase

Request schema for sending credential proposal on optional proposal preview.

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.'})>
class aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialProposalRequestSchemaBase(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Base class for request schema for sending credential proposal admin message.

auto_remove = <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.'})>
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.'})>
connection_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
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.'})>
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 aries_cloudagent.protocols.issue_credential.v1_0.routes.V10CredentialStoreRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for sending a credential store admin message.

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.'})>
aries_cloudagent.protocols.issue_credential.v1_0.routes.credential_exchange_create(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542b0890>)[source]

Request handler for creating a credential from attr values.

The internal credential record will be created without the credential being sent to any connection. This can be used in conjunction with the oob protocols to bind messages to an out of band message.

Parameters:request – aiohttp request object
Returns:The credential exchange record
aries_cloudagent.protocols.issue_credential.v1_0.routes.credential_exchange_create_free_offer(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542b0890>)[source]

Request handler for creating free credential offer.

Unlike with send-offer, this credential exchange is not tied to a specific connection. It must be dispatched out-of-band by the controller.

Parameters:request – aiohttp request object
Returns:The credential exchange record
aries_cloudagent.protocols.issue_credential.v1_0.routes.credential_exchange_issue(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542b0890>)[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 0x7fb0542b0890>)[source]

Request handler for searching credential exchange 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 0x7fb0542b0890>)[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 0x7fb0542b0890>)[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 0x7fb0542b0890>)[source]

Request handler for fetching single credential exchange 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 0x7fb0542b0890>)[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 0x7fb0542b0890>)[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 0x7fb0542b0890>)[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 0x7fb0542b0890>)[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 0x7fb0542b0890>)[source]

Request handler for sending credential request.

Parameters:request – aiohttp request object
Returns:The credential exchange record
aries_cloudagent.protocols.issue_credential.v1_0.routes.credential_exchange_store(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542b0890>)[source]

Request handler for storing credential.

Parameters:request – aiohttp request object
Returns:The credential exchange record
aries_cloudagent.protocols.issue_credential.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542b0890>)[source]

Amend swagger API.

aries_cloudagent.protocols.issue_credential.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542b0890>)[source]

Register routes.

aries_cloudagent.protocols.issue_credential.v2_0 package
aries_cloudagent.protocols.issue_credential.v2_0.problem_report_for_record(record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord], desc_en: str) → aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_problem_report.V20CredProblemReport[source]

Create problem report for record.

Parameters:
  • record – connection or exchange record
  • desc_en – description text to include in problem report
aries_cloudagent.protocols.issue_credential.v2_0.report_problem(err: aries_cloudagent.core.error.BaseError, desc_en: str, http_error_class, record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord], outbound_handler: Coroutine[T_co, T_contra, V_co])[source]

Send problem report response and raise corresponding HTTP error.

Parameters:
  • err – error for internal diagnostics
  • desc_en – description text to include in problem report (response)
  • http_error_class – HTTP error to raise
  • record – record to cite by thread in problem report
  • outbound_handler – outbound message handler
Subpackages
aries_cloudagent.protocols.issue_credential.v2_0.handlers package
Submodules
aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_ack_handler module

Credential ack message handler.

class aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_ack_handler.V20CredAckHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for credential acks.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential acks.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_issue_handler module

Credential issue message handler.

class aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_issue_handler.V20CredIssueHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for credential offers.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential offers.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_offer_handler module

Credential offer message handler.

class aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_offer_handler.V20CredOfferHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for credential offers.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential offers.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_proposal_handler module

Credential proposal message handler.

class aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_proposal_handler.V20CredProposalHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for credential proposals.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential proposals.

Parameters:
  • context – proposal context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_request_handler module

Credential request message handler.

class aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_request_handler.V20CredRequestHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Message handler class for credential requests.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for credential requests.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.issue_credential.v2_0.messages package
Subpackages
aries_cloudagent.protocols.issue_credential.v2_0.messages.inner package
Submodules
aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview module

Credential preview inner object.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredAttrSpec(*, name: str, value: str, mime_type: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Attribute preview.

class Meta[source]

Bases: object

Attribute preview metadata.

schema_class = 'V20CredAttrSpecSchema'
b64_decoded_value() → str[source]

Value, base64-decoded if applicable.

static list_plain(plain: dict) → Sequence[aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredAttrSpec][source]

Return a list of V20CredAttrSpec (copies), absent any MIME types.

Parameters:plain – dict mapping names to values
Returns:List of V20CredAttrSpec (copies), absent any MIME types
class aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredAttrSpecSchema(*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 V20CredAttrSpec

unknown = 'exclude'
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 aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredPreview(*, _type: str = None, attributes: Sequence[aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredAttrSpec] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Credential preview.

class Meta[source]

Bases: object

Credential preview metadata.

message_type = 'issue-credential/2.0/credential-preview'
schema_class = 'V20CredPreviewSchema'
attr_dict(decode: bool = False)[source]

Return name:value pair per attribute.

Parameters:decode – whether first to decode attributes with MIME type
mime_types()[source]

Return per-attribute mapping from name to MIME type.

Return empty dict if no attribute has MIME type.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredPreviewSchema(*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 V20CredPreview

unknown = 'exclude'
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.'})>
Submodules
aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_ack module

Credential ack message.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_ack.V20CredAck(**kwargs)[source]

Bases: aries_cloudagent.messaging.ack.message.Ack

Credential ack.

class Meta[source]

Bases: object

Credential ack metadata.

handler_class = 'aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_ack_handler.V20CredAckHandler'
message_type = 'issue-credential/2.0/ack'
schema_class = 'V20CredAckSchema'
class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_ack.V20CredAckSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.ack.message.AckSchema

Credential ack schema.

class Meta[source]

Bases: object

Schema metadata.

model_class

alias of V20CredAck

unknown = 'exclude'
aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format module

Issue-credential protocol message attachment format.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.FormatSpec(aries, detail, handler)

Bases: tuple

aries

Alias for field number 0

detail

Alias for field number 1

handler

Alias for field number 2

class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat(*, attach_id: str = None, format_: str = None)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Issue-credential protocol message attachment format.

class Format[source]

Bases: enum.Enum

Attachment format.

INDY = FormatSpec(aries='hlindy/', detail=<class 'aries_cloudagent.protocols.issue_credential.v2_0.models.detail.indy.V20CredExRecordIndy'>, handler=<aries_cloudagent.utils.classloader.DeferLoad object>)
LD_PROOF = FormatSpec(aries='aries/', detail=<class 'aries_cloudagent.protocols.issue_credential.v2_0.models.detail.ld_proof.V20CredExRecordLDProof'>, handler=<aries_cloudagent.utils.classloader.DeferLoad object>)
api

Admin API specifier.

aries

Aries specifier prefix.

detail

Accessor for credential exchange detail class.

get = <bound method V20CredFormat.Format.get of <enum 'Format'>>[source]
get_attachment_data(formats: Sequence[V20CredFormat], attachments: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator])[source]

Find attachment of current format, decode and return its content.

handler

Accessor for credential exchange format handler.

validate_fields(message_type: str, attachment_data: Mapping[KT, VT_co])[source]

Raise ValidationError for invalid attachment formats.

class Meta[source]

Bases: object

Issue-credential protocol message attachment format metadata.

schema_class = 'V20CredFormatSchema'
format

Return format.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormatSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Issue-credential protocol message attachment format schema.

class Meta[source]

Bases: object

Issue-credential protocol message attachment format schema metadata.

model_class

alias of V20CredFormat

unknown = 'exclude'
attach_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.'})>
format_ = <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.'})>
aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_issue module

Credential issue message.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_issue.V20CredIssue(_id: str = None, *, replacement_id: str = None, comment: str = None, formats: Sequence[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat] = None, credentials_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Credential issue message.

class Meta[source]

Bases: object

V20CredIssue metadata.

handler_class = 'aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_issue_handler.V20CredIssueHandler'
message_type = 'issue-credential/2.0/issue-credential'
schema_class = 'V20CredIssueSchema'
attachment(fmt: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat.Format = None) → dict[source]

Return attached credential.

Parameters:fmt – format of attachment in list to decode and return
class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_issue.V20CredIssueSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Credential issue schema.

class Meta[source]

Bases: object

Credential issue schema metadata.

model_class

alias of V20CredIssue

unknown = 'exclude'
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.'})>
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.'})>
formats = <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.'})>
replacement_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.'})>
validate_fields(data, **kwargs)[source]

Validate attachments per format.

aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer module

Credential offer message.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer.V20CredOffer(_id: str = None, *, replacement_id: str = None, comment: str = None, credential_preview: aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredPreview = None, formats: Sequence[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat] = None, offers_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Credential offer.

class Meta[source]

Bases: object

V20CredOffer metadata.

handler_class = 'aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_offer_handler.V20CredOfferHandler'
message_type = 'issue-credential/2.0/offer-credential'
schema_class = 'V20CredOfferSchema'
attachment(fmt: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat.Format = None) → dict[source]

Return attached offer.

Parameters:fmt – format of attachment in list to decode and return
class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer.V20CredOfferSchema(*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 V20CredOffer

unknown = 'exclude'
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.'})>
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.'})>
formats = <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.'})>
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.'})>
replacement_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.'})>
validate_fields(data, **kwargs)[source]

Validate attachments per format.

aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal module

Credential proposal message.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposal(_id: str = None, *, comment: str = None, credential_preview: aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredPreview = None, formats: Sequence[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat] = None, filters_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Credential proposal.

class Meta[source]

Bases: object

V20CredProposal metadata.

handler_class = 'aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_proposal_handler.V20CredProposalHandler'
message_type = 'issue-credential/2.0/propose-credential'
schema_class = 'V20CredProposalSchema'
attachment(fmt: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat.Format = None) → dict[source]

Return attached filter.

Parameters:fmt – format of attachment in list to decode and return
class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposalSchema(*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 V20CredProposal

unknown = 'exclude'
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.'})>
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.'})>
filters_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.'})>
formats = <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.'})>
validate_fields(data, **kwargs)[source]

Validate attachments per format.

aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_request module

Credential request message.

class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_request.V20CredRequest(_id: str = None, *, comment: str = None, formats: Sequence[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat] = None, requests_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Credential request.

class Meta[source]

Bases: object

V20CredRequest metadata.

handler_class = 'aries_cloudagent.protocols.issue_credential.v2_0.handlers.cred_request_handler.V20CredRequestHandler'
message_type = 'issue-credential/2.0/request-credential'
schema_class = 'V20CredRequestSchema'
attachment(fmt: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat.Format = None) → dict[source]

Return attached credential request.

Parameters:fmt – format of attachment in list to decode and return
class aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_request.V20CredRequestSchema(*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 V20CredRequest

unknown = 'exclude'
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.'})>
formats = <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.'})>
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.'})>
validate_fields(data, **kwargs)[source]

Validate attachments per format.

aries_cloudagent.protocols.issue_credential.v2_0.models package

Package-wide code and data.

Subpackages
aries_cloudagent.protocols.issue_credential.v2_0.models.detail package
Submodules
aries_cloudagent.protocols.issue_credential.v2_0.models.detail.dif module
aries_cloudagent.protocols.issue_credential.v2_0.models.detail.indy module

Indy-specific credential exchange information with non-secrets storage.

class aries_cloudagent.protocols.issue_credential.v2_0.models.detail.indy.V20CredExRecordIndy(cred_ex_indy_id: str = None, *, cred_ex_id: str = None, cred_id_stored: str = None, cred_request_metadata: Mapping[KT, VT_co] = None, rev_reg_id: str = None, cred_rev_id: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Credential exchange indy detail record.

class Meta[source]

Bases: object

V20CredExRecordIndy metadata.

schema_class = 'V20CredExRecordIndySchema'
RECORD_ID_NAME = 'cred_ex_indy_id'
RECORD_TOPIC = 'issue_credential_v2_0_indy'
RECORD_TYPE = 'indy_cred_ex_v20'
TAG_NAMES = {'cred_ex_id'}
cred_ex_indy_id

Accessor for the ID associated with this exchange.

classmethod query_by_cred_ex_id(session: aries_cloudagent.core.profile.ProfileSession, cred_ex_id: str) → Sequence[aries_cloudagent.protocols.issue_credential.v2_0.models.detail.indy.V20CredExRecordIndy][source]

Retrieve credential exchange indy detail record(s) by its cred ex id.

record_value

Accessor for the JSON record value generated for this credential exchange.

class aries_cloudagent.protocols.issue_credential.v2_0.models.detail.indy.V20CredExRecordIndySchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

Credential exchange indy detail record detail schema.

class Meta[source]

Bases: object

Credential exchange indy detail record schema metadata.

model_class

alias of V20CredExRecordIndy

unknown = 'exclude'
cred_ex_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.'})>
cred_ex_indy_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.'})>
cred_id_stored = <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_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.'})>
cred_rev_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredRevId 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.'})>
rev_reg_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegId 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.'})>
Submodules
aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record module

Aries#0453 v2.0 credential exchange information with non-secrets storage.

class aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord(*, cred_ex_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, cred_proposal: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposal] = None, cred_offer: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer.V20CredOffer] = None, cred_request: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_request.V20CredRequest] = None, cred_issue: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_issue.V20CredIssue] = None, auto_offer: bool = False, auto_issue: bool = False, auto_remove: bool = True, error_msg: str = None, trace: bool = False, cred_id_stored: str = None, conn_id: str = None, by_format: Mapping[KT, VT_co] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeRecord

Represents an Aries#0036 credential exchange.

INITIATOR_EXTERNAL = 'external'
INITIATOR_SELF = 'self'
class Meta[source]

Bases: object

CredentialExchange metadata.

schema_class = 'V20CredExRecordSchema'
RECORD_ID_NAME = 'cred_ex_id'
RECORD_TOPIC = 'issue_credential_v2_0'
RECORD_TYPE = 'cred_ex_v20'
ROLE_HOLDER = 'holder'
ROLE_ISSUER = 'issuer'
STATE_CREDENTIAL_RECEIVED = 'credential-received'
STATE_DONE = 'done'
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'}
by_format

Record proposal, offer, request, and credential attachments by format.

cred_ex_id

Accessor for the ID associated with this exchange.

cred_issue

Accessor; get deserialized view.

cred_offer

Accessor; get deserialized view.

cred_preview

Credential preview (deserialized view) from credential proposal.

cred_proposal

Accessor; get deserialized view.

cred_request

Accessor; get deserialized view.

record_value

Accessor for the JSON record value generated for this credential exchange.

classmethod retrieve_by_conn_and_thread(session: aries_cloudagent.core.profile.ProfileSession, connection_id: str, thread_id: str) → aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord[source]

Retrieve a credential exchange record by connection and thread ID.

save_error_state(session: aries_cloudagent.core.profile.ProfileSession, *, reason: str = None, log_params: Mapping[str, Any] = None, log_override: bool = False)[source]

Save record error state if need be; log and swallow any storage error.

Parameters:
  • session – The profile session to use
  • reason – A reason to add to the log
  • log_params – Additional parameters to log
  • override – Override configured logging regimen, print to stderr instead
class aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeSchema

Schema to allow serialization/deserialization of credential exchange records.

class Meta[source]

Bases: object

V20CredExSchema metadata.

model_class

alias of V20CredExRecord

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.'})>
auto_remove = <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.'})>
by_format = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=True, 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.'})>
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.'})>
cred_ex_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.'})>
cred_issue = <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.'})>
cred_offer = <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.'})>
cred_preview = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=True, 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.'})>
cred_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.'})>
cred_request = <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.'})>
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.'})>
role = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['issuer', 'holder'], 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=<OneOf(choices=['proposal-sent', 'proposal-received', 'offer-sent', 'offer-received', 'request-sent', 'request-received', 'credential-issued', 'credential-received', 'done'], 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.'})>
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.'})>
Submodules
aries_cloudagent.protocols.issue_credential.v2_0.manager module

V2.0 issue-credential protocol manager.

class aries_cloudagent.protocols.issue_credential.v2_0.manager.V20CredManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for managing credentials.

create_offer(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, counter_proposal: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposal = None, replacement_id: str = None, comment: str = None) → Tuple[aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer.V20CredOffer][source]

Create credential offer, update credential exchange record.

Parameters:
  • cred_ex_record – credential exchange record for which to create offer
  • replacement_id – identifier to help coordinate credential replacement
  • 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_remove: bool = None, comment: str = None, cred_preview: aries_cloudagent.protocols.issue_credential.v2_0.messages.inner.cred_preview.V20CredPreview, fmt2filter: Mapping[aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_format.V20CredFormat.Format, Mapping[str, str]], trace: bool = False) → aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord[source]

Create a credential proposal.

Parameters:
  • connection_id – connection for which to create proposal
  • auto_remove – whether to remove record automatically on completion
  • comment – optional human-readable comment to include in proposal
  • cred_preview – credential preview to use to create credential proposal
  • fmt2filter – mapping between format and filter
  • trace – whether to trace the operation
Returns:

Resulting credential exchange record including credential proposal

create_request(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, holder_did: str, comment: str = None) → Tuple[aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_request.V20CredRequest][source]

Create a credential request.

Parameters:
  • cred_ex_record – credential exchange record for which to create request
  • holder_did – holder DID
  • comment – optional human-readable comment to set in request message
Returns:

A tuple (credential exchange record, credential request message)

delete_cred_ex_record(cred_ex_id: str) → None[source]

Delete credential exchange record and associated detail records.

issue_credential(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, *, comment: str = None) → Tuple[aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_issue.V20CredIssue][source]

Issue a credential.

Parameters:
  • cred_ex_record – credential exchange record for which to issue credential
  • comment – optional human-readable comment pertaining to credential issue
Returns:

(Updated credential exchange record, credential issue message)

Return type:

Tuple

prepare_send(connection_id: str, cred_proposal: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposal, auto_remove: bool = None) → Tuple[aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer.V20CredOffer][source]

Set up a new credential exchange record for an automated send.

Parameters:
  • connection_id – connection for which to create offer
  • cred_proposal – credential proposal with preview
  • auto_remove – flag to remove the record automatically on completion
Returns:

A tuple of the new credential exchange record and credential offer message

profile

Accessor for the current profile instance.

Returns:The profile instance for this credential manager
receive_credential(cred_issue_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_issue.V20CredIssue, connection_id: str) → aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord[source]

Receive a credential issue message from an issuer.

Hold cred in storage potentially to be processed by controller before storing.

Returns:Credential exchange record, retrieved and updated
receive_credential_ack(cred_ack_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_ack.V20CredAck, connection_id: str) → aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord[source]

Receive credential ack from holder.

Parameters:
  • cred_ack_message – credential ack message to receive
  • connection_id – connection identifier
Returns:

credential exchange record, retrieved and updated

receive_offer(cred_offer_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer.V20CredOffer, connection_id: str) → aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord[source]

Receive a credential offer.

Parameters:
  • cred_offer_message – credential offer message
  • connection_id – connection identifier
Returns:

The credential exchange record, updated

receive_problem_report(message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_problem_report.V20CredProblemReport, connection_id: str)[source]

Receive problem report.

Returns:credential exchange record, retrieved and updated
receive_proposal(cred_proposal_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposal, connection_id: str) → aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord[source]

Receive a credential proposal.

Returns:The resulting credential exchange record, created
receive_request(cred_request_message: aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_request.V20CredRequest, connection_id: str) → aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord[source]

Receive a credential request.

Parameters:
  • cred_request_message – credential request to receive
  • connection_id – connection identifier
Returns:

credential exchange record, updated

send_cred_ack(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord)[source]

Create, send, and return ack message for input cred ex record.

Delete cred ex record if set to auto-remove.

Returns:cred ex record, cred ack message for tracing
Return type:Tuple
store_credential(cred_ex_record: aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, cred_id: str = None) → Tuple[aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord, aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_ack.V20CredAck][source]

Store a credential in holder wallet; send ack to issuer.

Parameters:
  • cred_ex_record – credential exchange record with credential to store and ack
  • cred_id – optional credential identifier to override default on storage
Returns:

Updated credential exchange record

exception aries_cloudagent.protocols.issue_credential.v2_0.manager.V20CredManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Credential manager error under issue-credential protocol v2.0.

aries_cloudagent.protocols.issue_credential.v2_0.message_types module

Message and inner object type identifiers for Connections.

aries_cloudagent.protocols.issue_credential.v2_0.routes module
Submodules
aries_cloudagent.protocols.issue_credential.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.out_of_band package
Subpackages
aries_cloudagent.protocols.out_of_band.v1_0 package
Subpackages
aries_cloudagent.protocols.out_of_band.v1_0.handlers package
Submodules
aries_cloudagent.protocols.out_of_band.v1_0.handlers.problem_report_handler module

OOB Problem Report Message Handler.

class aries_cloudagent.protocols.out_of_band.v1_0.handlers.problem_report_handler.OOBProblemReportMessageHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for OOB Problem Report Message.

Updates the ConnRecord Metadata state.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

OOB Problem Report Message Handler.

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.out_of_band.v1_0.handlers.reuse_accept_handler module

Handshake Reuse Accepted Message Handler under RFC 0434.

class aries_cloudagent.protocols.out_of_band.v1_0.handlers.reuse_accept_handler.HandshakeReuseAcceptMessageHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for Handshake Reuse Accepted Message Handler under RFC 0434.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle Handshake Reuse Accepted Message Handler under RFC 0434.

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.out_of_band.v1_0.handlers.reuse_handler module

Handshake Reuse Message Handler under RFC 0434.

class aries_cloudagent.protocols.out_of_band.v1_0.handlers.reuse_handler.HandshakeReuseMessageHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler class for Handshake Reuse Message Handler under RFC 0434.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle Handshake Reuse Message Handler under RFC 0434.

Parameters:
  • context – Request context
  • responder – Responder callback
aries_cloudagent.protocols.out_of_band.v1_0.messages package
Submodules
aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation module

An invitation content message.

class aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.HSProto[source]

Bases: enum.Enum

Handshake protocol enum for invitation message.

RFC160 = HSProtoSpec(rfc=160, name='connections/1.0', aka={'connection', '160', 'connections', 'conns', 'conn', 'rfc160', 'old'})
RFC23 = HSProtoSpec(rfc=23, name='didexchange/1.0', aka={'rfc23', 'didexchange', 'didx', '23', 'new', 'didex'})
aka

Accessor for also-known-as.

get = <bound method HSProto.get of <enum 'HSProto'>>[source]
rfc

Accessor for RFC.

class aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.HSProtoSpec(rfc, name, aka)

Bases: tuple

aka

Alias for field number 2

name

Alias for field number 1

rfc

Alias for field number 0

class aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage(*, comment: str = None, label: str = None, handshake_protocols: Sequence[str] = None, requests_attach: Sequence[aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator] = None, services: Sequence[Union[aries_cloudagent.protocols.out_of_band.v1_0.messages.service.Service, str]] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing an out of band invitation message.

class Meta[source]

Bases: object

InvitationMessage metadata.

message_type = 'out-of-band/1.0/invitation'
schema_class = 'InvitationMessageSchema'
classmethod from_url(url: str) → aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage[source]

Parse a URL-encoded invitation into an InvitationMessage instance.

Parameters:url – Url to decode
Returns:An InvitationMessage object.
to_url(base_url: str = None) → str[source]

Convert an invitation message to URL format for sharing.

Returns:An invite url
classmethod wrap_message(message: dict) → aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator[source]

Convert an aries message to an attachment decorator.

class aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessageSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

InvitationMessage schema.

class Meta[source]

Bases: object

InvitationMessage schema metadata.

model_class

alias of InvitationMessage

unknown = 'exclude'
handshake_protocols = <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.'})>
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.'})>
post_dump(data, **kwargs)[source]

Post dump hook.

requests_attach = <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.'})>
services = <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.'})>
validate_fields(data, **kwargs)[source]

Validate schema fields.

Parameters:data – The data to validate
Raises:ValidationError – If any of the fields do not validate
class aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.ServiceOrDIDField(*, default: Any = <marshmallow.missing>, missing: Any = <marshmallow.missing>, data_key: str = None, attribute: str = None, validate: Union[Callable[[Any], Any], Iterable[Callable[[Any], Any]]] = None, required: bool = False, allow_none: bool = None, load_only: bool = False, dump_only: bool = False, error_messages: Dict[str, str] = None, **metadata)[source]

Bases: marshmallow.fields.Field

DIDComm Service object or DID string field for Marshmallow.

aries_cloudagent.protocols.out_of_band.v1_0.messages.problem_report module

Represents an OOB connection reuse problem report message.

class aries_cloudagent.protocols.out_of_band.v1_0.messages.problem_report.OOBProblemReport(*args, **kwargs)[source]

Bases: aries_cloudagent.protocols.problem_report.v1_0.message.ProblemReport

Base class representing an OOB connection reuse problem report message.

class Meta[source]

Bases: object

OOB connection reuse problem report metadata.

handler_class = 'aries_cloudagent.protocols.out_of_band.v1_0.handlers.problem_report_handler.OOBProblemReportMessageHandler'
message_type = 'out-of-band/1.0/problem_report'
schema_class = 'OOBProblemReportSchema'
class aries_cloudagent.protocols.out_of_band.v1_0.messages.problem_report.OOBProblemReportSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.protocols.problem_report.v1_0.message.ProblemReportSchema

Schema for ProblemReport base class.

class Meta[source]

Bases: object

Metadata for problem report schema.

model_class

alias of OOBProblemReport

unknown = 'exclude'
check_thread_deco(obj, **kwargs)[source]

Thread decorator, and its thid and pthid, are mandatory.

validate_fields(data, **kwargs)[source]

Validate schema fields.

class aries_cloudagent.protocols.out_of_band.v1_0.messages.problem_report.ProblemReportReason[source]

Bases: enum.Enum

Supported reason codes.

EXISTING_CONNECTION_NOT_ACTIVE = 'existing_connection_not_active'
NO_EXISTING_CONNECTION = 'no_existing_connection'
aries_cloudagent.protocols.out_of_band.v1_0.messages.reuse module

Represents a Handshake Reuse message under RFC 0434.

class aries_cloudagent.protocols.out_of_band.v1_0.messages.reuse.HandshakeReuse(**kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a Handshake Reuse message.

class Meta[source]

Bases: object

Metadata for Handshake Reuse message.

handler_class = 'aries_cloudagent.protocols.out_of_band.v1_0.handlers.reuse_handler.HandshakeReuseMessageHandler'
message_type = 'out-of-band/1.0/handshake-reuse'
schema_class = 'HandshakeReuseSchema'
class aries_cloudagent.protocols.out_of_band.v1_0.messages.reuse.HandshakeReuseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Handshake Reuse schema class.

class Meta[source]

Bases: object

Handshake Reuse schema metadata.

model_class

alias of HandshakeReuse

unknown = 'exclude'
check_thread_deco(obj, **kwargs)[source]

Thread decorator, and its thid and pthid, are mandatory.

aries_cloudagent.protocols.out_of_band.v1_0.messages.reuse_accept module

Represents a Handshake Reuse Accept message under RFC 0434.

class aries_cloudagent.protocols.out_of_band.v1_0.messages.reuse_accept.HandshakeReuseAccept(**kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a Handshake Reuse Accept message.

class Meta[source]

Bases: object

Metadata for Handshake Reuse Accept message.

handler_class = 'aries_cloudagent.protocols.out_of_band.v1_0.handlers.reuse_accept_handler.HandshakeReuseAcceptMessageHandler'
message_type = 'out-of-band/1.0/handshake-reuse-accepted'
schema_class = 'HandshakeReuseAcceptSchema'
class aries_cloudagent.protocols.out_of_band.v1_0.messages.reuse_accept.HandshakeReuseAcceptSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Handshake Reuse Accept schema class.

class Meta[source]

Bases: object

Handshake Reuse Accept schema metadata.

model_class

alias of HandshakeReuseAccept

unknown = 'exclude'
check_thread_deco(obj, **kwargs)[source]

Thread decorator, and its thid and pthid, are mandatory.

aries_cloudagent.protocols.out_of_band.v1_0.messages.service module

Record used to represent a service block of an out of band invitation.

class aries_cloudagent.protocols.out_of_band.v1_0.messages.service.Service(*, _id: str = None, _type: str = None, did: str = None, recipient_keys: Sequence[str] = None, routing_keys: Sequence[str] = None, service_endpoint: str = None)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Record used to represent a service block of an out of band invitation.

class Meta[source]

Bases: object

Service metadata.

schema_class = 'ServiceSchema'
class aries_cloudagent.protocols.out_of_band.v1_0.messages.service.ServiceSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Service schema.

class Meta[source]

Bases: object

ServiceSchema metadata.

model_class

alias of Service

unknown = 'exclude'
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.'})>
post_dump(data, **kwargs)[source]

Post dump hook.

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.'})>
service_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.'})>
aries_cloudagent.protocols.out_of_band.v1_0.models package
Submodules
aries_cloudagent.protocols.out_of_band.v1_0.models.invitation module

Record for out of band invitations.

class aries_cloudagent.protocols.out_of_band.v1_0.models.invitation.InvitationRecord(*, invitation_id: str = None, state: str = None, invi_msg_id: str = None, invitation: Union[aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage, Mapping[KT, VT_co]] = None, invitation_url: str = None, public_did: str = None, trace: bool = False, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeRecord

Represents an out of band invitation record.

class Meta[source]

Bases: object

InvitationRecord metadata.

schema_class = 'InvitationRecordSchema'
RECORD_ID_NAME = 'invitation_id'
RECORD_TOPIC = 'oob_invitation'
RECORD_TYPE = 'oob_invitation'
STATE_AWAIT_RESPONSE = 'await_response'
STATE_DONE = 'done'
STATE_INITIAL = 'initial'
TAG_NAMES = {'invi_msg_id'}
invitation

Accessor; get deserialized view.

invitation_id

Accessor for the ID associated with this exchange.

record_value

Accessor for the JSON record value generated for this invitation.

class aries_cloudagent.protocols.out_of_band.v1_0.models.invitation.InvitationRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeSchema

Schema to allow serialization/deserialization of invitation records.

class Meta[source]

Bases: object

InvitationRecordSchema metadata.

model_class

alias of InvitationRecord

invi_msg_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.'})>
invitation = <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.'})>
invitation_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.'})>
invitation_url = <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.'})>
Submodules
aries_cloudagent.protocols.out_of_band.v1_0.manager module

Classes to manage connections.

class aries_cloudagent.protocols.out_of_band.v1_0.manager.OutOfBandManager(session: aries_cloudagent.core.profile.ProfileSession)[source]

Bases: aries_cloudagent.connections.base_manager.BaseConnectionManager

Class for managing out of band messages.

check_reuse_msg_state(conn_rec: aries_cloudagent.connections.models.conn_record.ConnRecord)[source]

Check reuse message state from the ConnRecord Metadata.

Parameters:conn_rec – The required ConnRecord with updated metadata

Returns:

create_handshake_reuse_message(invi_msg: aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage, conn_record: aries_cloudagent.connections.models.conn_record.ConnRecord) → None[source]

Create and Send a Handshake Reuse message under RFC 0434.

Parameters:
  • invi_msg – OOB Invitation Message
  • service – Service block extracted from the OOB invitation

Returns:

Raises:
create_invitation(my_label: str = None, my_endpoint: str = None, auto_accept: bool = None, public: bool = False, hs_protos: Sequence[aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.HSProto] = None, multi_use: bool = False, alias: str = None, attachments: Sequence[Mapping[KT, VT_co]] = None, metadata: dict = None, mediation_id: str = None) → aries_cloudagent.protocols.out_of_band.v1_0.models.invitation.InvitationRecord[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.

Parameters:
  • my_label – label for this connection
  • my_endpoint – endpoint where other party can reach me
  • auto_accept – auto-accept a corresponding connection request (None to use config)
  • public – set to create an invitation from the public DID
  • hs_protos – list of handshake protocols to include
  • multi_use – set to True to create an invitation for multiple-use connection
  • alias – optional alias to apply to connection for later use
  • attachments – list of dicts in form of {“id”: …, “type”: …}
Returns:

Invitation record

find_existing_connection(tag_filter: dict, post_filter: dict) → Optional[aries_cloudagent.connections.models.conn_record.ConnRecord][source]

Find existing ConnRecord.

Parameters:
  • tag_filter – The filter dictionary to apply
  • post_filter – Additional value filters to apply matching positively, with sequence values specifying alternatives to match (hit any)
Returns:

ConnRecord or None

receive_invitation(invi_msg: aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage, use_existing_connection: bool = True, auto_accept: bool = None, alias: str = None, mediation_id: str = None) → dict[source]

Receive an out of band invitation message.

Parameters:
  • invi_msg – invitation message
  • use_existing_connection – whether to use existing connection if possible
  • auto_accept – whether to accept the invitation automatically
  • alias – Alias for connection record
  • mediation_id – mediation identifier
Returns:

ConnRecord, serialized

receive_problem_report(problem_report: aries_cloudagent.protocols.out_of_band.v1_0.messages.problem_report.OOBProblemReport, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt, conn_record: aries_cloudagent.connections.models.conn_record.ConnRecord) → None[source]

Receive and process a ProblemReport message from the inviter to invitee.

Process a ProblemReport message by updating the ConnRecord metadata state to not_accepted.

Parameters:
  • problem_report – The OOBProblemReport to process
  • receipt – The message receipt

Returns:

Raises:
receive_reuse_accepted_message(reuse_accepted_msg: aries_cloudagent.protocols.out_of_band.v1_0.messages.reuse_accept.HandshakeReuseAccept, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt, conn_record: aries_cloudagent.connections.models.conn_record.ConnRecord) → None[source]

Receive and process a HandshakeReuseAccept message under RFC 0434.

Process a HandshakeReuseAccept message by updating the ConnRecord metadata state to accepted.

Parameters:
  • reuse_accepted_msg – The HandshakeReuseAccept to process
  • receipt – The message receipt

Returns:

Raises:
receive_reuse_message(reuse_msg: aries_cloudagent.protocols.out_of_band.v1_0.messages.reuse.HandshakeReuse, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → None[source]

Receive and process a HandshakeReuse message under RFC 0434.

Process a HandshakeReuse message by looking up the connection records using the MessageReceipt sender DID.

Parameters:
  • reuse_msg – The HandshakeReuse to process
  • receipt – The message receipt

Returns:

Raises:
session

Accessor for the current profile session.

Returns:The profile session for this connection manager
exception aries_cloudagent.protocols.out_of_band.v1_0.manager.OutOfBandManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Out of band error.

exception aries_cloudagent.protocols.out_of_band.v1_0.manager.OutOfBandManagerNotImplementedError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Out of band error for unimplemented functionality.

aries_cloudagent.protocols.out_of_band.v1_0.message_types module

Message and inner object type identifiers for Out of Band messages.

aries_cloudagent.protocols.out_of_band.v1_0.routes module

Out-of-band handling admin routes.

class aries_cloudagent.protocols.out_of_band.v1_0.routes.InvitationCreateQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for create invitation request query string.

auto_accept = <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.'})>
multi_use = <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.'})>
class aries_cloudagent.protocols.out_of_band.v1_0.routes.InvitationCreateRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Invitation create request Schema.

class AttachmentDefSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Attachment Schema.

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.'})>
attachments = <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.'})>
handshake_protocols = <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.'})>
mediation_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
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.'})>
my_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.'})>
use_public_did = <fields.Boolean(default=False, 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.'})>
class aries_cloudagent.protocols.out_of_band.v1_0.routes.InvitationReceiveQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for receive invitation request query 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.'})>
auto_accept = <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.'})>
mediation_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
use_existing_connection = <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.'})>
class aries_cloudagent.protocols.out_of_band.v1_0.routes.OutOfBandModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Out of Band Module.

aries_cloudagent.protocols.out_of_band.v1_0.routes.invitation_create(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542a2750>)[source]

Request handler for creating a new connection invitation.

Parameters:request – aiohttp request object
Returns:The out of band invitation details
aries_cloudagent.protocols.out_of_band.v1_0.routes.invitation_receive(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542a2750>)[source]

Request handler for receiving a new connection invitation.

Parameters:request – aiohttp request object
Returns:The out of band invitation details
aries_cloudagent.protocols.out_of_band.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542a2750>)[source]

Amend swagger API.

aries_cloudagent.protocols.out_of_band.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542a2750>)[source]

Register routes.

Submodules
aries_cloudagent.protocols.out_of_band.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.present_proof package
Subpackages
aries_cloudagent.protocols.present_proof.v1_0 package
aries_cloudagent.protocols.present_proof.v1_0.problem_report_for_record(record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.V10PresentationExchange], desc_en: str) → aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_problem_report.PresentationProblemReport[source]

Create problem report for record.

Parameters:
  • record – connection or exchange record
  • desc_en – description text to include in problem report
aries_cloudagent.protocols.present_proof.v1_0.report_problem(err: aries_cloudagent.core.error.BaseError, desc_en: str, http_error_class, record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.V10PresentationExchange], outbound_handler: Coroutine[T_co, T_contra, V_co])[source]

Send problem report response and raise corresponding HTTP error.

Parameters:
  • err – error for internal diagnostics
  • desc_en – description text to include in problem report (response)
  • http_error_class – HTTP error to raise
  • record – record to cite by thread in problem report
  • outbound_handler – outbound message handler
Subpackages
aries_cloudagent.protocols.present_proof.v1_0.handlers package
Submodules
aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_ack_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for presentation acks.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for presentations.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_proposal_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for presentation proposals.

Parameters:
  • context – proposal context
  • responder – responder callback
aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_request_handler module

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.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler logic for Aries#0037 v1.0 presentation requests.

Parameters:
  • context – request context
  • responder – responder callback
aries_cloudagent.protocols.present_proof.v1_0.messages package
Subpackages
aries_cloudagent.protocols.present_proof.v1_0.messages.inner package
Submodules
aries_cloudagent.protocols.present_proof.v1_0.messages.inner.presentation_preview module
Submodules
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation module

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 Meta[source]

Bases: object

Presentation metadata.

handler_class = 'aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_handler.PresentationHandler'
message_type = 'present-proof/1.0/presentation'
schema_class = 'PresentationSchema'
indy_proof(index: int = 0)[source]

Retrieve and decode indy proof from attachment.

Parameters:index – ordinal in attachment list to decode and return (typically, list has length 1)
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

unknown = 'exclude'
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.'})>
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.'})>
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_ack module

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 Meta[source]

Bases: object

PresentationAck metadata.

handler_class = 'aries_cloudagent.protocols.present_proof.v1_0.handlers.presentation_ack_handler.PresentationAckHandler'
message_type = 'present-proof/1.0/ack'
schema_class = 'PresentationAckSchema'
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

unknown = 'exclude'
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_proposal module

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.indy.models.pres_preview.IndyPresPreview = 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 = 'present-proof/1.0/propose-presentation'
schema_class = 'PresentationProposalSchema'
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

unknown = 'exclude'
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.'})>
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.'})>
aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_request module

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 = 'present-proof/1.0/request-presentation'
schema_class = 'PresentationRequestSchema'
indy_proof_request(index: int = 0)[source]

Retrieve and decode indy proof request from attachment.

Parameters:index – ordinal in attachment list to decode and return (typically, list has length 1)
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

unknown = 'exclude'
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.'})>
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.'})>
aries_cloudagent.protocols.present_proof.v1_0.models package

Package-wide data and code.

Submodules
aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange module

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: Union[aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_proposal.PresentationProposal, Mapping[KT, VT_co]] = None, presentation_request: Union[aries_cloudagent.indy.models.proof_request.IndyProofRequest, Mapping[KT, VT_co]] = None, presentation_request_dict: Union[aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_request.PresentationRequest, Mapping[KT, VT_co]] = None, presentation: Union[aries_cloudagent.indy.models.proof.IndyProof, Mapping[KT, VT_co]] = None, verified: str = None, auto_present: bool = False, error_msg: str = None, trace: bool = False, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeRecord

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_TOPIC = 'present_proof'
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'}
presentation

Accessor; get deserialized view.

presentation_exchange_id

Accessor for the ID associated with this exchange.

presentation_proposal_dict

Accessor; get deserialized view.

presentation_request

Accessor; get deserialized view.

presentation_request_dict

Accessor; get deserialized view.

record_value

Accessor for the JSON record value generated for this credential exchange.

save_error_state(session: aries_cloudagent.core.profile.ProfileSession, *, reason: str = None, log_params: Mapping[str, Any] = None, log_override: bool = False)[source]

Save record error state if need be; log and swallow any storage error.

Parameters:
  • session – The profile session to use
  • reason – A reason to add to the log
  • log_params – Additional parameters to log
  • override – Override configured logging regimen, print to stderr instead
class aries_cloudagent.protocols.present_proof.v1_0.models.presentation_exchange.V10PresentationExchangeSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeSchema

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.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.'})>
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.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.'})>
presentation_request = <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.'})>
presentation_request_dict = <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.'})>
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.'})>
aries_cloudagent.protocols.present_proof.v1_0.util package
Submodules
aries_cloudagent.protocols.present_proof.v1_0.util.indy module
aries_cloudagent.protocols.present_proof.v1_0.util.predicate module
Submodules
aries_cloudagent.protocols.present_proof.v1_0.manager module

Classes to manage presentations.

class aries_cloudagent.protocols.present_proof.v1_0.manager.PresentationManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for managing presentations.

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, mapping proof request referents (uuid) to wallet referents (cred id):

{
    "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(message: aries_cloudagent.protocols.present_proof.v1_0.messages.presentation.Presentation, connection_record: aries_cloudagent.connections.models.conn_record.ConnRecord)[source]

Receive a presentation, from message in context on manager creation.

Returns:presentation exchange record, retrieved and updated
receive_presentation_ack(message: aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_ack.PresentationAck, connection_record: aries_cloudagent.connections.models.conn_record.ConnRecord)[source]

Receive a presentation ack, from message in context on manager creation.

Returns:presentation exchange record, retrieved and updated
receive_problem_report(message: aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_problem_report.PresentationProblemReport, connection_id: str)[source]

Receive problem report.

Returns:presentation exchange record, retrieved and updated
receive_proposal(message: aries_cloudagent.protocols.present_proof.v1_0.messages.presentation_proposal.PresentationProposal, connection_record: aries_cloudagent.connections.models.conn_record.ConnRecord)[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.

aries_cloudagent.protocols.present_proof.v1_0.message_types module

Message and inner object type identifiers for present-proof protocol v1.0.

aries_cloudagent.protocols.present_proof.v1_0.routes module

Admin routes for presentations.

class aries_cloudagent.protocols.present_proof.v1_0.routes.CredentialsFetchQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for credentials fetch request query string.

count = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.NumericStrNatural 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.'})>
extra_query = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyExtraWQL 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.'})>
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.'})>
start = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.NumericStrWhole 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 aries_cloudagent.protocols.present_proof.v1_0.routes.V10PresExIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking presentation exchange id.

pres_ex_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
class aries_cloudagent.protocols.present_proof.v1_0.routes.V10PresentProofModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Present Proof Module.

class aries_cloudagent.protocols.present_proof.v1_0.routes.V10PresentationCreateRequestRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Request schema for creating a proof request free of any connection.

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.'})>
proof_request = <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.'})>
trace = <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.'})>
class aries_cloudagent.protocols.present_proof.v1_0.routes.V10PresentationExchangeListQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for presentation exchange list query.

connection_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
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=<OneOf(choices=['proposal_sent', 'proposal_received', 'request_sent', 'request_received', 'presentation_sent', 'presentation_received', 'verified', 'presentation_acked'], 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.'})>
thread_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
class aries_cloudagent.protocols.present_proof.v1_0.routes.V10PresentationExchangeListSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for an Aries RFC 37 v1.0 presentation exchange query.

results = <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 aries_cloudagent.protocols.present_proof.v1_0.routes.V10PresentationProblemReportRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for sending problem report.

description = <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.present_proof.v1_0.routes.V10PresentationProposalRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema

Request schema for sending a presentation proposal admin message.

auto_present = <fields.Boolean(default=False, 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.'})>
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.'})>
connection_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
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.'})>
trace = <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.'})>
class aries_cloudagent.protocols.present_proof.v1_0.routes.V10PresentationSendRequestRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.protocols.present_proof.v1_0.routes.V10PresentationCreateRequestRequestSchema

Request schema for sending a proof request on a connection.

connection_id = <fields.UUID(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.', 'invalid_uuid': 'Not a valid UUID.'})>
aries_cloudagent.protocols.present_proof.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542e01d0>)[source]

Amend swagger API.

aries_cloudagent.protocols.present_proof.v1_0.routes.presentation_exchange_create_request(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542e01d0>)[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 0x7fb0542e01d0>)[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 0x7fb0542e01d0>)[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_problem_report(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542e01d0>)[source]

Request handler for sending problem report.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.present_proof.v1_0.routes.presentation_exchange_remove(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542e01d0>)[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 0x7fb0542e01d0>)[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 0x7fb0542e01d0>)[source]

Request handler for sending a presentation request bound to a 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 0x7fb0542e01d0>)[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 0x7fb0542e01d0>)[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 0x7fb0542e01d0>)[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 0x7fb0542e01d0>)[source]

Request handler for verifying a presentation request.

Parameters:request – aiohttp request object
Returns:The presentation exchange details
aries_cloudagent.protocols.present_proof.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb0542e01d0>)[source]

Register routes.

Submodules
aries_cloudagent.protocols.present_proof.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.problem_report package
Subpackages
aries_cloudagent.protocols.problem_report.v1_0 package
aries_cloudagent.protocols.problem_report.v1_0.internal_error(err: aries_cloudagent.core.error.BaseError, http_error_class, record: Union[aries_cloudagent.connections.models.conn_record.ConnRecord, aries_cloudagent.messaging.models.base_record.BaseRecord], outbound_handler: Coroutine[T_co, T_contra, V_co], code: str = None)[source]

Send problem report and raise corresponding HTTP error.

Submodules
aries_cloudagent.protocols.problem_report.v1_0.handler module

Generic problem report handler.

class aries_cloudagent.protocols.problem_report.v1_0.handler.ProblemReportHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Problem report handler class.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle problem report message.

Parameters:
  • context – Request context
  • responder – Responder used to reply
aries_cloudagent.protocols.problem_report.v1_0.message module

Represents a generic problem report message.

class aries_cloudagent.protocols.problem_report.v1_0.message.ProblemReport(*, description: Mapping[str, str] = None, problem_items: Sequence[Mapping[str, str]] = None, who_retries: str = None, fix_hint: Mapping[str, str] = None, impact: str = None, where: str = None, noticed_time: 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 Meta[source]

Bases: object

Problem report metadata.

handler_class = 'aries_cloudagent.protocols.problem_report.v1_0.handler.ProblemReportHandler'
message_type = 'notification/1.0/problem-report'
schema_class = 'ProblemReportSchema'
class aries_cloudagent.protocols.problem_report.v1_0.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

unknown = 'exclude'
description = <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.'})>
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.'})>
fix_hint = <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.'})>
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=<aries_cloudagent.messaging.valid.RFC3339DateTime 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.'})>
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.'})>
validate_fields(data, **kwargs)[source]

Validate schema fields.

Parameters:data – The data to validate
Raises:ValidationError – if data has neither indy nor ld_proof
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.'})>
aries_cloudagent.protocols.problem_report.v1_0.message_types module

Message type identifiers for problem reports.

Submodules
aries_cloudagent.protocols.problem_report.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.routing package
Subpackages
aries_cloudagent.protocols.routing.v1_0 package
Subpackages
aries_cloudagent.protocols.routing.v1_0.handlers package
Submodules
aries_cloudagent.protocols.routing.v1_0.handlers.forward_handler module

Handler for incoming forward messages.

class aries_cloudagent.protocols.routing.v1_0.handlers.forward_handler.ForwardHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming forward messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.routing.v1_0.handlers.route_query_request_handler module

Handler for incoming route-query-request messages.

class aries_cloudagent.protocols.routing.v1_0.handlers.route_query_request_handler.RouteQueryRequestHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming route-query-request messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.routing.v1_0.handlers.route_query_response_handler module

Handler for incoming route-query-response messages.

class aries_cloudagent.protocols.routing.v1_0.handlers.route_query_response_handler.RouteQueryResponseHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming route-query-response messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.routing.v1_0.handlers.route_update_request_handler module

Handler for incoming route-update-request messages.

class aries_cloudagent.protocols.routing.v1_0.handlers.route_update_request_handler.RouteUpdateRequestHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming route-update-request messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.routing.v1_0.handlers.route_update_response_handler module

Handler for incoming route-update-response messages.

class aries_cloudagent.protocols.routing.v1_0.handlers.route_update_response_handler.RouteUpdateResponseHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Handler for incoming route-update-response messages.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Message handler implementation.

aries_cloudagent.protocols.routing.v1_0.messages package
Submodules
aries_cloudagent.protocols.routing.v1_0.messages.forward module

Represents a forward message.

class aries_cloudagent.protocols.routing.v1_0.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 Meta[source]

Bases: object

Forward metadata.

handler_class = 'aries_cloudagent.protocols.routing.v1_0.handlers.forward_handler.ForwardHandler'
message_type = 'routing/1.0/forward'
schema_class = 'ForwardSchema'
class aries_cloudagent.protocols.routing.v1_0.messages.forward.ForwardSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Forward message schema used in serialization/deserialization.

class Meta[source]

Bases: object

ForwardSchema metadata.

model_class

alias of Forward

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.routing.v1_0.messages.route_query_request module

Query existing forwarding routes.

class aries_cloudagent.protocols.routing.v1_0.messages.route_query_request.RouteQueryRequest(*, filter: dict = None, paginate: aries_cloudagent.protocols.routing.v1_0.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.v1_0.handlers.route_query_request_handler.RouteQueryRequestHandler'
message_type = 'routing/1.0/route-query-request'
schema_class = 'RouteQueryRequestSchema'
class aries_cloudagent.protocols.routing.v1_0.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

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.routing.v1_0.messages.route_query_response module

Return existing forwarding routes in response to a query.

class aries_cloudagent.protocols.routing.v1_0.messages.route_query_response.RouteQueryResponse(*, routes: Sequence[aries_cloudagent.protocols.routing.v1_0.models.route_query_result.RouteQueryResult] = None, paginated: aries_cloudagent.protocols.routing.v1_0.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.v1_0.handlers.route_query_response_handler.RouteQueryResponseHandler'
message_type = 'routing/1.0/route-query-response'
schema_class = 'RouteQueryResponseSchema'
class aries_cloudagent.protocols.routing.v1_0.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

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.routing.v1_0.messages.route_update_request module

Request to update forwarding routes.

class aries_cloudagent.protocols.routing.v1_0.messages.route_update_request.RouteUpdateRequest(*, updates: Sequence[aries_cloudagent.protocols.routing.v1_0.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.v1_0.handlers.route_update_request_handler.RouteUpdateRequestHandler'
message_type = 'routing/1.0/route-update-request'
schema_class = 'RouteUpdateRequestSchema'
class aries_cloudagent.protocols.routing.v1_0.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

unknown

Used by autodoc_mock_imports.

updates

Used by autodoc_mock_imports.

aries_cloudagent.protocols.routing.v1_0.messages.route_update_response module

Response for a route update request.

class aries_cloudagent.protocols.routing.v1_0.messages.route_update_response.RouteUpdateResponse(*, updated: Sequence[aries_cloudagent.protocols.routing.v1_0.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.v1_0.handlers.route_update_response_handler.RouteUpdateResponseHandler'
message_type = 'routing/1.0/route-update-response'
schema_class = 'RouteUpdateResponseSchema'
class aries_cloudagent.protocols.routing.v1_0.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

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.routing.v1_0.models package
Submodules
aries_cloudagent.protocols.routing.v1_0.models.paginate module

An object for containing the request pagination information.

class aries_cloudagent.protocols.routing.v1_0.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 Meta[source]

Bases: object

Paginate metadata.

schema_class = 'PaginateSchema'
class aries_cloudagent.protocols.routing.v1_0.models.paginate.PaginateSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Paginate schema.

class Meta[source]

Bases: object

PaginateSchema metadata.

model_class

alias of Paginate

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.routing.v1_0.models.paginated module

An object for containing the response pagination information.

class aries_cloudagent.protocols.routing.v1_0.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 Meta[source]

Bases: object

Paginated metadata.

schema_class = 'PaginatedSchema'
class aries_cloudagent.protocols.routing.v1_0.models.paginated.PaginatedSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Paginated schema.

class Meta[source]

Bases: object

PaginatedSchema metadata.

model_class

alias of Paginated

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.routing.v1_0.models.route_query_result module

An object for containing returned route information.

class aries_cloudagent.protocols.routing.v1_0.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 Meta[source]

Bases: object

RouteQueryResult metadata.

schema_class = 'RouteQueryResultSchema'
class aries_cloudagent.protocols.routing.v1_0.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

alias of RouteQueryResult

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.routing.v1_0.models.route_record module

An object for containing information on an individual route.

class aries_cloudagent.protocols.routing.v1_0.models.route_record.RouteRecord(*, record_id: str = None, role: str = None, connection_id: str = None, wallet_id: str = None, recipient_key: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Class representing stored route information.

class Meta[source]

Bases: object

RouteRecord metadata.

schema_class = 'RouteRecordSchema'
RECORD_ID_NAME = 'record_id'
RECORD_TYPE = 'forward_route'
ROLE_CLIENT = 'client'
ROLE_SERVER = 'server'
TAG_NAMES = {'connection_id', 'recipient_key', 'role', 'wallet_id'}
record_id

Get record ID.

record_value

Accessor for JSON record value.

classmethod retrieve_by_connection_id(session: aries_cloudagent.core.profile.ProfileSession, connection_id: str) → aries_cloudagent.protocols.routing.v1_0.models.route_record.RouteRecord[source]

Retrieve a route record by connection ID.

Parameters:
Returns:

retrieved route record

Return type:

RouteRecord

classmethod retrieve_by_recipient_key(session: aries_cloudagent.core.profile.ProfileSession, recipient_key: str) → aries_cloudagent.protocols.routing.v1_0.models.route_record.RouteRecord[source]

Retrieve a route record by recipient key.

Parameters:
Returns:

retrieved route record

Return type:

RouteRecord

class aries_cloudagent.protocols.routing.v1_0.models.route_record.RouteRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

RouteRecord schema.

class Meta[source]

Bases: object

RouteRecordSchema metadata.

model_class

alias of RouteRecord

unknown

Used by autodoc_mock_imports.

connection_id

Used by autodoc_mock_imports.

recipient_key

Used by autodoc_mock_imports.

record_id

Used by autodoc_mock_imports.

role

Used by autodoc_mock_imports.

validate_fields(data, **kwargs)[source]

Validate schema fields.

Parameters:data – The data to validate
Raises:ValidationError – If any of the fields do not validate
wallet_id

Used by autodoc_mock_imports.

aries_cloudagent.protocols.routing.v1_0.models.route_update module

An object for containing route information to be updated.

class aries_cloudagent.protocols.routing.v1_0.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 Meta[source]

Bases: object

RouteUpdate metadata.

schema_class = 'RouteUpdateSchema'
class aries_cloudagent.protocols.routing.v1_0.models.route_update.RouteUpdateSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

RouteUpdate schema.

class Meta[source]

Bases: object

RouteUpdateSchema metadata.

model_class

alias of RouteUpdate

unknown

Used by autodoc_mock_imports.

action

Used by autodoc_mock_imports.

recipient_key

Used by autodoc_mock_imports.

aries_cloudagent.protocols.routing.v1_0.models.route_updated module

An object for containing updated route information.

class aries_cloudagent.protocols.routing.v1_0.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.

class Meta[source]

Bases: object

RouteUpdated metadata.

schema_class = 'RouteUpdatedSchema'
RESULT_CLIENT_ERROR = 'client_error'
RESULT_NO_CHANGE = 'no_change'
RESULT_SERVER_ERROR = 'server_error'
RESULT_SUCCESS = 'success'
class aries_cloudagent.protocols.routing.v1_0.models.route_updated.RouteUpdatedSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

RouteUpdated schema.

class Meta[source]

Bases: object

RouteUpdatedSchema metadata.

model_class

alias of RouteUpdated

unknown

Used by autodoc_mock_imports.

action

Used by autodoc_mock_imports.

recipient_key

Used by autodoc_mock_imports.

result

Used by autodoc_mock_imports.

Submodules
aries_cloudagent.protocols.routing.v1_0.manager module

Routing manager classes for tracking and inspecting routing records.

exception aries_cloudagent.protocols.routing.v1_0.manager.RouteNotFoundError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.protocols.routing.v1_0.manager.RoutingManagerError

Requested route was not found.

class aries_cloudagent.protocols.routing.v1_0.manager.RoutingManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for handling routing records.

RECORD_TYPE = 'forward_route'
create_route_record(client_connection_id: str = None, recipient_key: str = None, internal_wallet_id: str = None) → aries_cloudagent.protocols.routing.v1_0.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
  • internal_wallet_id – The ID of the wallet record. Used for internal routing
Returns:

The new routing record

delete_route_record(route: aries_cloudagent.protocols.routing.v1_0.models.route_record.RouteRecord)[source]

Remove an existing route record.

get_recipient(recip_verkey: str) → aries_cloudagent.protocols.routing.v1_0.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.v1_0.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: Coroutine[T_co, T_contra, V_co])[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.v1_0.models.route_update.RouteUpdate]) → Sequence[aries_cloudagent.protocols.routing.v1_0.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.v1_0.manager.RoutingManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Generic routing error.

aries_cloudagent.protocols.routing.v1_0.message_types module

Message type identifiers for Routing.

Submodules
aries_cloudagent.protocols.routing.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.trustping package
Subpackages
aries_cloudagent.protocols.trustping.v1_0 package
Subpackages
aries_cloudagent.protocols.trustping.v1_0.handlers package
Submodules
aries_cloudagent.protocols.trustping.v1_0.handlers.ping_handler module

Ping handler.

class aries_cloudagent.protocols.trustping.v1_0.handlers.ping_handler.PingHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Ping handler class.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle ping message.

Parameters:
  • context – Request context
  • responder – Responder used to reply
aries_cloudagent.protocols.trustping.v1_0.handlers.ping_response_handler module

Ping response handler.

class aries_cloudagent.protocols.trustping.v1_0.handlers.ping_response_handler.PingResponseHandler[source]

Bases: aries_cloudagent.messaging.base_handler.BaseHandler

Ping response handler class.

handle(context: aries_cloudagent.messaging.request_context.RequestContext, responder: aries_cloudagent.messaging.responder.BaseResponder)[source]

Handle ping response message.

Parameters:
  • context – Request context
  • responder – Responder used to reply
aries_cloudagent.protocols.trustping.v1_0.messages package
Submodules
aries_cloudagent.protocols.trustping.v1_0.messages.ping module

Represents a trust ping message.

class aries_cloudagent.protocols.trustping.v1_0.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 Meta[source]

Bases: object

Ping metadata.

handler_class = 'aries_cloudagent.protocols.trustping.v1_0.handlers.ping_handler.PingHandler'
message_type = 'trust_ping/1.0/ping'
schema_class = 'PingSchema'
class aries_cloudagent.protocols.trustping.v1_0.messages.ping.PingSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessageSchema

Schema for Ping class.

class Meta[source]

Bases: object

PingSchema metadata.

model_class

alias of Ping

unknown = 'exclude'
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.'})>
aries_cloudagent.protocols.trustping.v1_0.messages.ping_response module

Represents an response to a trust ping message.

class aries_cloudagent.protocols.trustping.v1_0.messages.ping_response.PingResponse(*, comment: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.agent_message.AgentMessage

Class representing a ping response.

class Meta[source]

Bases: object

PingResponse metadata.

handler_class = 'aries_cloudagent.protocols.trustping.v1_0.handlers.ping_response_handler.PingResponseHandler'
message_type = 'trust_ping/1.0/ping_response'
schema_class = 'PingResponseSchema'
class aries_cloudagent.protocols.trustping.v1_0.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

unknown = 'exclude'
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.'})>
Submodules
aries_cloudagent.protocols.trustping.v1_0.message_types module

Message type identifiers for Trust Pings.

aries_cloudagent.protocols.trustping.v1_0.routes module

Trust ping admin routes.

class aries_cloudagent.protocols.trustping.v1_0.routes.PingConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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.'})>
class aries_cloudagent.protocols.trustping.v1_0.routes.PingRequestResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for performing a ping.

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 aries_cloudagent.protocols.trustping.v1_0.routes.PingRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for performing a ping.

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.'})>
aries_cloudagent.protocols.trustping.v1_0.routes.connections_send_ping(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054e3b1d0>)[source]

Request handler for sending a trust ping to a connection.

Parameters:request – aiohttp request object
aries_cloudagent.protocols.trustping.v1_0.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054e3b1d0>)[source]

Amend swagger API.

aries_cloudagent.protocols.trustping.v1_0.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb054e3b1d0>)[source]

Register routes.

Submodules
aries_cloudagent.protocols.trustping.definition module

Version definitions for this protocol.

Submodules
aries_cloudagent.protocols.didcomm_prefix module

DIDComm prefix management.

class aries_cloudagent.protocols.didcomm_prefix.DIDCommPrefix[source]

Bases: enum.Enum

Enum for DIDComm Prefix, old or new style, per Aries RFC 384.

NEW = 'https://didcomm.org'
OLD = 'did:sov:BzCbsNYhMrjHiqZDTUASHg;spec'
qualify(msg_type: str = None) → str[source]

Qualify input message type with prefix and separator.

qualify_all = <bound method DIDCommPrefix.qualify_all of <enum 'DIDCommPrefix'>>[source]
qualify_current = <function DIDCommPrefix.qualify_current>[source]
set = <function DIDCommPrefix.set>[source]
unqualify = <function DIDCommPrefix.unqualify>[source]
aries_cloudagent.protocols.didcomm_prefix.qualify(msg_type: str, prefix: str)[source]

Qualify a message type with a prefix, if unqualified.

aries_cloudagent.revocation package
Subpackages
aries_cloudagent.revocation.models package
Submodules
aries_cloudagent.revocation.models.indy module

Indy utilities for revocation.

class aries_cloudagent.revocation.models.indy.NonRevocationInterval(fro: int = None, to: int = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Indy non-revocation interval.

class Meta[source]

Bases: object

NonRevocationInterval metadata.

schema_class = 'NonRevocationIntervalSchema'
covers(timestamp: int = None) → bool[source]

Whether input timestamp (default now) lies within non-revocation interval.

Parameters:timestamp – time of interest
Returns:whether input time satisfies non-revocation interval
timestamp() → bool[source]

Return a timestamp that the non-revocation interval covers.

class aries_cloudagent.revocation.models.indy.NonRevocationIntervalSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Schema to allow serialization/deserialization of non-revocation intervals.

class Meta[source]

Bases: object

NonRevocationIntervalSchema metadata.

model_class

alias of NonRevocationInterval

fro = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IntEpoch 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 integer.', 'too_large': 'Number too large.'})>
to = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IntEpoch 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 integer.', 'too_large': 'Number too large.'})>
aries_cloudagent.revocation.models.issuer_cred_rev_record module

Issuer credential revocation information.

class aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord(*, record_id: str = None, state: str = None, cred_ex_id: str = None, rev_reg_id: str = None, cred_rev_id: str = None, cred_def_id: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Represents credential revocation information to retain post-issue.

class Meta[source]

Bases: object

IssuerCredRevRecord metadata.

schema_class = 'IssuerCredRevRecordSchema'
RECORD_ID_NAME = 'record_id'
RECORD_TOPIC = 'issuer_cred_rev'
RECORD_TYPE = 'issuer_cred_rev'
STATE_ISSUED = 'issued'
STATE_REVOKED = 'revoked'
TAG_NAMES = {'cred_def_id', 'cred_ex_id', 'cred_rev_id', 'rev_reg_id', 'state'}
classmethod query_by_ids(session: aries_cloudagent.core.profile.ProfileSession, *, cred_def_id: str = None, rev_reg_id: str = None, state: str = None) → Sequence[aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord][source]

Retrieve issuer cred rev records by cred def id and/or rev reg id.

Parameters:
  • session – the profile session to use
  • cred_def_id – the cred def id by which to filter
  • rev_reg_id – the rev reg id by which to filter
  • state – a state value by which to filter
record_id

Accessor for the ID associated with this exchange.

classmethod retrieve_by_cred_ex_id(session: aries_cloudagent.core.profile.ProfileSession, cred_ex_id: str) → aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord[source]

Retrieve an issuer cred rev record by rev reg id and cred rev id.

classmethod retrieve_by_ids(session: aries_cloudagent.core.profile.ProfileSession, rev_reg_id: str, cred_rev_id: str) → aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord[source]

Retrieve an issuer cred rev record by rev reg id and cred rev id.

set_state(session: aries_cloudagent.core.profile.ProfileSession, state: str = None)[source]

Change the issuer cred rev record state (default issued).

class aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

Schema to allow de/serialization of credential revocation records.

class Meta[source]

Bases: object

IssuerCredRevRecordSchema metadata.

model_class

alias of IssuerCredRevRecord

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.'})>
cred_ex_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.'})>
cred_rev_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredRevId 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.'})>
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.'})>
rev_reg_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegId 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.'})>
aries_cloudagent.revocation.models.issuer_rev_reg_record module

Issuer revocation registry storage handling.

class aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord(*, record_id: str = None, state: str = None, cred_def_id: str = None, error_msg: str = None, issuer_did: str = None, max_cred_num: int = None, revoc_def_type: str = None, revoc_reg_id: str = None, revoc_reg_def: Union[aries_cloudagent.indy.models.revocation.IndyRevRegDef, Mapping[KT, VT_co]] = None, revoc_reg_entry: Union[aries_cloudagent.indy.models.revocation.IndyRevRegEntry, Mapping[KT, VT_co]] = None, tag: str = None, tails_hash: str = None, tails_local_path: str = None, tails_public_uri: str = None, pending_pub: Sequence[str] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Class for managing local issuing revocation registries.

LOG_STATE_FLAG = 'debug.revocation'
class Meta[source]

Bases: object

IssuerRevRegRecord metadata.

schema_class = 'IssuerRevRegRecordSchema'
RECORD_ID_NAME = 'record_id'
RECORD_TOPIC = 'revocation_registry'
RECORD_TYPE = 'issuer_rev_reg'
REVOC_DEF_TYPE_CL = 'CL_ACCUM'
STATE_ACTIVE = 'active'
STATE_FULL = 'full'
STATE_GENERATED = 'generated'
STATE_INIT = 'init'
STATE_POSTED = 'posted'
TAG_NAMES = {'cred_def_id', 'issuer_did', 'revoc_def_type', 'revoc_reg_id', 'state'}
clear_pending(session: aries_cloudagent.core.profile.ProfileSession, cred_rev_ids: Sequence[str] = None) → None[source]

Clear pending revocations and save any resulting record change.

Parameters:
  • session – The profile session to use
  • cred_rev_ids – Credential revocation identifiers to clear; default all
generate_registry(profile: aries_cloudagent.core.profile.Profile)[source]

Create the revocation registry definition and tails file.

get_registry() → aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry[source]

Create a RevocationRegistry instance from this record.

mark_pending(session: aries_cloudagent.core.profile.ProfileSession, cred_rev_id: str) → None[source]

Mark a credential revocation id as revoked pending publication to ledger.

Parameters:
  • session – The profile session to use
  • cred_rev_id – The credential revocation identifier for credential to revoke
classmethod query_by_cred_def_id(session: aries_cloudagent.core.profile.ProfileSession, cred_def_id: str, state: str = None) → Sequence[aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord][source]

Retrieve issuer revocation registry records by credential definition ID.

Parameters:
  • session – The profile session to use
  • cred_def_id – The credential definition ID to filter by
  • state – A state value to filter by
classmethod query_by_pending(session: aries_cloudagent.core.profile.ProfileSession) → Sequence[aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord][source]

Retrieve issuer revocation records with revocations pending.

Parameters:session – The profile session to use
record_id

Accessor for the record ID.

record_value

Accessor for JSON value properties of this revocation registry record.

classmethod retrieve_by_revoc_reg_id(session: aries_cloudagent.core.profile.ProfileSession, revoc_reg_id: str) → aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord[source]

Retrieve a revocation registry record by revocation registry ID.

Parameters:
  • session – The profile session to use
  • revoc_reg_id – The revocation registry ID
revoc_reg_def

Accessor; get deserialized.

revoc_reg_entry

Accessor; get deserialized.

send_def(profile: aries_cloudagent.core.profile.Profile, write_ledger: bool = True, endorser_did: str = None)[source]

Send the revocation registry definition to the ledger.

send_entry(profile: aries_cloudagent.core.profile.Profile, write_ledger: bool = True, endorser_did: str = None)[source]

Send a registry entry to the ledger.

set_state(session: aries_cloudagent.core.profile.ProfileSession, state: str = None)[source]

Change the registry state (default full).

set_tails_file_public_uri(profile: aries_cloudagent.core.profile.Profile, tails_file_uri: str)[source]

Update tails file’s publicly accessible URI.

stage_pending_registry(profile: aries_cloudagent.core.profile.Profile, max_attempts: int = 5)[source]

Prepare registry definition for future use.

class aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

Schema to allow serialization/deserialization of issuer rev reg records.

class Meta[source]

Bases: object

IssuerRevRegRecordSchema metadata.

model_class

alias of IssuerRevRegRecord

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.'})>
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.'})>
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.'})>
max_cred_num = <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.'})>
pending_pub = <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.'})>
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.'})>
revoc_def_type = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<Equal(comparable='CL_ACCUM', error='Must be equal to {other}.')>, 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.'})>
revoc_reg_def = <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.'})>
revoc_reg_entry = <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.'})>
revoc_reg_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegId 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.'})>
tag = <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.'})>
tails_hash = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Base58SHA256Hash 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.'})>
tails_local_path = <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.'})>
tails_public_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.'})>
aries_cloudagent.revocation.models.revocation_registry module

Classes for managing a revocation registry.

class aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry(registry_id: str = None, *, cred_def_id: str = None, issuer_did: str = None, max_creds: int = None, reg_def_type: str = None, tag: str = None, tails_local_path: str = None, tails_public_uri: str = None, tails_hash: str = None, reg_def: dict = None)[source]

Bases: object

Manage a revocation registry and tails file.

MAX_SIZE = 32768
MIN_SIZE = 4
cred_def_id

Accessor for the credential definition ID.

classmethod from_definition(revoc_reg_def: dict, public_def: bool) → aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry[source]

Initialize a revocation registry instance from a definition.

get_or_fetch_local_tails_path()[source]

Get the local tails path, retrieving from the remote if necessary.

get_receiving_tails_local_path()[source]

Make the local path to the tails file we download from remote URI.

has_local_tails_file() → bool[source]

Test if the tails file exists locally.

issuer_did

Accessor for the issuer DID.

max_creds

Accessor for the maximum number of issued credentials.

reg_def

Accessor for the revocation registry definition.

reg_def_type

Accessor for the revocation registry type.

registry_id

Accessor for the revocation registry ID.

retrieve_tails()[source]

Fetch the tails file from the public URI.

tag

Accessor for the tag part of the revoc. reg. ID.

tails_hash

Accessor for the tails file hash.

tails_local_path

Accessor for the tails file local path.

tails_public_uri

Accessor for the tails file public URI.

Submodules
aries_cloudagent.revocation.error module

Revocation error classes.

exception aries_cloudagent.revocation.error.RevocationError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Base exception for revocation-related errors.

exception aries_cloudagent.revocation.error.RevocationNotSupportedError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.revocation.error.RevocationError

Attempted to perform revocation-related operation where inapplicable.

exception aries_cloudagent.revocation.error.RevocationRegistryBadSizeError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.revocation.error.RevocationError

Attempted to create registry with maximum credentials too large or too small.

aries_cloudagent.revocation.indy module

Indy revocation registry management.

class aries_cloudagent.revocation.indy.IndyRevocation(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for managing Indy credential revocation.

REV_REG_CACHE = {}
get_active_issuer_rev_reg_record(cred_def_id: str) → aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord[source]

Return current active registry for issuing a given credential definition.

Parameters:cred_def_id – ID of the base credential definition
get_issuer_rev_reg_record(revoc_reg_id: str) → aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord[source]

Return a revocation registry record by identifier.

Parameters:revoc_reg_id – ID of the revocation registry
get_ledger_registry(revoc_reg_id: str) → aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry[source]

Get a revocation registry from the ledger, fetching as necessary.

init_issuer_registry(cred_def_id: str, max_cred_num: int = None, revoc_def_type: str = None, tag: str = None) → aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord[source]

Create a new revocation registry record for a credential definition.

list_issuer_registries() → Sequence[aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord][source]

List the issuer’s current revocation registries.

aries_cloudagent.revocation.manager module

Classes to manage credential revocation.

class aries_cloudagent.revocation.manager.RevocationManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: object

Class for managing revocation operations.

clear_pending_revocations(purge: Mapping[str, Sequence[str]] = None) → Mapping[str, Sequence[str]][source]

Clear pending revocation publications.

Parameters:purge

Mapping from revocation registry identifiers to all credential revocation identifiers within each to clear. Specify null/empty map for all revocation registries. Specify empty sequence per revocation registry identifier for all pending within the revocation registry; e.g.,

{} - clear all pending revocations from all revocation registries

{
“R17v42T4pk…:4:R17v42T4pk…:3:CL:19:tag:CL_ACCUM:0”: [], “R17v42T4pk…:4:R17v42T4pk…:3:CL:19:tag:CL_ACCUM:1”: [“1”, “2”]
} - clear
  • all pending revocations from all revocation registry tagged 0
  • pending [“1”, “2”] from revocation registry tagged 1
  • no pending revocations from any other revocation registries.
Returns:mapping from revocation registry id to its remaining cred rev ids still marked pending, omitting revocation registries with no remaining pending publications.
publish_pending_revocations(rrid2crid: Mapping[str, Sequence[str]] = None, write_ledger: bool = True, endorser_did: str = None) → Mapping[str, Sequence[str]][source]

Publish pending revocations to the ledger.

Parameters:
  • rrid2crid

    Mapping from revocation registry identifiers to all credential revocation identifiers within each to publish. Specify null/empty map for all revocation registries. Specify empty sequence per revocation registry identifier for all pending within the revocation registry; e.g.,

    {} - publish all pending revocations from all revocation registries

    {
    “R17v42T4pk…:4:R17v42T4pk…:3:CL:19:tag:CL_ACCUM:0”: [], “R17v42T4pk…:4:R17v42T4pk…:3:CL:19:tag:CL_ACCUM:1”: [“1”, “2”]
    } - publish:
    • all pending revocations from all revocation registry tagged 0
    • pending [“1”, “2”] from revocation registry tagged 1
    • no pending revocations from any other revocation registries.
  • write_ledger – wether to write the transaction to the ledger, or prepare a transaction to be endorsed
  • endorser_did – the did of the endorser, if endorsing the transaction

Returns: mapping from each revocation registry id to its cred rev ids published.

revoke_credential(rev_reg_id: str, cred_rev_id: str, publish: bool = False)[source]

Revoke a credential.

Optionally, publish the corresponding revocation registry delta to the ledger.

Parameters:
  • rev_reg_id – revocation registry id
  • cred_rev_id – credential revocation id
  • publish – whether to publish the resulting revocation registry delta, along with any revocations pending against it
revoke_credential_by_cred_ex_id(cred_ex_id: str, publish: bool = False)[source]

Revoke a credential by its credential exchange identifier at issue.

Optionally, publish the corresponding revocation registry delta to the ledger.

Parameters:
  • cred_ex_id – credential exchange identifier
  • publish – whether to publish the resulting revocation registry delta, along with any revocations pending against it
exception aries_cloudagent.revocation.manager.RevocationManagerError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Revocation manager error.

aries_cloudagent.revocation.routes module

Revocation registry admin routes.

class aries_cloudagent.revocation.routes.ClearPendingRevocationsRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for clear pending revocations API call.

purge = <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.'})>
class aries_cloudagent.revocation.routes.CreateRevRegTxnForEndorserOptionSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Class for user to input whether to create a transaction for endorser or not.

create_transaction_for_endorser = <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.'})>
class aries_cloudagent.revocation.routes.CredRevRecordQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for credential revocation record request.

cred_ex_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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.'})>
cred_rev_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredRevId 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.'})>
rev_reg_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegId 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.'})>
validate_fields(data, **kwargs)[source]

Validate schema fields - must have (rr-id and cr-id) xor cx-id.

class aries_cloudagent.revocation.routes.CredRevRecordResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for credential revocation record request.

result = <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.'})>
class aries_cloudagent.revocation.routes.PublishRevocationsSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request and result schema for revocation publication API call.

rrid2crid = <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.'})>
class aries_cloudagent.revocation.routes.RevRegConnIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking connection id.

conn_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 aries_cloudagent.revocation.routes.RevRegCreateRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for revocation registry creation request.

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.'})>
max_cred_num = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegSize 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 integer.', 'too_large': 'Number too large.'})>
class aries_cloudagent.revocation.routes.RevRegIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking rev reg id.

rev_reg_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegId 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.'})>
class aries_cloudagent.revocation.routes.RevRegIssuedResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for revocation registry credentials issued request.

result = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.WholeNumber 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 integer.', 'too_large': 'Number too large.'})>
class aries_cloudagent.revocation.routes.RevRegResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for revocation registry creation request.

result = <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.'})>
class aries_cloudagent.revocation.routes.RevRegUpdateTailsFileUriSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema for updating tails file URI.

tails_public_uri = <fields.Url(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 URL.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
class aries_cloudagent.revocation.routes.RevRegsCreatedQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query string parameters and validators for rev regs created request.

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.'})>
state = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['init', 'generated', 'posted', 'active', 'full'], 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.revocation.routes.RevRegsCreatedSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for request for revocation registries created.

rev_reg_ids = <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 aries_cloudagent.revocation.routes.RevocationCredDefIdMatchInfoSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Path parameters and validators for request taking cred def id.

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.'})>
class aries_cloudagent.revocation.routes.RevocationModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Revocation Module.

class aries_cloudagent.revocation.routes.RevokeRequestSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.revocation.routes.CredRevRecordQueryStringSchema

Parameters and validators for revocation request.

publish = <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.'})>
class aries_cloudagent.revocation.routes.SetRevRegStateQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Query string parameters and validators for request to set rev reg state.

state = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['init', 'generated', 'posted', 'active', 'full'], labels=[], error='Must be one of: {choices}.')>, 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.revocation.routes.TxnOrPublishRevocationsResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for credential definition send request.

sent = <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.'})>
txn = <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.'})>
class aries_cloudagent.revocation.routes.TxnOrRevRegResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for credential definition send request.

sent = <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.'})>
txn = <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.'})>
aries_cloudagent.revocation.routes.clear_pending_revocations(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler for clearing pending revocations.

Parameters:request – aiohttp request object
Returns:Credential revocation ids still pending revocation by revocation registry id.
aries_cloudagent.revocation.routes.create_rev_reg(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to create a new revocation registry.

Parameters:request – aiohttp request object
Returns:The issuer revocation registry record
aries_cloudagent.revocation.routes.get_active_rev_reg(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to get current active revocation registry by cred def id.

Parameters:request – aiohttp request object
Returns:The revocation registry identifier
aries_cloudagent.revocation.routes.get_cred_rev_record(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to get credential revocation record.

Parameters:request – aiohttp request object
Returns:The issuer credential revocation record
aries_cloudagent.revocation.routes.get_rev_reg(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to get a revocation registry by rev reg id.

Parameters:request – aiohttp request object
Returns:The revocation registry
aries_cloudagent.revocation.routes.get_rev_reg_issued(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to get number of credentials issued against revocation registry.

Parameters:request – aiohttp request object
Returns:Number of credentials issued against revocation registry
aries_cloudagent.revocation.routes.get_tails_file(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>[source]

Request handler to download tails file for revocation registry.

Parameters:request – aiohttp request object
Returns:The tails file in FileResponse
aries_cloudagent.revocation.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Amend swagger API.

aries_cloudagent.revocation.routes.publish_revocations(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler for publishing pending revocations to the ledger.

Parameters:request – aiohttp request object
Returns:Credential revocation ids published as revoked by revocation registry id.
aries_cloudagent.revocation.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Register routes.

aries_cloudagent.revocation.routes.rev_regs_created(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to get revocation registries that current agent created.

Parameters:request – aiohttp request object
Returns:List of identifiers of matching revocation registries.
aries_cloudagent.revocation.routes.revoke(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler for storing a credential request.

Parameters:request – aiohttp request object
Returns:The credential request details.
aries_cloudagent.revocation.routes.send_rev_reg_def(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to send revocation registry definition by reg reg id to ledger.

Parameters:request – aiohttp request object
Returns:The issuer revocation registry record
aries_cloudagent.revocation.routes.send_rev_reg_entry(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to send rev reg entry by registry id to ledger.

Parameters:request – aiohttp request object
Returns:The revocation registry record
aries_cloudagent.revocation.routes.set_rev_reg_state(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to set a revocation registry state manually.

Parameters:request – aiohttp request object
Returns:The revocation registry record, updated
aries_cloudagent.revocation.routes.update_rev_reg(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to update a rev reg’s public tails URI by registry id.

Parameters:request – aiohttp request object
Returns:The revocation registry record
aries_cloudagent.revocation.routes.upload_tails_file(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05403e3d0>)[source]

Request handler to upload local tails file for revocation registry.

Parameters:request – aiohttp request object
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 stored records interface.

add_record(record: aries_cloudagent.storage.record.StorageRecord)[source]

Add a new record to the store.

Parameters:recordStorageRecord to be stored
delete_all_records(type_filter: str, tag_query: Mapping[KT, VT_co] = None)[source]

Remove all records matching a particular type filter and tag query.

delete_record(record: aries_cloudagent.storage.record.StorageRecord)[source]

Delete an existing record.

Parameters:recordStorageRecord to delete
find_all_records(type_filter: str, tag_query: Mapping[KT, VT_co] = None, options: Mapping[KT, VT_co] = None)[source]

Retrieve all records matching a particular type filter and tag query.

find_record(type_filter: str, tag_query: Mapping[KT, VT_co] = None, options: Mapping[KT, VT_co] = None) → aries_cloudagent.storage.record.StorageRecord[source]

Find a record using a unique tag filter.

Parameters:
  • type_filter – Filter string
  • tag_query – Tags to query
  • options – Dictionary of backend-specific options
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

update_record(record: aries_cloudagent.storage.record.StorageRecord, value: str, tags: Mapping[KT, VT_co])[source]

Update an existing stored record’s value and tags.

Parameters:
  • recordStorageRecord to update
  • value – The new value
  • tags – The new tags
class aries_cloudagent.storage.base.BaseStorageSearch[source]

Bases: abc.ABC

Abstract stored records search interface.

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.BaseStorageSearchSession[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 BaseStorageSearchSession

class aries_cloudagent.storage.base.BaseStorageSearchSession[source]

Bases: abc.ABC

Abstract stored records search session interface.

close()[source]

Dispose of the search query.

fetch(max_count: int = None) → 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. If not provided, defaults to the backend’s preferred page size
Returns:A list of StorageRecord instances
class aries_cloudagent.storage.base.IterSearch(search: aries_cloudagent.storage.base.BaseStorageSearchSession, page_size: int = None)[source]

Bases: object

A generic record search async iterator.

aries_cloudagent.storage.base.validate_record(record: aries_cloudagent.storage.record.StorageRecord, *, delete=False)[source]

Ensure that a record is ready to be saved/updated/deleted.

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.in_memory module

Basic in-memory storage implementation (non-wallet).

class aries_cloudagent.storage.in_memory.InMemoryStorage(profile: aries_cloudagent.core.in_memory.InMemoryProfile)[source]

Bases: aries_cloudagent.storage.base.BaseStorage, aries_cloudagent.storage.base.BaseStorageSearch

Basic in-memory storage class.

add_record(record: aries_cloudagent.storage.record.StorageRecord)[source]

Add a new record to the store.

Parameters:

recordStorageRecord to be stored

Raises:
  • StorageError – If no record is provided
  • StorageError – If the record has no ID
delete_all_records(type_filter: str, tag_query: Mapping[KT, VT_co] = None)[source]

Remove all records matching a particular type filter and tag query.

delete_record(record: aries_cloudagent.storage.record.StorageRecord)[source]

Delete a record.

Parameters:recordStorageRecord to delete
Raises:StorageNotFoundError – If record not found
find_all_records(type_filter: str, tag_query: Mapping[KT, VT_co] = None, options: Mapping[KT, VT_co] = None)[source]

Retrieve all records matching a particular type filter and tag query.

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.in_memory.InMemoryStorageSearch[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 InMemoryStorageSearch

update_record(record: aries_cloudagent.storage.record.StorageRecord, value: str, tags: Mapping[KT, VT_co])[source]

Update an existing stored record’s value.

Parameters:
  • recordStorageRecord to update
  • value – The new value
  • tags – The new tags
Raises:

StorageNotFoundError – If record not found

class aries_cloudagent.storage.in_memory.InMemoryStorageSearch(profile: aries_cloudagent.core.in_memory.InMemoryProfile, 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.BaseStorageSearchSession

Represent an active stored records search.

close()[source]

Dispose of the search query.

fetch(max_count: int = None) → 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. If not provided, defaults to the backend’s preferred page size
Returns:A list of StorageRecord instances
Raises:StorageSearchError – If the search query has not been opened
aries_cloudagent.storage.in_memory.tag_query_match(tags: dict, tag_query: dict) → bool[source]

Match simple tag filters (string values).

aries_cloudagent.storage.in_memory.tag_value_match(value: str, match: dict) → bool[source]

Match a single tag against a tag subquery.

TODO: What type coercion is needed? (support int or float values?)

aries_cloudagent.storage.indy module

Indy implementation of BaseStorage interface.

class aries_cloudagent.storage.indy.IndySdkStorage(wallet: aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet)[source]

Bases: aries_cloudagent.storage.base.BaseStorage, aries_cloudagent.storage.base.BaseStorageSearch

Indy Non-Secrets interface.

add_record(record: aries_cloudagent.storage.record.StorageRecord)[source]

Add a new record to the store.

Parameters:recordStorageRecord to be stored
delete_all_records(type_filter: str, tag_query: Mapping[KT, VT_co] = None)[source]

Remove all records matching a particular type filter and tag query.

delete_record(record: aries_cloudagent.storage.record.StorageRecord)[source]

Delete a record.

Parameters:

recordStorageRecord to delete

Raises:
  • StorageNotFoundError – If record not found
  • StorageError – If a libindy error occurs
find_all_records(type_filter: str, tag_query: Mapping[KT, VT_co] = None, options: Mapping[KT, VT_co] = None)[source]

Retrieve all records matching a particular type filter and tag query.

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 provided
  • StorageError – If the record ID not provided
  • StorageNotFoundError – If the record is not found
  • StorageError – 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.IndySdkStorageSearch[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 IndySdkStorageSearch

update_record(record: aries_cloudagent.storage.record.StorageRecord, value: str, tags: Mapping[KT, VT_co])[source]

Update an existing stored record’s value and tags.

Parameters:
  • recordStorageRecord to update
  • value – The new value
  • tags – The new tags
Raises:
  • StorageNotFoundError – If record not found
  • StorageError – If a libindy error occurs
wallet

Accessor for IndyOpenWallet instance.

class aries_cloudagent.storage.indy.IndySdkStorageSearch(store: aries_cloudagent.storage.indy.IndySdkStorage, 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.BaseStorageSearchSession

Represent an active stored records search.

close()[source]

Dispose of the search query.

fetch(max_count: int = None) → 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. If not provided, defaults to the backend’s preferred page size
Returns:A list of StorageRecord instances
Raises:StorageSearchError – If the search query has not been opened
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.tails package
Submodules
aries_cloudagent.tails.base module

Tails server interface base class.

class aries_cloudagent.tails.base.BaseTailsServer[source]

Bases: abc.ABC

Base class for tails server interface.

upload_tails_file(context: aries_cloudagent.config.injection_context.InjectionContext, rev_reg_id: str, tails_file_path: str, interval: float = 1.0, backoff: float = 0.25, max_attempts: int = 5) → Tuple[bool, str][source]

Upload tails file to tails server.

Parameters:
  • rev_reg_id – The revocation registry identifier
  • tails_file – The path to the tails file to upload
  • interval – initial interval between attempts
  • backoff – exponential backoff in retry interval
  • max_attempts – maximum number of attempts to make
aries_cloudagent.tails.error module

Tails server related errors.

exception aries_cloudagent.tails.error.TailsServerNotConfiguredError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Error indicating the tails server plugin hasn’t been configured.

aries_cloudagent.tails.indy_tails_server module

Indy tails server interface class.

class aries_cloudagent.tails.indy_tails_server.IndyTailsServer[source]

Bases: aries_cloudagent.tails.base.BaseTailsServer

Indy tails server interface.

upload_tails_file(context, rev_reg_id: str, tails_file_path: str, interval: float = 1.0, backoff: float = 0.25, max_attempts: int = 5) → Tuple[bool, str][source]

Upload tails file to tails server.

Parameters:
  • context – context with configuration settings
  • rev_reg_id – revocation registry identifier
  • tails_file_path – path to the tails file to upload
  • interval – initial interval between attempts
  • backoff – exponential backoff in retry interval
  • max_attempts – maximum number of attempts to make
aries_cloudagent.transport package
Subpackages
aries_cloudagent.transport.inbound package
Submodules
aries_cloudagent.transport.inbound.base module

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.

start() → None[source]

Start listening for on this transport.

stop() → None[source]

Stop listening for on this transport.

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.

aries_cloudagent.transport.inbound.delivery_queue module

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
message_count_for_key(key: str)[source]

Count of queued messages by key.

Parameters:key – The key to use for lookup
remove_message_for_key(key: str, msg: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]

Remove specified message from queue for key.

Parameters:
  • key – The key to use for lookup
  • msg – The message to remove from the queue
class aries_cloudagent.transport.inbound.delivery_queue.QueuedMessage(msg: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]

Bases: object

Wrapper Class for queued messages.

Allows tracking Metadata.

older_than(compare_timestamp: float) → bool[source]

Age Comparison.

Allows you to test age as compared to the provided timestamp.

Parameters:compare_timestamp – The timestamp to compare
aries_cloudagent.transport.inbound.http module

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 0x7fb053c51650>)[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 0x7fb053c51650>)[source]

Message handler for invites.

Parameters:request – aiohttp request object
Returns:The web response
make_application() → <sphinx.ext.autodoc.importer._MockObject object at 0x7fb053c51650>[source]

Construct the aiohttp application.

start() → None[source]

Start this transport.

Raises:InboundTransportSetupError – If there was an error starting the webserver
stop() → None[source]

Stop this transport.

aries_cloudagent.transport.inbound.manager module

Inbound transport manager.

class aries_cloudagent.transport.inbound.manager.InboundTransportManager(profile: aries_cloudagent.core.profile.Profile, 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.

setup()[source]

Perform setup operations.

start()[source]

Start all registered transports.

start_transport(transport_id: str)[source]

Start a registered inbound transport.

Parameters:transport_id – ID for the inbound transport to start
stop(wait: bool = True)[source]

Stop all registered transports.

aries_cloudagent.transport.inbound.message module

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.

aries_cloudagent.transport.inbound.receipt module

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
aries_cloudagent.transport.inbound.session module

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(*, profile: aries_cloudagent.core.profile.Profile, 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)

add_reply_thread_ids(*thids)[source]

Add a thread ID to the set of potential reply targets.

add_reply_verkeys(*verkeys)[source]

Add a verkey to the set of potential reply targets.

can_respond

Accessor for the session can-respond state.

clear_response()[source]

Handle when the buffered response message has been delivered.

close()[source]

Setter for the session closed 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.

handle_relay_context(payload_enc: Union[str, bytes])[source]

Update the session profile based on the recipients of an incoming 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
set_response(message: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]

Set the contents of the response message buffer.

wait_response() → Union[str, bytes][source]

Wait for a response to be buffered and pack it.

aries_cloudagent.transport.inbound.ws module

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 0x7fb053e5c1d0>[source]

Construct the aiohttp application.

scheme

Accessor for this transport’s scheme.

start() → None[source]

Start this transport.

Raises:InboundTransportSetupError – If there was an error starting the webserver
stop() → None[source]

Stop this transport.

aries_cloudagent.transport.outbound package
Submodules
aries_cloudagent.transport.outbound.base module

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(profile: aries_cloudagent.core.profile.Profile, payload: Union[str, bytes], endpoint: str, metadata: dict = None)[source]

Handle message from queue.

Parameters:
  • profile – the profile that produced the message
  • payload – message payload in string or byte format
  • endpoint – URI endpoint for delivery
  • metadata – Additional metadata associated with the payload
start()[source]

Start the transport.

stop()[source]

Shut down the transport.

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.

aries_cloudagent.transport.outbound.http module

Http outbound transport.

class aries_cloudagent.transport.outbound.http.HttpTransport[source]

Bases: aries_cloudagent.transport.outbound.base.BaseOutboundTransport

Http outbound transport class.

handle_message(profile: aries_cloudagent.core.profile.Profile, payload: Union[str, bytes], endpoint: str, metadata: dict = None, api_key: str = None)[source]

Handle message from queue.

Parameters:
  • profile – the profile that produced the message
  • payload – message payload in string or byte format
  • endpoint – URI endpoint for delivery
  • metadata – Additional metadata associated with the payload
schemes = ('http', 'https')
start()[source]

Start the transport.

stop()[source]

Stop the transport.

aries_cloudagent.transport.outbound.manager module

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.

MAX_RETRY_COUNT = 4
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(profile: aries_cloudagent.core.profile.Profile, outbound: aries_cloudagent.transport.outbound.message.OutboundMessage)[source]

Add an outbound message to the queue.

Parameters:
  • profile – The active profile for the request
  • outbound – The outbound message to deliver
enqueue_webhook(topic: str, payload: dict, endpoint: str, max_attempts: int = None, metadata: dict = 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
  • metadata – Additional metadata associated with the payload
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.

flush()[source]

Wait for any queued messages to be delivered.

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 located
  • OutboundTransportRegistrationError – If the imported class does not specify a schemes attribute
  • OutboundTransportRegistrationError – 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 attribute
  • OutboundTransportRegistrationError – If the scheme has already been registered
setup()[source]

Perform setup operations.

start()[source]

Start all transports and feed messages from the queue.

start_transport(transport_id: str)[source]

Start a registered transport.

stop(wait: bool = True)[source]

Stop all running transports.

class aries_cloudagent.transport.outbound.manager.QueuedOutboundMessage(profile: aries_cloudagent.core.profile.Profile, 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'
aries_cloudagent.transport.outbound.message module

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.

aries_cloudagent.transport.outbound.ws module

Websockets outbound transport.

class aries_cloudagent.transport.outbound.ws.WsTransport[source]

Bases: aries_cloudagent.transport.outbound.base.BaseOutboundTransport

Websockets outbound transport class.

handle_message(profile: aries_cloudagent.core.profile.Profile, payload: Union[str, bytes], endpoint: str, metadata: dict = None)[source]

Handle message from queue.

Parameters:
  • profile – the profile that produced the message
  • payload – message payload in string or byte format
  • endpoint – URI endpoint for delivery
  • metadata – Additional metadata associated with the payload
schemes = ('ws', 'wss')
start()[source]

Start the outbound transport.

stop()[source]

Stop the outbound transport.

aries_cloudagent.transport.queue package
Submodules
aries_cloudagent.transport.queue.base module

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
enqueue(message)[source]

Enqueue a message.

Parameters:message – The message to add to the end of the queue
Raises:asyncio.CancelledError if the queue has been stopped
join()[source]

Wait for the queue to empty.

reset()[source]

Empty the queue and reset the stop event.

stop()[source]

Cancel active iteration of the queue.

task_done()[source]

Indicate that the current task is complete.

aries_cloudagent.transport.queue.basic module

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
enqueue(message)[source]

Enqueue a message.

Parameters:message – The message to add to the end of the queue
Raises:asyncio.CancelledError if the queue has been stopped
join()[source]

Wait for the queue to empty.

make_queue()[source]

Create the queue instance.

reset()[source]

Empty the queue and reset the stop event.

stop()[source]

Cancel active iteration of the queue.

task_done()[source]

Indicate that the current task is complete.

Submodules
aries_cloudagent.transport.error module

Transport-related error classes and codes.

exception aries_cloudagent.transport.error.RecipientKeysError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.transport.error.WireFormatError

Extract recipient keys 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.WireFormatEncodeError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.transport.error.WireFormatError

Encoding error when packing the wire format.

error_code = 'message_encode_error'
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.

exception aries_cloudagent.transport.error.WireFormatParseError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.transport.error.WireFormatError

Parse error when unpacking the wire format.

error_code = 'message_parse_error'
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(session: aries_cloudagent.core.profile.ProfileSession, 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:
  • session – The profile session for providing wallet access
  • 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

get_recipient_keys(message_body: Union[str, bytes]) → List[str][source]

Get all recipient keys from a wire message.

Parameters:message_body – The body of the message
Returns:List of recipient keys from the message body
Raises:RecipientKeysError – If the recipient keys could not be extracted
pack(session: aries_cloudagent.core.profile.ProfileSession, 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(session: aries_cloudagent.core.profile.ProfileSession, 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:
  • session – The profile session for providing wallet access
  • message_body – The body of the message
Returns:

A tuple of the parsed message and a message receipt instance

Raises:
  • WireFormatParseError – If the JSON parsing failed
  • WireFormatParseError – If a wallet is required but can’t be located
unpack(session: aries_cloudagent.core.profile.ProfileSession, message_body: Union[str, bytes], receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt)[source]

Look up the wallet instance and perform the message unpack.

aries_cloudagent.transport.stats module

aiohttp stats collector support.

class aries_cloudagent.transport.stats.StatsTracer(collector: aries_cloudagent.utils.stats.Collector, prefix: str)[source]

Bases: sphinx.ext.autodoc.importer._MockObject

Attach hooks to client session events and report statistics.

connection_queued_end(session, context, params)[source]

Handle the end of a queued connection.

connection_queued_start(session, context, params)[source]

Handle the start of a queued connection.

connection_ready(session, context, params)[source]

Handle the end of connection acquisition.

dns_resolvehost_end(session, context, params)[source]

Handle the end of a DNS resolution.

dns_resolvehost_start(session, context, params)[source]

Handle the start of a DNS resolution.

request_end(session, context, params)[source]

Handle the end of request.

request_start(session, context, params)[source]

Handle the start of a request.

socket_connect_start(session, context, params)[source]

Handle the start of a socket connection.

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(session: aries_cloudagent.core.profile.ProfileSession, 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:
  • session – The profile session for providing wallet access
  • 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

get_recipient_keys(message_body: Union[str, bytes]) → List[str][source]

Get all recipient keys from a wire message.

Parameters:message_body – The body of the message
Returns:List of recipient keys from the message body
Raises:RecipientKeysError – If the recipient keys could not be extracted
parse_message(session: aries_cloudagent.core.profile.ProfileSession, 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:
  • session – The profile session for providing wallet access
  • message_body – The body of the message
Returns:

A tuple of the parsed message and a message receipt instance

Raises:

WireFormatParseError – 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(session: aries_cloudagent.core.profile.ProfileSession, 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:
  • session – The profile session for providing wallet access
  • 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

get_recipient_keys(message_body: Union[str, bytes]) → List[str][source]

Get all recipient keys from a wire message.

Parameters:message_body – The body of the message
Returns:List of recipient keys from the message body
Raises:RecipientKeysError – If the recipient keys could not be extracted
parse_message(session: aries_cloudagent.core.profile.ProfileSession, 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:
  • session – The profile session for providing wallet access
  • message_body – The body of the message
Returns:

A tuple of the parsed message and a message receipt instance

Raises:

WireFormatParseError – 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:
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:
classmethod scan_subpackages(package: str) → Sequence[str][source]

Return a list of sub-packages defined under a named package.

exception aries_cloudagent.utils.classloader.ClassNotFoundError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Class not found error.

class aries_cloudagent.utils.classloader.DeferLoad(cls_path: str)[source]

Bases: object

Helper to defer loading of a class definition.

resolved

Accessor for the resolved class instance.

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.

exception aries_cloudagent.utils.http.PutError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Error raised when an HTTP put 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 0x7fb05627a390> = None, session: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055797310> = 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.http.fetch_stream(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 0x7fb05627a390> = None, session: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055797310> = None)[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.http.put_file(url: str, file_data: dict, extra_data: dict, *, 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 0x7fb05627a390> = None, session: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb055797310> = None, json: bool = False)[source]

Put to HTTP server with automatic retries and timeouts.

Parameters:
  • url – the address to use
  • file_data – dict with data key and path of file to upload
  • extra_data – further content to include in data to put
  • 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.outofband module

Utilities for creating out-of-band messages.

aries_cloudagent.utils.outofband.serialize_outofband(message: aries_cloudagent.messaging.agent_message.AgentMessage, did: aries_cloudagent.wallet.did_info.DIDInfo, endpoint: str) → str[source]

Serialize the agent message as an out-of-band message.

Returns:An OOB message in URL format.
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() → aries_cloudagent.utils.repeat.RepeatAttempt[source]

Get the next attempt instance.

next_interval

Calculate the interval before the next attempt.

timeout(interval: float = None)[source]

Create a context manager for timing out an attempt.

class aries_cloudagent.utils.repeat.RepeatSequence(limit: int = 0, interval: float = 0.0, backoff: float = 0.0)[source]

Bases: object

Represents a repetition sequence.

next_interval(index: int) → float[source]

Calculate the time before the next attempt.

start() → aries_cloudagent.utils.repeat.RepeatAttempt[source]

Get the first attempt in the sequence.

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.

mark(*names)[source]

Make a custom decorator function for adding to the set of groups.

reset()[source]

Reset the collector’s statistics.

results

Accessor for the current set of collected statistics.

timer(*groups)[source]

Create a new timer attached to this collector.

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.

wrap_coro(fn, groups: Sequence[str])[source]

Wrap a coroutine instance to collect timing statistics on execution.

wrap_fn(fn, groups: Sequence[str])[source]

Wrap a function instance to collect timing statistics on execution.

class aries_cloudagent.utils.stats.Stats[source]

Bases: object

A collection of statistics.

extract(names: Sequence[str] = None) → dict[source]

Summarize the stats in a dictionary.

log(name: str, duration: float)[source]

Log an entry in the stats.

class aries_cloudagent.utils.stats.Timer(collector: aries_cloudagent.utils.stats.Collector, groups: Sequence[str])[source]

Bases: object

Timer instance for a running task.

classmethod now()[source]

Fetch a standard timer value.

start() → aries_cloudagent.utils.stats.Timer[source]

Start the timer.

stop()[source]

Stop the timer.

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.

cancel()[source]

Cancel the pending task.

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
cancel()[source]

Cancel any pending or active tasks in the queue.

cancel_pending()[source]

Cancel any pending tasks in the 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.

drain() → _asyncio.Task[source]

Start the process to run queued tasks.

flush()[source]

Wait for any active or pending tasks to be completed.

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

wait_for(timeout: float)[source]

Wait for all queued tasks to complete with a timeout.

aries_cloudagent.utils.task_queue.coro_ident(coro: Coroutine[T_co, T_contra, V_co])[source]

Extract an identifier for a coroutine.

aries_cloudagent.utils.task_queue.coro_timed(coro: Coroutine[T_co, T_contra, V_co], timing: dict)[source]

Capture timing for a coroutine.

aries_cloudagent.utils.task_queue.task_exc_info(task: _asyncio.Task)[source]

Extract exception info from an asyncio task.

aries_cloudagent.utils.tracing module

Event tracing.

class aries_cloudagent.utils.tracing.AdminAPIMessageTracingSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request/result schema including agent message tracing.

This is to be used as a superclass for aca-py admin input/output messages that need to support tracing.

trace = <fields.Boolean(default=False, 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.'})>
aries_cloudagent.utils.tracing.decode_inbound_message(message)[source]

Return bundled message if appropriate.

aries_cloudagent.utils.tracing.get_timer() → float[source]

Return a timer.

aries_cloudagent.utils.tracing.trace_event(context, message, handler: str = None, outcome: str = None, perf_counter: float = None, force_trace: bool = False, raise_errors: bool = False) → float[source]

Log a trace event to a configured target.

Parameters:
  • context – The application context, attributes of interest are: context[“trace.enabled”]: True if we are logging events context[“trace.target”]: Trace target (“log”, “message” or an http endpoint) context[“trace.tag”]: Tag to be included in trace output
  • message – the current message, can be an AgentMessage, InboundMessage, OutboundMessage or Exchange record
  • event – Dict that will be converted to json and posted to the target
aries_cloudagent.utils.tracing.tracing_enabled(context, message) → bool[source]

Determine whether to log trace messages or not.

aries_cloudagent.wallet package

Abstract and Indy wallet handling.

Subpackages
aries_cloudagent.wallet.models package
Submodules
aries_cloudagent.wallet.models.wallet_record module

Wallet record.

class aries_cloudagent.wallet.models.wallet_record.WalletRecord(*, wallet_id: str = None, key_management_mode: str = None, settings: dict = None, wallet_name: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Represents a wallet record.

MODE_MANAGED = 'managed'
MODE_UNMANAGED = 'unmanaged'
class Meta[source]

Bases: object

WalletRecord metadata.

schema_class = 'WalletRecordSchema'
RECORD_ID_NAME = 'wallet_id'
RECORD_TYPE = 'wallet_record'
TAG_NAMES = {'wallet_name'}
is_managed

Accessor to check if the key management mode is managed.

record_value

Accessor for the JSON record value generated for this record.

requires_external_key

Accessor to check if the wallet requires an external key.

settings

Accessor for the context settings associated with this wallet.

update_settings(settings: dict)[source]

Update settings.

wallet_dispatch_type

Accessor for webhook dispatch type of the wallet.

wallet_id

Accessor for the ID associated with this record.

wallet_key

Accessor for the key of the wallet.

wallet_name

Accessor for the name of the wallet.

wallet_type

Accessor for the type of the wallet.

wallet_webhook_urls

Accessor for webhook_urls of the wallet.

class aries_cloudagent.wallet.models.wallet_record.WalletRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

Schema to allow serialization/deserialization of record.

class Meta[source]

Bases: object

WalletRecordSchema metadata.

model_class

alias of WalletRecord

unknown

Used by autodoc_mock_imports.

key_management_mode

Used by autodoc_mock_imports.

settings

Used by autodoc_mock_imports.

wallet_id

Used by autodoc_mock_imports.

Submodules
aries_cloudagent.wallet.base module

Wallet base class.

class aries_cloudagent.wallet.base.BaseWallet[source]

Bases: abc.ABC

Abstract wallet interface.

create_local_did(method: aries_cloudagent.wallet.did_method.DIDMethod, key_type: aries_cloudagent.wallet.key_type.KeyType, seed: str = None, did: str = None, metadata: dict = None) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Create and store a new local DID.

Parameters:
  • method – The method to use for the DID
  • key_type – The key type to use for the DID
  • 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(method: aries_cloudagent.wallet.did_method.DIDMethod, key_type: aries_cloudagent.wallet.key_type.KeyType, seed: str = None, did: str = None, metadata: dict = {}) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Create and store a new public 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_signing_key(key_type: aries_cloudagent.wallet.key_type.KeyType, seed: str = None, metadata: dict = None) → aries_cloudagent.wallet.did_info.KeyInfo[source]

Create a new public/private signing keypair.

Parameters:
  • key_type – Key type to create
  • seed – Optional seed allowing deterministic key creation
  • metadata – Optional metadata to store with the keypair
Returns:

A KeyInfo representing the new record

get_local_did(did: str) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Find info for a local DID.

Parameters:did – The DID for which to get info
Returns:A DIDInfo instance for the DID
get_local_did_for_verkey(verkey: str) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Resolve a local DID from a verkey.

Parameters:verkey – Verkey for which to get DID info
Returns:A DIDInfo instance for the DID
get_local_dids() → Sequence[aries_cloudagent.wallet.did_info.DIDInfo][source]

Get list of defined local DIDs.

Returns:A list of DIDInfo instances
get_posted_dids() → Sequence[aries_cloudagent.wallet.did_info.DIDInfo][source]

Get list of defined posted DIDs.

Returns:A list of DIDInfo instances
get_public_did() → aries_cloudagent.wallet.did_info.DIDInfo[source]

Retrieve the public DID.

Returns:The currently public DIDInfo, if any
get_signing_key(verkey: str) → aries_cloudagent.wallet.did_info.KeyInfo[source]

Fetch info for a signing keypair.

Parameters:verkey – The verification key of the keypair
Returns:A KeyInfo representing the keypair
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.

Prefer set_did_endpoint() to set endpoint in metadata.

Parameters:
  • did – DID for which to replace metadata
  • 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
rotate_did_keypair_apply(did: str) → None[source]

Apply temporary keypair as main for DID that wallet owns.

Parameters:

did – signing DID

Raises:
  • WalletNotFoundError – if wallet does not own DID
  • WalletError – if wallet has not started key rotation
rotate_did_keypair_start(did: str, next_seed: str = None) → str[source]

Begin key rotation for DID that wallet owns: generate new keypair.

Parameters:
  • did – signing DID
  • next_seed – seed for incoming ed25519 key pair (default random)
Returns:

The new verification key

Raises:

WalletNotFoundError – if wallet does not own DID

set_did_endpoint(did: str, endpoint: str, _ledger: aries_cloudagent.ledger.base.BaseLedger, endpoint_type: aries_cloudagent.ledger.endpoint_type.EndpointType = None)[source]

Update the endpoint for a DID in the wallet, send to ledger if public or posted.

Parameters:
  • did – DID for which to set endpoint
  • endpoint – the endpoint to set, None to clear
  • ledger – the ledger to which to send endpoint update if DID is public or posted
  • endpoint_type – the type of the endpoint/service. Only endpoint_type ‘endpoint’ affects local wallet
set_public_did(did: Union[str, aries_cloudagent.wallet.did_info.DIDInfo]) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Assign the public DID.

Returns:The updated DIDInfo
sign_message(message: Union[List[bytes], bytes], from_verkey: str) → bytes[source]

Sign message(s) using the private key associated with a given verkey.

Parameters:
  • message – The message(s) to sign
  • from_verkey – Sign using the private key related to this verkey
Returns:

The signature

unpack_message(enc_message: bytes) → Tuple[str, str, str][source]

Unpack a message.

Parameters:enc_message – The encrypted message
Returns:(message, from_verkey, to_verkey)
Return type:A tuple
verify_message(message: Union[List[bytes], bytes], signature: bytes, from_verkey: str, key_type: aries_cloudagent.wallet.key_type.KeyType) → 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
  • key_type – The key type to derive the signature verification algorithm from
Returns:

True if verified, else False

aries_cloudagent.wallet.crypto module

Cryptography functions used by BasicWallet.

aries_cloudagent.wallet.crypto.add_pack_recipients(wrapper: aries_cloudagent.utils.jwe.JweEnvelope, cek: bytes, to_verkeys: Sequence[bytes], from_secret: bytes = None)[source]

Assemble the recipients block of a packed message.

Parameters:
  • wrapper – The envelope to add recipients to
  • cek – The content encryption key
  • to_verkeys – Verkeys of recipients
  • from_secret – Secret to use for signing keys
Returns:

A tuple of (json result, key)

aries_cloudagent.wallet.crypto.create_ed25519_keypair(seed: bytes = None) → Tuple[bytes, bytes][source]

Create a public and private ed25519 keypair from a seed value.

Parameters:seed – Seed for keypair
Returns:A tuple of (public key, secret key)
aries_cloudagent.wallet.crypto.create_keypair(key_type: aries_cloudagent.wallet.key_type.KeyType, seed: bytes = None) → Tuple[bytes, bytes][source]

Create a public and private keypair from a seed value.

Parameters:
  • key_type – The type of key to generate
  • seed – Seed for keypair
Raises:

WalletError – If the key type is not supported

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 invalid
  • ValueError – If the packed message reipients are invalid
  • ValueError – If the pack algorithm is unsupported
  • ValueError – 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: aries_cloudagent.utils.jwe.JweEnvelope, 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.ed25519_pk_to_curve25519(public_key: bytes) → bytes[source]

Covert a public Ed25519 key to a public Curve25519 key as bytes.

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[aries_cloudagent.utils.jwe.JweRecipient]) → 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.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: Union[List[bytes], bytes], secret: bytes, key_type: aries_cloudagent.wallet.key_type.KeyType) → bytes[source]

Sign message(s) using a private signing key.

Parameters:
  • message – The message(s) to sign
  • secret – The private signing key
  • key_type – The key type to derive the signature algorithm from
Returns:

The signature

Return type:

bytes

aries_cloudagent.wallet.crypto.sign_message_ed25519(message: bytes, secret: bytes) → bytes[source]

Sign message using a ed25519 private signing key.

Parameters:
  • messages (bytes) – The message to sign
  • secret (bytes) – The private signing key
Returns:

The signature

Return type:

bytes

aries_cloudagent.wallet.crypto.sign_pk_from_sk(secret: bytes) → bytes[source]

Extract the verkey from a secret signing key.

aries_cloudagent.wallet.crypto.validate_seed(seed: Union[str, bytes]) → bytes[source]

Convert a seed parameter to standard format and check length.

Parameters:seed – The seed to validate
Returns:The validated and encoded seed
aries_cloudagent.wallet.crypto.verify_signed_message(message: Union[List[bytes], bytes], signature: bytes, verkey: bytes, key_type: aries_cloudagent.wallet.key_type.KeyType) → bool[source]

Verify a signed message according to a public verification key.

Parameters:
  • message – The message(s) to verify
  • signature – The signature to verify
  • verkey – The verkey to use in verification
  • key_type – The key type to derive the signature verification algorithm from
Returns:

True if verified, else False

aries_cloudagent.wallet.crypto.verify_signed_message_ed25519(message: bytes, signature: bytes, verkey: bytes) → bool[source]

Verify an ed25519 signed message according to a public verification key.

Parameters:
  • message – The message to verify
  • signature – The signature to verify
  • verkey – The verkey to use in verification
Returns:

True if verified, else False

aries_cloudagent.wallet.did_posture module

Ledger utilities.

class aries_cloudagent.wallet.did_posture.DIDPosture[source]

Bases: enum.Enum

Enum for DID postures: public, posted but not public, or in wallet only.

POSTED = DIDPostureSpec(moniker='posted', ordinal=1, public=False, posted=True)
PUBLIC = DIDPostureSpec(moniker='public', ordinal=0, public=True, posted=True)
WALLET_ONLY = DIDPostureSpec(moniker='wallet_only', ordinal=2, public=False, posted=False)
get = <function DIDPosture.get>[source]
metadata

DID metadata for DID posture.

moniker

Name for DID posture.

ordinal

public first, then posted and wallet-only.

Type:Ordinal for presentation
class aries_cloudagent.wallet.did_posture.DIDPostureSpec(moniker, ordinal, public, posted)

Bases: tuple

moniker

Alias for field number 0

ordinal

Alias for field number 1

posted

Alias for field number 3

public

Alias for field number 2

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.

exception aries_cloudagent.wallet.error.WalletSettingsError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.wallet.error.WalletError

Invalid settings exception.

aries_cloudagent.wallet.in_memory module

In-memory implementation of BaseWallet interface.

class aries_cloudagent.wallet.in_memory.InMemoryWallet(profile: aries_cloudagent.core.in_memory.InMemoryProfile)[source]

Bases: aries_cloudagent.wallet.base.BaseWallet

In-memory wallet implementation.

create_local_did(method: aries_cloudagent.wallet.did_method.DIDMethod, key_type: aries_cloudagent.wallet.key_type.KeyType, seed: str = None, did: str = None, metadata: dict = None) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Create and store a new local DID.

Parameters:
  • method – The method to use for the DID
  • key_type – The key type to use for the DID
  • 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(key_type: aries_cloudagent.wallet.key_type.KeyType, seed: str = None, metadata: dict = None) → aries_cloudagent.wallet.did_info.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
  • key_type – Key type to generate. Default to ed25519
Returns:

A KeyInfo representing the new record

Raises:

WalletDuplicateError – If the resulting verkey already exists in the wallet

get_local_did(did: str) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Find info for a local DID.

Parameters:did – The DID for which to get info
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.did_info.DIDInfo[source]

Resolve a local DID from a verkey.

Parameters:verkey – The verkey for which to get the local DID
Returns:A DIDInfo instance representing the found DID
Raises:WalletNotFoundError – If the verkey is not found
get_local_dids() → Sequence[aries_cloudagent.wallet.did_info.DIDInfo][source]

Get list of defined local DIDs.

Returns:A list of locally stored DIDs as DIDInfo instances
get_public_did() → aries_cloudagent.wallet.did_info.DIDInfo[source]

Retrieve the public DID.

Returns:The currently public DIDInfo, if any
get_signing_key(verkey: str) → aries_cloudagent.wallet.did_info.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
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 for which to pack
  • from_verkey – Sender verkey from which to pack
Returns:

The resulting packed message bytes

Raises:

WalletError – If the message is not provided

replace_local_did_metadata(did: str, metadata: dict)[source]

Replace metadata for a local DID.

Parameters:
  • did – The DID for which to replace metadata
  • 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

rotate_did_keypair_apply(did: str) → None[source]

Apply temporary keypair as main for DID that wallet owns.

Parameters:

did – signing DID

Raises:
  • WalletNotFoundError – if wallet does not own DID
  • WalletError – if wallet has not started key rotation
rotate_did_keypair_start(did: str, next_seed: str = None) → str[source]

Begin key rotation for DID that wallet owns: generate new keypair.

Parameters:
  • did – signing DID
  • next_seed – incoming replacement seed (default random)
Returns:

The new verification key

Raises:

WalletNotFoundError – if wallet does not own DID

set_public_did(did: Union[str, aries_cloudagent.wallet.did_info.DIDInfo]) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Assign the public DID.

Returns:The updated DIDInfo
sign_message(message: Union[List[bytes], bytes], from_verkey: str) → bytes[source]

Sign message(s) using the private key associated with a given verkey.

Parameters:
  • message – Message(s) bytes to sign
  • from_verkey – The verkey to use to sign
Returns:

A signature

Raises:
  • WalletError – If the message is not provided
  • WalletError – If the verkey is not provided
unpack_message(enc_message: bytes) → Tuple[str, str, 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 provided
  • WalletError – If there is a problem unpacking the message
verify_message(message: Union[List[bytes], bytes], signature: bytes, from_verkey: str, key_type: aries_cloudagent.wallet.key_type.KeyType) → bool[source]

Verify a signature against the public key of the signer.

Parameters:
  • message – Message(s) to verify
  • signature – Signature to verify
  • from_verkey – Verkey to use in verification
  • key_type – The key type to derive the signature verification algorithm from
Returns:

True if verified, else False

Raises:
  • WalletError – If the verkey is not provided
  • WalletError – If the signature is not provided
  • WalletError – If the message is not provided
aries_cloudagent.wallet.indy module

Indy implementation of BaseWallet interface.

class aries_cloudagent.wallet.indy.IndySdkWallet(opened: aries_cloudagent.indy.sdk.wallet_setup.IndyOpenWallet)[source]

Bases: aries_cloudagent.wallet.base.BaseWallet

Indy identity wallet implementation.

create_local_did(method: aries_cloudagent.wallet.did_method.DIDMethod, key_type: aries_cloudagent.wallet.key_type.KeyType, seed: str = None, did: str = None, metadata: dict = None) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Create and store a new local DID.

Parameters:
  • method – The method to use for the DID
  • key_type – The key type to use for the DID
  • 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
  • WalletError – If there is a libindy error
create_signing_key(key_type: aries_cloudagent.wallet.key_type.KeyType, seed: str = None, metadata: dict = None) → aries_cloudagent.wallet.did_info.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 wallet
  • WalletError – If there is a libindy error
classmethod generate_wallet_key(seed: str = None) → str[source]

Generate a raw Indy wallet key.

get_local_did(did: str) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Find info for a local DID.

Parameters:

did – The DID for which to get info

Returns:

A DIDInfo instance representing the found DID

Raises:
  • WalletNotFoundError – If the DID is not found
  • WalletError – If there is a libindy error
get_local_did_for_verkey(verkey: str) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Resolve a local DID from a verkey.

Parameters:verkey – The verkey for which to get the local DID
Returns:A DIDInfo instance representing the found DID
Raises:WalletNotFoundError – If the verkey is not found
get_local_dids() → Sequence[aries_cloudagent.wallet.did_info.DIDInfo][source]

Get list of defined local DIDs.

Returns:A list of locally stored DIDs as DIDInfo instances
get_public_did() → aries_cloudagent.wallet.did_info.DIDInfo[source]

Retrieve the public DID.

Returns:The currently public DIDInfo, if any
get_signing_key(verkey: str) → aries_cloudagent.wallet.did_info.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
  • WalletError – If there is a libindy error
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 for which to pack
  • from_verkey – Sender verkey from which to pack
Returns:

The resulting packed message bytes

Raises:
  • WalletError – If no message is provided
  • WalletError – If a libindy error occurs
replace_local_did_metadata(did: str, metadata: dict)[source]

Replace metadata for a local DID.

Parameters:
  • did – The DID for which to replace metadata
  • 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

rotate_did_keypair_apply(did: str) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Apply temporary keypair as main for DID that wallet owns.

Parameters:did – signing DID
Returns:DIDInfo with new verification key and metadata for DID
rotate_did_keypair_start(did: str, next_seed: str = None) → str[source]

Begin key rotation for DID that wallet owns: generate new keypair.

Parameters:
  • did – signing DID
  • next_seed – incoming replacement seed (default random)
Returns:

The new verification key

set_did_endpoint(did: str, endpoint: str, ledger: aries_cloudagent.ledger.base.BaseLedger, endpoint_type: aries_cloudagent.ledger.endpoint_type.EndpointType = None)[source]

Update the endpoint for a DID in the wallet, send to ledger if public or posted.

Parameters:
  • did – DID for which to set endpoint
  • endpoint – the endpoint to set, None to clear
  • ledger – the ledger to which to send endpoint update if DID is public or posted
  • endpoint_type – the type of the endpoint/service. Only endpoint_type ‘endpoint’ affects local wallet
set_public_did(did: Union[str, aries_cloudagent.wallet.did_info.DIDInfo]) → aries_cloudagent.wallet.did_info.DIDInfo[source]

Assign the public DID.

Returns:The updated DIDInfo
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 provided
  • WalletError – If the verkey is not provided
  • WalletError – If a libindy error occurs
unpack_message(enc_message: bytes) → Tuple[str, str, 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 provided
  • WalletError – If a libindy error occurs
verify_message(message: Union[List[bytes], bytes], signature: bytes, from_verkey: str, key_type: aries_cloudagent.wallet.key_type.KeyType) → 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 provided
  • WalletError – If the signature is not provided
  • WalletError – If the message is not provided
  • WalletError – If a libindy error occurs
aries_cloudagent.wallet.routes module

Wallet admin routes.

class aries_cloudagent.wallet.routes.DIDCreateOptionsSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for create DID options.

key_type = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['ed25519', 'bls12381g2'], labels=[], error='Must be one of: {choices}.')>, 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.wallet.routes.DIDCreateSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for create DID endpoint.

method = <fields.String(default='sov', attribute=None, validate=<OneOf(choices=['key', 'sov'], 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.'})>
options = <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.'})>
class aries_cloudagent.wallet.routes.DIDEndpointSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema to set DID endpoint; response schema to get DID endpoint.

did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID 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.'})>
endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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 aries_cloudagent.wallet.routes.DIDEndpointWithTypeSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Request schema to set DID endpoint of particular type.

did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID 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.'})>
endpoint = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Endpoint 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_type = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.EndpointType 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 aries_cloudagent.wallet.routes.DIDListQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for DID list request query string.

did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyOrKeyDID 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.'})>
key_type = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['ed25519', 'bls12381g2'], 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.'})>
method = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['key', 'sov'], 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.'})>
posture = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.DIDPosture 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.'})>
verkey = <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.'})>
class aries_cloudagent.wallet.routes.DIDListSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for connection list.

results = <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 aries_cloudagent.wallet.routes.DIDQueryStringSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Parameters and validators for set public DID request query string.

did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID 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.'})>
class aries_cloudagent.wallet.routes.DIDResultSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for a DID.

result = <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.'})>
class aries_cloudagent.wallet.routes.DIDSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Result schema for a DID.

did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyOrKeyDID 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.'})>
key_type = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['ed25519', 'bls12381g2'], 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.'})>
method = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['sov', 'key'], 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.'})>
posture = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.DIDPosture 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.'})>
verkey = <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.'})>
class aries_cloudagent.wallet.routes.WalletModuleResponseSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.openapi.OpenAPISchema

Response schema for Wallet Module.

aries_cloudagent.wallet.routes.format_did_info(info: aries_cloudagent.wallet.did_info.DIDInfo)[source]

Serialize a DIDInfo object.

aries_cloudagent.wallet.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Amend swagger API.

aries_cloudagent.wallet.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Register routes.

aries_cloudagent.wallet.routes.wallet_create_did(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Request handler for creating a new local DID in the wallet.

Parameters:request – aiohttp request object
Returns:The DID info
aries_cloudagent.wallet.routes.wallet_did_list(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Request handler for searching wallet DIDs.

Parameters:request – aiohttp request object
Returns:The DID list response
aries_cloudagent.wallet.routes.wallet_get_did_endpoint(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Request handler for getting the current DID endpoint from the wallet.

Parameters:request – aiohttp request object
Returns:The updated DID info
aries_cloudagent.wallet.routes.wallet_get_public_did(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Request handler for fetching the current public DID.

Parameters:request – aiohttp request object
Returns:The DID info
aries_cloudagent.wallet.routes.wallet_rotate_did_keypair(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Request handler for rotating local DID keypair.

Parameters:request – aiohttp request object
Returns:An empty JSON response
aries_cloudagent.wallet.routes.wallet_set_did_endpoint(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Request handler for setting an endpoint for a DID.

Parameters:request – aiohttp request object
aries_cloudagent.wallet.routes.wallet_set_public_did(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7fb05484c090>)[source]

Request handler for setting the current public DID.

Parameters:request – aiohttp request object
Returns:The updated DID info
aries_cloudagent.wallet.util module

Wallet utility functions.

aries_cloudagent.wallet.util.abbr_verkey(full_verkey: str, did: str = None) → str[source]

Given a full verkey and DID, return the abbreviated verkey.

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, encoding: str = 'ascii') → str[source]

Convert a byte string to base 64.

aries_cloudagent.wallet.util.full_verkey(did: str, abbr_verkey: str) → str[source]

Given a DID and abbreviated verkey, return the full verkey.

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.random_seed() → bytes[source]

Generate a random seed value.

Returns:A new random seed
aries_cloudagent.wallet.util.set_urlsafe_b64(val: str, urlsafe: bool = True) → str[source]

Set URL safety in base64 encoding.

aries_cloudagent.wallet.util.str_to_b64(val: str, urlsafe=False, encoding=None, pad=True) → str[source]

Convert a string to base64 string on input encoding (default utf-8).

aries_cloudagent.wallet.util.unpad(val: str) → str[source]

Remove padding from base64 values if need be.

Submodules

aries_cloudagent.version module

Library version information.

Indices and tables