aries_cloudagent.protocols.didexchange.v1_0 package

Subpackages

Submodules

aries_cloudagent.protocols.didexchange.v1_0.manager module

Classes to manage connection establishment under RFC 23 (DID exchange).

class aries_cloudagent.protocols.didexchange.v1_0.manager.DIDXManager(profile: aries_cloudagent.core.profile.Profile)[source]

Bases: aries_cloudagent.connections.base_manager.BaseConnectionManager

Class for managing connections under RFC 23 (DID exchange).

async accept_complete(complete: aries_cloudagent.protocols.didexchange.v1_0.messages.complete.DIDXComplete, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Accept a connection complete message under RFC 23 (DID exchange).

Process a DIDXComplete message by looking up the connection record and marking the exchange complete.

Parameters
  • complete – The DIDXComplete to accept

  • receipt – The message receipt

Returns

The updated ConnRecord representing the connection

Raises

DIDXManagerError – If the corresponding connection does not exist or is not in the response-sent state

async accept_response(response: aries_cloudagent.protocols.didexchange.v1_0.messages.response.DIDXResponse, receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Accept a connection response under RFC 23 (DID exchange).

Process a DIDXResponse message by looking up the connection request and setting up the pairwise connection.

Parameters
  • response – The DIDXResponse to accept

  • receipt – The message receipt

Returns

The updated ConnRecord representing the connection

Raises
  • DIDXManagerError – If there is no DID associated with the connection response

  • DIDXManagerError – If the corresponding connection is not in the request-sent state

async create_request(conn_rec: aries_cloudagent.connections.models.conn_record.ConnRecord, my_label: Optional[str] = None, my_endpoint: Optional[str] = None, mediation_id: Optional[str] = None, goal_code: Optional[str] = None, goal: Optional[str] = None, use_public_did: bool = False) aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest[source]

Create a new connection request for a previously-received invitation.

Parameters
  • conn_rec – The ConnRecord representing the invitation to accept

  • my_label – My label for request

  • my_endpoint – My endpoint

  • mediation_id – The record id for mediation that contains routing_keys and service endpoint

  • goal_code – Optional self-attested code for sharing intent of connection

  • goal – Optional self-attested string for sharing intent of connection

  • use_public_did – Flag whether to use public DID and omit DID Doc attachment on request

Returns

A new DIDXRequest message to send to the other agent

async create_request_implicit(their_public_did: str, my_label: Optional[str] = None, my_endpoint: Optional[str] = None, mediation_id: Optional[str] = None, use_public_did: bool = False, alias: Optional[str] = None, goal_code: Optional[str] = None, goal: Optional[str] = None) aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Create and send a request against a public DID only (no explicit invitation).

Parameters
  • their_public_did – public DID to which to request a connection

  • my_label – my label for request

  • my_endpoint – my endpoint

  • mediation_id – record id for mediation with routing_keys, service endpoint

  • use_public_did – use my public DID for this connection

  • goal_code – Optional self-attested code for sharing intent of connection

  • goal – Optional self-attested string for sharing intent of connection

Returns

The new ConnRecord instance

async create_response(conn_rec: aries_cloudagent.connections.models.conn_record.ConnRecord, my_endpoint: Optional[str] = None, mediation_id: Optional[str] = None, use_public_did: Optional[bool] = None) aries_cloudagent.protocols.didexchange.v1_0.messages.response.DIDXResponse[source]

Create a connection response for a received connection request.

Parameters
  • conn_rec – The ConnRecord with a pending connection request

  • my_endpoint – Current agent endpoint

  • mediation_id – The record id for mediation that contains routing_keys and service endpoint

Returns

New DIDXResponse message

async get_first_applicable_didcomm_service(did_doc: pydid.BaseDIDDocument) str[source]

Return first applicable DIDComm service url with highest priority.

async get_resolved_did_document(qualified_did: str) pydid.BaseDIDDocument[source]

Return resolved DID document.

property profile: aries_cloudagent.core.profile.Profile

Accessor for the current profile.

Returns

The profile for this did exchange manager

async receive_invitation(invitation: aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage, their_public_did: Optional[str] = None, auto_accept: Optional[bool] = None, alias: Optional[str] = None, mediation_id: Optional[str] = None) aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Create a new connection record to track a received invitation.

Parameters
  • invitation – invitation to store

  • their_public_did – their public DID

  • auto_accept – set to auto-accept invitation (None to use config)

  • alias – optional alias to set on record

  • mediation_id – record id for mediation with routing_keys, service endpoint

Returns

The new ConnRecord instance

async receive_problem_report(conn_rec: aries_cloudagent.connections.models.conn_record.ConnRecord, report: aries_cloudagent.protocols.didexchange.v1_0.messages.problem_report.DIDXProblemReport)[source]

Receive problem report.

async receive_request(request: aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest, recipient_did: str, recipient_verkey: Optional[str] = None, my_endpoint: Optional[str] = None, alias: Optional[str] = None, auto_accept_implicit: Optional[bool] = None) aries_cloudagent.connections.models.conn_record.ConnRecord[source]

Receive and store a connection request.

Parameters
  • request – The DIDXRequest to accept

  • recipient_did – The (unqualified) recipient DID

  • recipient_verkey – The recipient verkey: None for public recipient DID

  • my_endpoint – My endpoint

  • alias – Alias for the connection

  • auto_accept – Auto-accept request against implicit invitation

Returns

The new or updated ConnRecord instance

async reject(conn_rec: aries_cloudagent.connections.models.conn_record.ConnRecord, *, reason: Optional[str] = None) aries_cloudagent.protocols.didexchange.v1_0.messages.problem_report.DIDXProblemReport[source]

Abandon an existing DID exchange.

async verify_diddoc(wallet: aries_cloudagent.wallet.base.BaseWallet, attached: aries_cloudagent.messaging.decorators.attach_decorator.AttachDecorator, invi_key: Optional[str] = None) aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc[source]

Verify DIDDoc attachment and return signed data.

exception aries_cloudagent.protocols.didexchange.v1_0.manager.DIDXManagerError(*args, error_code: Optional[str] = None, **kwargs)[source]

Bases: aries_cloudagent.core.error.BaseError

Connection error.

aries_cloudagent.protocols.didexchange.v1_0.message_types module

Message type identifiers for Connections.

aries_cloudagent.protocols.didexchange.v1_0.routes module

Connection handling admin routes.

class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXAcceptInvitationQueryStringSchema(*args: Any, **kwargs: Any)[source]

Bases: marshmallow.

Parameters and validators for accept invitation request query string.

my_endpoint
my_label
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXAcceptRequestQueryStringSchema(*args: Any, **kwargs: Any)[source]

Bases: marshmallow.

Parameters and validators for accept-request request query string.

mediation_id
my_endpoint
use_public_did
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXConnIdMatchInfoSchema(*args: Any, **kwargs: Any)[source]

Bases: marshmallow.

Path parameters and validators for request taking connection id.

conn_id
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXConnIdRefIdMatchInfoSchema(*args: Any, **kwargs: Any)[source]

Bases: marshmallow.

Path parameters and validators for request taking connection and ref ids.

conn_id
ref_id
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXCreateRequestImplicitQueryStringSchema(*args: Any, **kwargs: Any)[source]

Bases: marshmallow.

Parameters and validators for create-request-implicit request query string.

alias
goal
goal_code
mediation_id
my_endpoint
my_label
their_public_did
use_public_did
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXReceiveRequestImplicitQueryStringSchema(*args: Any, **kwargs: Any)[source]

Bases: marshmallow.

Parameters and validators for receive-request-implicit request query string.

alias
auto_accept
mediation_id
my_endpoint
class aries_cloudagent.protocols.didexchange.v1_0.routes.DIDXRejectRequestSchema(*args: Any, **kwargs: Any)[source]

Bases: marshmallow.

Parameters and validators for reject-request request string.

reason
aries_cloudagent.protocols.didexchange.v1_0.routes.post_process_routes(app: aiohttp.web.Application)[source]

Amend swagger API.

async aries_cloudagent.protocols.didexchange.v1_0.routes.register(app: aiohttp.web.Application)[source]

Register routes.