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.BaseModelClass representing attach decorator.
-
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, *, 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: Union[Sequence[dict], 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
-
classmethod
data_links(links: Union[str, Sequence[str]], sha256: str = None, *, ident: str = None, mime_type: 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: - 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_: Union[Sequence[dict], dict] = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelAttach decorator data.
-
class
Meta[source]¶ Bases:
objectAttachDecoratorData metadata.
-
schema_class= 'AttachDecoratorDataSchema'¶
-
-
base64¶ Accessor for base64 decorator data, or None.
-
header_map(idx: int = 0, jose: bool = True) → Mapping[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.
-
links¶ 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.
-
class
-
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.BaseModelSingle Detached JSON Web Signature for inclusion in attach decorator data.
-
class
aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorData1JWSSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaSingle attach decorator data JWS schema.
-
class
Meta[source]¶ Bases:
objectSingle attach decorator data JWS schema metadata.
-
model_class¶ alias of
AttachDecoratorData1JWS
-
unknown¶ Used by autodoc_mock_imports.
-
-
header¶ Used by autodoc_mock_imports.
-
protected¶ Used by autodoc_mock_imports.
-
signature¶ Used by autodoc_mock_imports.
-
class
-
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.BaseModelDetached JSON Web Signature for inclusion in attach decorator data.
May hold one signature in flattened format, or multiple signatures in the “signatures” member.
-
class
aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWSHeader(kid: str)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelAttach decorator data JWS header.
-
class
aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWSHeaderSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaAttach decorator data JWS header schema.
-
class
Meta[source]¶ Bases:
objectAttach decorator data schema metadata.
-
model_class¶ alias of
AttachDecoratorDataJWSHeader
-
unknown¶ Used by autodoc_mock_imports.
-
-
kid¶ Used by autodoc_mock_imports.
-
class
-
class
aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataJWSSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaSchema for detached JSON Web Signature for inclusion in attach decorator data.
-
class
Meta[source]¶ Bases:
objectMetadata for schema for detached JWS for inclusion in attach deco data.
-
model_class¶ alias of
AttachDecoratorDataJWS
-
unknown¶ Used by autodoc_mock_imports.
-
-
header¶ Used by autodoc_mock_imports.
-
protected¶ Used by autodoc_mock_imports.
-
signature¶ Used by autodoc_mock_imports.
-
signatures¶ Used by autodoc_mock_imports.
-
class
-
class
aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorDataSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaAttach decorator data schema.
-
class
Meta[source]¶ Bases:
objectAttach decorator data schema metadata.
-
model_class¶ alias of
AttachDecoratorData
-
unknown¶ Used by autodoc_mock_imports.
-
-
base64_¶ Used by autodoc_mock_imports.
-
json_¶ Dict or Dict List field for Marshmallow.
-
jws_¶ Used by autodoc_mock_imports.
-
links_¶ Used by autodoc_mock_imports.
-
sha256_¶ Used by autodoc_mock_imports.
-
class
-
class
aries_cloudagent.messaging.decorators.attach_decorator.AttachDecoratorSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaAttach decorator schema used in serialization/deserialization.
-
class
Meta[source]¶ Bases:
objectAttachDecoratorSchema metadata.
-
model_class¶ alias of
AttachDecorator
-
unknown¶ Used by autodoc_mock_imports.
-
-
byte_count¶ Used by autodoc_mock_imports.
-
data¶ Used by autodoc_mock_imports.
-
description¶ Used by autodoc_mock_imports.
-
filename¶ Used by autodoc_mock_imports.
-
ident¶ Used by autodoc_mock_imports.
-
lastmod_time¶ Used by autodoc_mock_imports.
-
mime_type¶ Used by autodoc_mock_imports.
-
class
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.OrderedDictCollection 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, schema: Type[<sphinx.ext.autodoc.importer._MockObject object at 0x7f42e2f4e850>] = None, serialized: bool = True, skip_attrs: Sequence[str] = None) → collections.OrderedDict[source]¶ Extract decorators and return the remaining properties.
-
field(name: str) → aries_cloudagent.messaging.decorators.base.BaseDecoratorSet[source]¶ Access a named decorated field.
-
fields¶ Acessor for the set of currently defined fields.
-
load_decorator(key: str, value, serialized=False)[source]¶ Convert a decorator value to its loaded representation.
-
models¶ Accessor for the models dictionary.
-
prefix¶ Accessor for the decorator prefix.
-
-
exception
aries_cloudagent.messaging.decorators.base.DecoratorError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseErrorBase 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.BaseDecoratorSetDefault 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.BaseModelClass representing the localization decorator.
-
class
aries_cloudagent.messaging.decorators.localization_decorator.LocalizationDecoratorSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaLocalization decorator schema used in serialization/deserialization.
-
class
Meta[source]¶ Bases:
objectLocalizationDecoratorSchema 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.
-
class
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.BaseModelClass representing the please-ack decorator.
-
class
aries_cloudagent.messaging.decorators.please_ack_decorator.PleaseAckDecoratorSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaPleaseAck decorator schema used in serialization/deserialization.
-
class
Meta[source]¶ Bases:
objectPleaseAckDecoratorSchema metadata.
-
model_class¶ alias of
PleaseAckDecorator
-
unknown¶ Used by autodoc_mock_imports.
-
-
message_id¶ Used by autodoc_mock_imports.
-
on¶ Used by autodoc_mock_imports.
-
class
aries_cloudagent.messaging.decorators.service_decorator module¶
A message decorator for services.
A service decorator adds routing information to a message so agent can respond without needing to perform a handshake.
-
class
aries_cloudagent.messaging.decorators.service_decorator.ServiceDecorator(*, endpoint: str, recipient_keys: List[str], routing_keys: Optional[List[str]] = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelClass representing service decorator.
-
class
Meta[source]¶ Bases:
objectServiceDecorator metadata.
-
schema_class= 'ServiceDecoratorSchema'¶
-
-
endpoint¶ Accessor for service endpoint.
Returns: This service’s serviceEndpoint
-
recipient_keys¶ Accessor for recipient keys.
Returns: This service’s recipientKeys
-
routing_keys¶ Accessor for routing keys.
Returns: This service’s routingKeys
-
class
-
class
aries_cloudagent.messaging.decorators.service_decorator.ServiceDecoratorSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaThread decorator schema used in serialization/deserialization.
-
class
Meta[source]¶ Bases:
objectServiceDecoratorSchema metadata.
-
model_class¶ alias of
ServiceDecorator
-
unknown¶ Used by autodoc_mock_imports.
-
-
endpoint¶ Used by autodoc_mock_imports.
-
recipient_keys¶ Used by autodoc_mock_imports.
-
routing_keys¶ Used by autodoc_mock_imports.
-
class
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.BaseModelClass representing a field value signed by a known verkey.
-
class
Meta[source]¶ Bases:
objectSignatureDecorator 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
-
class
-
class
aries_cloudagent.messaging.decorators.signature_decorator.SignatureDecoratorSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaSignatureDecorator schema.
-
class
Meta[source]¶ Bases:
objectSignatureDecoratorSchema 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.
-
class
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 = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelClass representing thread decorator.
-
pthid¶ Accessor for parent thread identifier.
Returns: This thread’s pthid
-
received_orders¶ Get received orders.
Returns: The highest sender_order value that the sender has seen from other sender(s) on the thread.
-
sender_order¶ Get sender order.
Returns: A number that tells where this message fits in the sequence of all messages that the current sender has contributed to this thread
-
thid¶ Accessor for thread identifier.
Returns: This thread’s thid
-
-
class
aries_cloudagent.messaging.decorators.thread_decorator.ThreadDecoratorSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaThread decorator schema used in serialization/deserialization.
-
class
Meta[source]¶ Bases:
objectThreadDecoratorSchema 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.
-
class
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.BaseModelClass representing the timing decorator.
-
class
aries_cloudagent.messaging.decorators.timing_decorator.TimingDecoratorSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaTiming decorator schema used in serialization/deserialization.
-
class
Meta[source]¶ Bases:
objectTimingDecoratorSchema 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.
-
class
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 = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelClass representing trace decorator.
-
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.BaseModelSchemaTrace decorator schema used in serialization/deserialization.
-
class
Meta[source]¶ Bases:
objectTraceDecoratorSchema 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
-
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.BaseModelClass representing a Trace Report.
-
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.BaseModelSchemaTrace report schema.
-
class
Meta[source]¶ Bases:
objectTraceReportSchema 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.
-
class
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.BaseModelClass representing the transport decorator.
-
class
aries_cloudagent.messaging.decorators.transport_decorator.TransportDecoratorSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchemaTransport decorator schema used in serialization/deserialization.
-
class
Meta[source]¶ Bases:
objectTransportDecoratorSchema 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.
-
class