aries_cloudagent.messaging.decorators package
Submodules
aries_cloudagent.messaging.decorators.attach_decorator module
aries_cloudagent.messaging.decorators.base module
Classes for managing a collection of decorators.
- class aries_cloudagent.messaging.decorators.base.BaseDecoratorSet(models: Optional[dict] = None)[source]
Bases:
OrderedDict
Collection of decorators.
- copy() BaseDecoratorSet [source]
Return a copy of the decorator set.
- extract_decorators(message: Mapping, schema: Optional[Type[marshmallow.Schema]] = None, serialized: bool = True, skip_attrs: Optional[Sequence[str]] = None) OrderedDict [source]
Extract decorators and return the remaining properties.
- field(name: str) BaseDecoratorSet [source]
Access a named decorated field.
- property fields: OrderedDict
Acessor for the set of currently defined fields.
- load_decorator(key: str, value, serialized=False)[source]
Convert a decorator value to its loaded representation.
- to_dict(prefix: Optional[str] = None) OrderedDict [source]
Convert to a dictionary (serialize).
- Raises
BaseModelError – on decorator validation errors
aries_cloudagent.messaging.decorators.default module
Default decorator set implementation.
- class aries_cloudagent.messaging.decorators.default.DecoratorSet(models: Optional[dict] = None)[source]
Bases:
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: Optional[str] = None, localizable: Optional[Sequence[str]] = None, catalogs: Optional[Sequence[str]] = None)[source]
Bases:
BaseModel
Class representing the localization decorator.
- class aries_cloudagent.messaging.decorators.localization_decorator.LocalizationDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
Localization decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
object
LocalizationDecoratorSchema metadata.
- model_class
alias of
LocalizationDecorator
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: Optional[str] = None, on: Optional[Sequence[str]] = None)[source]
Bases:
BaseModel
Class representing the please-ack decorator.
- class aries_cloudagent.messaging.decorators.please_ack_decorator.PleaseAckDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
PleaseAck decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
object
PleaseAckDecoratorSchema metadata.
- model_class
alias of
PleaseAckDecorator
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:
BaseModel
Class representing service decorator.
- class Meta[source]
Bases:
object
ServiceDecorator metadata.
- schema_class = 'ServiceDecoratorSchema'
- property endpoint
Accessor for service endpoint.
- Returns
This service’s serviceEndpoint
- property recipient_keys
Accessor for recipient keys.
- Returns
This service’s recipientKeys
- property routing_keys
Accessor for routing keys.
- Returns
This service’s routingKeys
- class aries_cloudagent.messaging.decorators.service_decorator.ServiceDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
Thread decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
object
ServiceDecoratorSchema metadata.
- model_class
alias of
ServiceDecorator
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: Optional[str] = None, signature: Optional[str] = None, sig_data: Optional[str] = None, signer: Optional[str] = None)[source]
Bases:
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'
- async classmethod create(value, signer: str, wallet: BaseWallet, timestamp=None) 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)
- async verify(wallet: 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: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
SignatureDecorator schema.
- class Meta[source]
Bases:
object
SignatureDecoratorSchema metadata.
- model_class
alias of
SignatureDecorator
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: Optional[str] = None, pthid: Optional[str] = None, sender_order: Optional[int] = None, received_orders: Optional[Mapping] = None)[source]
Bases:
BaseModel
Class representing thread decorator.
- property pthid
Accessor for parent thread identifier.
- Returns
This thread’s pthid
- property received_orders: dict
Get received orders.
- Returns
The highest sender_order value that the sender has seen from other sender(s) on the thread.
- property sender_order: int
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
- property thid
Accessor for thread identifier.
- Returns
This thread’s thid
- class aries_cloudagent.messaging.decorators.thread_decorator.ThreadDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
Thread decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
object
ThreadDecoratorSchema metadata.
- model_class
alias of
ThreadDecorator
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: Optional[Union[str, datetime]] = None, out_time: Optional[Union[str, datetime]] = None, stale_time: Optional[Union[str, datetime]] = None, expires_time: Optional[Union[str, datetime]] = None, delay_milli: Optional[int] = None, wait_until_time: Optional[Union[str, datetime]] = None)[source]
Bases:
BaseModel
Class representing the timing decorator.
- class aries_cloudagent.messaging.decorators.timing_decorator.TimingDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
Timing decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
object
TimingDecoratorSchema metadata.
- model_class
alias of
TimingDecorator
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: Optional[str] = None, full_thread: bool = True, trace_reports: Optional[Sequence] = None)[source]
Bases:
BaseModel
Class representing trace decorator.
- append_trace_report(trace_report: TraceReport)[source]
Append a trace report to this decorator.
- property full_thread
Accessor for full_thread flag.
- Returns
The full_thread flag
- property target
Accessor for trace target.
- Returns
The target for tracing messages
- property 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: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
Trace decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
object
TraceDecoratorSchema metadata.
- model_class
alias of
TraceDecorator
- class aries_cloudagent.messaging.decorators.trace_decorator.TraceReport(*, msg_id: Optional[str] = None, thread_id: Optional[str] = None, traced_type: Optional[str] = None, timestamp: Optional[str] = None, str_time: Optional[str] = None, handler: Optional[str] = None, elapsed_milli: Optional[int] = None, outcome: Optional[str] = None)[source]
Bases:
BaseModel
Class representing a Trace Report.
- property elapsed_milli
Accessor for elapsed_milli.
- Returns
The sender elapsed_milli
- property handler
Accessor for handler.
- Returns
The sender handler
- property msg_id
Accessor for msg_id.
- Returns
The msg_id
- property outcome
Accessor for outcome.
- Returns
The sender outcome
- property str_time
Accessor for str_time.
- Returns
Formatted representation of the sender timestamp
- property thread_id
Accessor for thread_id.
- Returns
The thread_id
- property timestamp
Accessor for timestamp.
- Returns
The sender timestamp
- property traced_type
Accessor for traced_type.
- Returns
The sender traced_type
- class aries_cloudagent.messaging.decorators.trace_decorator.TraceReportSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
Trace report schema.
- class Meta[source]
Bases:
object
TraceReportSchema metadata.
- model_class
alias of
TraceReport
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: Optional[str] = None, return_route_thread: Optional[str] = None, queued_message_count: Optional[int] = None)[source]
Bases:
BaseModel
Class representing the transport decorator.
- class aries_cloudagent.messaging.decorators.transport_decorator.TransportDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchema
Transport decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
object
TransportDecoratorSchema metadata.
- model_class
alias of
TransportDecorator