aries_cloudagent.transport package¶
Subpackages¶
- aries_cloudagent.transport.inbound package
- Submodules
- aries_cloudagent.transport.inbound.base module
- aries_cloudagent.transport.inbound.delivery_queue module
- aries_cloudagent.transport.inbound.http module
- aries_cloudagent.transport.inbound.manager module
- aries_cloudagent.transport.inbound.message module
- aries_cloudagent.transport.inbound.receipt module
- aries_cloudagent.transport.inbound.session module
- aries_cloudagent.transport.inbound.ws module
- aries_cloudagent.transport.outbound package
- Submodules
- aries_cloudagent.transport.outbound.base module
- aries_cloudagent.transport.outbound.http module
- aries_cloudagent.transport.outbound.manager module
- aries_cloudagent.transport.outbound.message module
- aries_cloudagent.transport.outbound.status module
- aries_cloudagent.transport.outbound.ws module
- aries_cloudagent.transport.queue package
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.WireFormatErrorExtract recipient keys error.
-
exception
aries_cloudagent.transport.error.TransportError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseErrorBase class for all transport errors.
-
exception
aries_cloudagent.transport.error.WireFormatEncodeError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.error.WireFormatErrorEncoding 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.TransportErrorBase class for wire-format errors.
-
exception
aries_cloudagent.transport.error.WireFormatParseError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.transport.error.WireFormatErrorParse 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.BaseWireFormatStandard 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 failedWireFormatParseError– If a wallet is required but can’t be located
-
aries_cloudagent.transport.stats module¶
aiohttp stats collector support.
aries_cloudagent.transport.wire_format module¶
Abstract wire format classes.
-
class
aries_cloudagent.transport.wire_format.BaseWireFormat[source]¶ Bases:
objectAbstract 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.BaseWireFormatUnencrypted 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
-