acapy_agent.messaging.decorators package
Submodules
acapy_agent.messaging.decorators.attach_decorator module
acapy_agent.messaging.decorators.base module
Classes for managing a collection of decorators.
- class acapy_agent.messaging.decorators.base.BaseDecoratorSet(models: dict | None = None)[source]
Bases:
OrderedDictCollection of decorators.
- copy() BaseDecoratorSet[source]
Return a copy of the decorator set.
- extract_decorators(message: Mapping, schema: Type[marshmallow.Schema] = None, serialized: bool = True, skip_attrs: 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.
- property models: dict
Accessor for the models dictionary.
- property prefix: str
Accessor for the decorator prefix.
acapy_agent.messaging.decorators.default module
Default decorator set implementation.
- class acapy_agent.messaging.decorators.default.DecoratorSet(models: dict | None = None)[source]
Bases:
BaseDecoratorSetDefault decorator set implementation.
acapy_agent.messaging.decorators.localization_decorator module
The localization decorator (~l10n) for message localization information.
- class acapy_agent.messaging.decorators.localization_decorator.LocalizationDecorator(*, locale: str | None = None, localizable: Sequence[str] = None, catalogs: Sequence[str] = None)[source]
Bases:
BaseModelClass representing the localization decorator.
- class acapy_agent.messaging.decorators.localization_decorator.LocalizationDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaLocalization decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
objectLocalizationDecoratorSchema metadata.
- model_class
alias of
LocalizationDecorator
acapy_agent.messaging.decorators.please_ack_decorator module
The please-ack decorator to request acknowledgement.
- class acapy_agent.messaging.decorators.please_ack_decorator.PleaseAckDecorator(message_id: str | None = None, on: Sequence[str] = None)[source]
Bases:
BaseModelClass representing the please-ack decorator.
- class acapy_agent.messaging.decorators.please_ack_decorator.PleaseAckDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaPleaseAck decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
objectPleaseAckDecoratorSchema metadata.
- model_class
alias of
PleaseAckDecorator
acapy_agent.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 acapy_agent.messaging.decorators.service_decorator.ServiceDecorator(*, endpoint: str, recipient_keys: List[str], routing_keys: List[str] | None = None)[source]
Bases:
BaseModelClass representing service decorator.
- class Meta[source]
Bases:
objectServiceDecorator 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 acapy_agent.messaging.decorators.service_decorator.ServiceDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaThread decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
objectServiceDecoratorSchema metadata.
- model_class
alias of
ServiceDecorator
acapy_agent.messaging.decorators.signature_decorator module
Model and schema for working with field signatures within message bodies.
- class acapy_agent.messaging.decorators.signature_decorator.SignatureDecorator(*, signature_type: str | None = None, signature: str | None = None, sig_data: str | None = None, signer: str | None = None)[source]
Bases:
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'
- 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:
cls – SignatureDecorator class
value – Value to sign
signer – Verkey of the signing party
wallet – The wallet to use for the signature
timestamp – Timestamp to use for the signature
- Returns:
The created SignatureDecorator object
- decode() Tuple[object, 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 acapy_agent.messaging.decorators.signature_decorator.SignatureDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaSignatureDecorator schema.
- class Meta[source]
Bases:
objectSignatureDecoratorSchema metadata.
- model_class
alias of
SignatureDecorator
acapy_agent.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 acapy_agent.messaging.decorators.thread_decorator.ThreadDecorator(*, thid: str | None = None, pthid: str | None = None, sender_order: int | None = None, received_orders: Mapping | None = None)[source]
Bases:
BaseModelClass 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 acapy_agent.messaging.decorators.thread_decorator.ThreadDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaThread decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
objectThreadDecoratorSchema metadata.
- model_class
alias of
ThreadDecorator
acapy_agent.messaging.decorators.timing_decorator module
The timing decorator (~timing).
This decorator allows the timing of agent messages to be communicated and constrained.
- class acapy_agent.messaging.decorators.timing_decorator.TimingDecorator(*, in_time: str | datetime = None, out_time: str | datetime = None, stale_time: str | datetime = None, expires_time: str | datetime = None, delay_milli: int | None = None, wait_until_time: str | datetime = None)[source]
Bases:
BaseModelClass representing the timing decorator.
- class acapy_agent.messaging.decorators.timing_decorator.TimingDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaTiming decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
objectTimingDecoratorSchema metadata.
- model_class
alias of
TimingDecorator
acapy_agent.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 acapy_agent.messaging.decorators.trace_decorator.TraceDecorator(*, target: str | None = None, full_thread: bool = True, trace_reports: Sequence | None = None)[source]
Bases:
BaseModelClass 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 acapy_agent.messaging.decorators.trace_decorator.TraceDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaTrace decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
objectTraceDecoratorSchema metadata.
- model_class
alias of
TraceDecorator
- class acapy_agent.messaging.decorators.trace_decorator.TraceReport(*, msg_id: str | None = None, thread_id: str | None = None, traced_type: str | None = None, timestamp: str | None = None, str_time: str | None = None, handler: str | None = None, elapsed_milli: int | None = None, outcome: str | None = None)[source]
Bases:
BaseModelClass 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 acapy_agent.messaging.decorators.trace_decorator.TraceReportSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaTrace report schema.
- class Meta[source]
Bases:
objectTraceReportSchema metadata.
- model_class
alias of
TraceReport
acapy_agent.messaging.decorators.transport_decorator module
The transport decorator (~transport).
This decorator allows changes to agent response behaviour and queue status updates.
- class acapy_agent.messaging.decorators.transport_decorator.TransportDecorator(*, return_route: str | None = None, return_route_thread: str | None = None, queued_message_count: int | None = None)[source]
Bases:
BaseModelClass representing the transport decorator.
- class acapy_agent.messaging.decorators.transport_decorator.TransportDecoratorSchema(*args: Any, **kwargs: Any)[source]
Bases:
BaseModelSchemaTransport decorator schema used in serialization/deserialization.
- class Meta[source]
Bases:
objectTransportDecoratorSchema metadata.
- model_class
alias of
TransportDecorator