aries_cloudagent.transport.inbound package

Submodules

aries_cloudagent.transport.inbound.base module

Base inbound transport class.

class aries_cloudagent.transport.inbound.base.BaseInboundTransport(scheme: str, create_session: Callable, *, max_message_size: int = 0, wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat = None)[source]

Bases: abc.ABC

Base inbound transport class.

create_session(*, accept_undelivered: bool = False, can_respond: bool = False, client_info: dict = None, wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat = None) → Awaitable[aries_cloudagent.transport.inbound.session.InboundSession][source]

Create a new inbound session.

Parameters:
  • accept_undelivered – Flag for accepting undelivered messages
  • can_respond – Flag indicating that the transport can send responses
  • client_info – Request-specific client information
  • wire_format – Optionally override the session wire format
max_message_size

Accessor for this transport’s max message size.

scheme

Accessor for this transport’s scheme.

start() → None[source]

Start listening for on this transport.

stop() → None[source]

Stop listening for on this transport.

class aries_cloudagent.transport.inbound.base.InboundTransportConfiguration(module, host, port)

Bases: tuple

host

Alias for field number 1

module

Alias for field number 0

port

Alias for field number 2

exception aries_cloudagent.transport.inbound.base.InboundTransportError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.transport.error.TransportError

Generic inbound transport error.

exception aries_cloudagent.transport.inbound.base.InboundTransportRegistrationError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.transport.inbound.base.InboundTransportError

Error in loading an inbound transport.

exception aries_cloudagent.transport.inbound.base.InboundTransportSetupError(*args, error_code: str = None, **kwargs)[source]

Bases: aries_cloudagent.transport.inbound.base.InboundTransportError

Setup error for an inbound transport.

aries_cloudagent.transport.inbound.http module

Http Transport classes and functions.

class aries_cloudagent.transport.inbound.http.HttpTransport(host: str, port: int, create_session, **kwargs)[source]

Bases: aries_cloudagent.transport.inbound.base.BaseInboundTransport

Http Transport class.

inbound_message_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7ffa2f5dfeb8>)[source]

Message handler for inbound messages.

Parameters:request – aiohttp request object
Returns:The web response
invite_message_handler(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7ffa2f5dfeb8>)[source]

Message handler for invites.

Parameters:request – aiohttp request object
Returns:The web response
make_application() → <sphinx.ext.autodoc.importer._MockObject object at 0x7ffa2f5dfeb8>[source]

Construct the aiohttp application.

start() → None[source]

Start this transport.

Raises:InboundTransportSetupError – If there was an error starting the webserver
stop() → None[source]

Stop this transport.

aries_cloudagent.transport.inbound.manager module

Inbound transport manager.

class aries_cloudagent.transport.inbound.manager.InboundTransportManager(context: aries_cloudagent.config.injection_context.InjectionContext, receive_inbound: Coroutine[T_co, T_contra, V_co], return_inbound: Callable = None)[source]

Bases: object

Inbound transport manager class.

closed_session(session: aries_cloudagent.transport.inbound.session.InboundSession)[source]

Clean up a closed session.

Returns an undelivered message to the caller if possible.

create_session(transport_type: str, *, accept_undelivered: bool = False, can_respond: bool = False, client_info: dict = None, wire_format: aries_cloudagent.transport.wire_format.BaseWireFormat = None)[source]

Create a new inbound session.

Parameters:
  • transport_type – The inbound transport identifier
  • accept_undelivered – Flag for accepting undelivered messages
  • can_respond – Flag indicating that the transport can send responses
  • client_info – An optional dict describing the client
  • wire_format – Override the wire format for this session
dispatch_complete(message: aries_cloudagent.transport.inbound.message.InboundMessage, completed: aries_cloudagent.utils.task_queue.CompletedTask)[source]

Handle completion of message dispatch.

get_transport_instance(transport_id: str) → aries_cloudagent.transport.inbound.base.BaseInboundTransport[source]

Get an instance of a running transport by ID.

process_undelivered(session: aries_cloudagent.transport.inbound.session.InboundSession)[source]

Interact with undelivered queue to find applicable messages.

Parameters:session – The inbound session
register(config: aries_cloudagent.transport.inbound.base.InboundTransportConfiguration) → str[source]

Register transport module.

Parameters:config – The inbound transport configuration
register_transport(transport: aries_cloudagent.transport.inbound.base.BaseInboundTransport, transport_id: str) → str[source]

Register a new inbound transport class.

Parameters:
  • transport – Transport instance to register
  • transport_id – The transport ID to register
return_to_session(outbound: aries_cloudagent.transport.outbound.message.OutboundMessage) → bool[source]

Return an outbound message via an open session, if possible.

return_undelivered(outbound: aries_cloudagent.transport.outbound.message.OutboundMessage) → bool[source]

Add an undelivered message to the undelivered queue.

At this point the message could not be associated with an inbound session and could not be delivered via an outbound transport.

setup()[source]

Perform setup operations.

start()[source]

Start all registered transports.

start_transport(transport_id: str)[source]

Start a registered inbound transport.

Parameters:transport_id – ID for the inbound transport to start
stop(wait: bool = True)[source]

Stop all registered transports.

aries_cloudagent.transport.inbound.ws module

Websockets Transport classes and functions.

class aries_cloudagent.transport.inbound.ws.WsTransport(host: str, port: int, create_session, **kwargs)[source]

Bases: aries_cloudagent.transport.inbound.base.BaseInboundTransport

Websockets Transport class.

inbound_message_handler(request)[source]

Message handler for inbound messages.

Parameters:request – aiohttp request object
Returns:The web response
make_application() → <sphinx.ext.autodoc.importer._MockObject object at 0x7ffa2ed945f8>[source]

Construct the aiohttp application.

scheme

Accessor for this transport’s scheme.

start() → None[source]

Start this transport.

Raises:InboundTransportSetupError – If there was an error starting the webserver
stop() → None[source]

Stop this transport.