acapy_agent.transport package
Subpackages
- acapy_agent.transport.inbound package
- Submodules
- acapy_agent.transport.inbound.base module
- acapy_agent.transport.inbound.delivery_queue module
- acapy_agent.transport.inbound.http module
- acapy_agent.transport.inbound.manager module
- acapy_agent.transport.inbound.message module
- acapy_agent.transport.inbound.receipt module
MessageReceiptMessageReceipt.REPLY_MODE_ALLMessageReceipt.REPLY_MODE_NONEMessageReceipt.REPLY_MODE_THREADMessageReceipt.connection_idMessageReceipt.direct_response_modeMessageReceipt.direct_response_requestedMessageReceipt.in_timeMessageReceipt.parent_thread_idMessageReceipt.raw_messageMessageReceipt.recipient_didMessageReceipt.recipient_did_publicMessageReceipt.recipient_verkeyMessageReceipt.sender_didMessageReceipt.sender_verkeyMessageReceipt.thread_id
- acapy_agent.transport.inbound.session module
- acapy_agent.transport.inbound.ws module
- acapy_agent.transport.outbound package
- Submodules
- acapy_agent.transport.outbound.base module
- acapy_agent.transport.outbound.http module
- acapy_agent.transport.outbound.manager module
OutboundTransportManagerOutboundTransportManager.MAX_RETRY_COUNTOutboundTransportManager.deliver_queued_message()OutboundTransportManager.encode_outbound_message()OutboundTransportManager.encode_queued_message()OutboundTransportManager.enqueue_message()OutboundTransportManager.enqueue_webhook()OutboundTransportManager.finished_deliver()OutboundTransportManager.finished_encode()OutboundTransportManager.flush()OutboundTransportManager.get_external_running_transport()OutboundTransportManager.get_registered_transport_for_scheme()OutboundTransportManager.get_running_transport_for_endpoint()OutboundTransportManager.get_running_transport_for_scheme()OutboundTransportManager.get_transport_instance()OutboundTransportManager.perform_encode()OutboundTransportManager.process_queued()OutboundTransportManager.register()OutboundTransportManager.register_class()OutboundTransportManager.setup()OutboundTransportManager.start()OutboundTransportManager.start_transport()OutboundTransportManager.stop()
- acapy_agent.transport.outbound.message module
- acapy_agent.transport.outbound.status module
- acapy_agent.transport.outbound.ws module
- acapy_agent.transport.queue package
Submodules
acapy_agent.transport.error module
Transport-related error classes and codes.
- exception acapy_agent.transport.error.RecipientKeysError(*args, error_code: str | None = None, **kwargs)[source]
Bases:
WireFormatErrorExtract recipient keys error.
- exception acapy_agent.transport.error.TransportError(*args, error_code: str | None = None, **kwargs)[source]
Bases:
BaseErrorBase class for all transport errors.
- exception acapy_agent.transport.error.WireFormatEncodeError(*args, error_code: str | None = None, **kwargs)[source]
Bases:
WireFormatErrorEncoding error when packing the wire format.
- error_code = 'message_encode_error'
- exception acapy_agent.transport.error.WireFormatError(*args, error_code: str | None = None, **kwargs)[source]
Bases:
TransportErrorBase class for wire-format errors.
- exception acapy_agent.transport.error.WireFormatParseError(*args, error_code: str | None = None, **kwargs)[source]
Bases:
WireFormatErrorParse error when unpacking the wire format.
- error_code = 'message_parse_error'
acapy_agent.transport.pack_format module
Standard packed message format classes.
- class acapy_agent.transport.pack_format.PackWireFormat[source]
Bases:
BaseWireFormatStandard DIDComm message parser and serializer.
- async encode_message(session: ProfileSession, message_json: str | bytes, recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str) str | bytes[source]
Pass an incoming message to the appropriately versioned PackWireFormat.
- get_for_outbound_msg(outbound_msg: str | bytes) BaseWireFormat[source]
Retrieve appropriate DIDComm instance for a given packed message.
- get_for_packed_msg(packed_msg: str | bytes) BaseWireFormat[source]
Retrieve appropriate DIDComm instance for a given packed message.
- get_recipient_keys(message_body: str | bytes) List[str][source]
Get all recipient keys from a wire message.
- async pack(session: ProfileSession, message_json: str | bytes, recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str)[source]
Look up the wallet instance and perform the message pack.
- async parse_message(session: ProfileSession, message_body: str | bytes) Tuple[dict, MessageReceipt][source]
Pass an incoming message to the appropriately versioned PackWireFormat.
- async unpack(session: ProfileSession, message_body: str | bytes, receipt: MessageReceipt)[source]
Look up the wallet instance and perform the message unpack.
- class acapy_agent.transport.pack_format.V1PackWireFormat[source]
Bases:
BaseWireFormatDIDComm V1 message parser and serializer.
- async encode_message(session: ProfileSession, message_json: str | bytes, recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str) 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: 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
- async pack(session: ProfileSession, message_json: str | bytes, recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str)[source]
Look up the wallet instance and perform the message pack.
- async parse_message(session: ProfileSession, message_body: str | bytes) Tuple[dict, 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
- async unpack(session: ProfileSession, message_body: str | bytes, receipt: MessageReceipt)[source]
Look up the wallet instance and perform the message unpack.
acapy_agent.transport.stats module
aiohttp stats collector support.
- class acapy_agent.transport.stats.StatsTracer(*args: Any, **kwargs: Any)[source]
Bases:
TraceConfigAttach hooks to client session events and report statistics.
- async connection_queued_end(session, context, params)[source]
Handle the end of a queued connection.
- async connection_queued_start(session, context, params)[source]
Handle the start of a queued connection.
acapy_agent.transport.v2_pack_format module
acapy_agent.transport.wire_format module
Abstract wire format classes.
- class acapy_agent.transport.wire_format.BaseWireFormat[source]
Bases:
objectAbstract messaging wire format.
- abstractmethod async encode_message(session: ProfileSession, message_json: str | bytes, recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str) 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
- abstractmethod get_recipient_keys(message_body: 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
- abstractmethod async parse_message(session: ProfileSession, message_body: str | bytes) Tuple[dict, 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 acapy_agent.transport.wire_format.JsonWireFormat[source]
Bases:
BaseWireFormatUnencrypted wire format.
- abstractmethod async encode_message(session: ProfileSession, message_json: str | bytes, recipient_keys: Sequence[str], routing_keys: Sequence[str], sender_key: str) 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: 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
- abstractmethod async parse_message(session: ProfileSession, message_body: str | bytes) Tuple[dict, 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