aries_cloudagent.connections package¶
Subpackages¶
Submodules¶
aries_cloudagent.connections.base_manager module¶
Class to provide some common utilities.
For Connection, DIDExchange and OutOfBand Manager.
-
class
aries_cloudagent.connections.base_manager.
BaseConnectionManager
(profile: aries_cloudagent.core.profile.Profile)[source]¶ Bases:
object
Class to provide utilities regarding connection_targets.
-
RECORD_TYPE_DID_DOC
= 'did_doc'¶
-
RECORD_TYPE_DID_KEY
= 'did_key'¶
-
add_key_for_did
(did: str, key: str)[source]¶ Store a verkey for lookup against a DID.
Parameters: - did – The DID to associate with this key
- key – The verkey to be added
-
create_did_document
(did_info: aries_cloudagent.wallet.did_info.DIDInfo, inbound_connection_id: Optional[str] = None, svc_endpoints: Optional[Sequence[str]] = None, mediation_records: Optional[List[aries_cloudagent.protocols.coordinate_mediation.v1_0.models.mediation_record.MediationRecord]] = None) → aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc[source]¶ Create our DID doc for a given DID.
Parameters: - did_info – The DID information (DID and verkey) used in the connection
- inbound_connection_id – The ID of the inbound routing connection to use
- svc_endpoints – Custom endpoints for the DID Document
- mediation_record – The record for mediation that contains routing_keys and service endpoint
Returns: The prepared DIDDoc instance
-
create_static_connection
(my_did: Optional[str] = None, my_seed: Optional[str] = None, their_did: Optional[str] = None, their_seed: Optional[str] = None, their_verkey: Optional[str] = None, their_endpoint: Optional[str] = None, their_label: Optional[str] = None, alias: Optional[str] = None, mediation_id: Optional[str] = None) → Tuple[aries_cloudagent.wallet.did_info.DIDInfo, aries_cloudagent.wallet.did_info.DIDInfo, aries_cloudagent.connections.models.conn_record.ConnRecord][source]¶ Register a new static connection (for use by the test suite).
Parameters: - my_did – override the DID used in the connection
- my_seed – provide a seed used to generate our DID and keys
- their_did – provide the DID used by the other party
- their_seed – provide a seed used to generate their DID and keys
- their_verkey – provide the verkey used by the other party
- their_endpoint – their URL endpoint for routing messages
- alias – an alias for this connection record
Returns: my DIDInfo, their DIDInfo, new ConnRecord instance
Return type: Tuple
-
diddoc_connection_targets
(doc: aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc, sender_verkey: str, their_label: Optional[str] = None) → Sequence[aries_cloudagent.connections.models.connection_target.ConnectionTarget][source]¶ Get a list of connection targets from a DID Document.
Parameters: - doc – The DID Document to create the target from
- sender_verkey – The verkey we are using
- their_label – The connection label they are using
-
fetch_connection_targets
(connection: aries_cloudagent.connections.models.conn_record.ConnRecord) → Sequence[aries_cloudagent.connections.models.connection_target.ConnectionTarget][source]¶ Get a list of connection targets from a ConnRecord.
Parameters: connection – The connection record (with associated DIDDoc) used to generate the connection target
-
fetch_did_document
(did: str) → Tuple[aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc, aries_cloudagent.storage.record.StorageRecord][source]¶ Retrieve a DID Document for a given DID.
Parameters: did – The DID to search for
-
find_connection
(their_did: str, my_did: Optional[str] = None, my_verkey: Optional[str] = None, auto_complete=False) → Optional[aries_cloudagent.connections.models.conn_record.ConnRecord][source]¶ Look up existing connection information for a sender verkey.
Parameters: - their_did – Their DID
- my_did – My DID
- my_verkey – My verkey
- auto_complete – Should this connection automatically be promoted to active
Returns: The located ConnRecord, if any
-
find_did_for_key
(key: str) → str[source]¶ Find the DID previously associated with a key.
Parameters: key – The verkey to look up
-
find_inbound_connection
(receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → Optional[aries_cloudagent.connections.models.conn_record.ConnRecord][source]¶ Deserialize an incoming message and further populate the request context.
Parameters: receipt – The message receipt Returns: The ConnRecord associated with the expanded message, if any
-
get_connection_targets
(*, connection_id: Optional[str] = None, connection: Optional[aries_cloudagent.connections.models.conn_record.ConnRecord] = None)[source]¶ Create a connection target from a ConnRecord.
Parameters: - connection_id – The connection ID to search for
- connection – The connection record itself, if already available
-
get_endpoints
(conn_id: str) → Tuple[Optional[str], Optional[str]][source]¶ Get connection endpoints.
Parameters: conn_id – connection identifier Returns: Their endpoint for this connection
-
record_keys_for_public_did
(did: str)[source]¶ Record the keys for a public DID.
This is required to correlate sender verkeys back to a connection.
-
remove_keys_for_did
(did: str)[source]¶ Remove all keys associated with a DID.
Parameters: did – The DID for which to remove keys
-
resolve_connection_targets
(did: str, sender_verkey: Optional[str] = None, their_label: Optional[str] = None) → List[aries_cloudagent.connections.models.connection_target.ConnectionTarget][source]¶ Resolve connection targets for a DID.
-
resolve_didcomm_services
(did: str, service_accept: Optional[Sequence[str]] = None) → Tuple[<sphinx.ext.autodoc.importer._MockObject object at 0x7f0ea7833760>, List[<sphinx.ext.autodoc.importer._MockObject object at 0x7f0ea78338e0>]][source]¶ Resolve a DIDComm services for a given DID.
-
resolve_inbound_connection
(receipt: aries_cloudagent.transport.inbound.receipt.MessageReceipt) → Optional[aries_cloudagent.connections.models.conn_record.ConnRecord][source]¶ Populate the receipt DID information and find the related ConnRecord.
Parameters: receipt – The message receipt Returns: The ConnRecord associated with the expanded message, if any
-
resolve_invitation
(did: str, service_accept: Optional[Sequence[str]] = None) → Tuple[str, List[str], List[str]][source]¶ Resolve invitation with the DID Resolver.
Parameters: did – Document ID to resolve
-
store_did_document
(did_doc: aries_cloudagent.connections.models.diddoc.diddoc.DIDDoc)[source]¶ Store a DID document.
Parameters: did_doc – The DIDDoc instance to persist
-
verification_methods_for_service
(doc: <sphinx.ext.autodoc.importer._MockObject object at 0x7f0ea7833760>, service: <sphinx.ext.autodoc.importer._MockObject object at 0x7f0ea78338e0>) → Tuple[List[<sphinx.ext.autodoc.importer._MockObject object at 0x7f0ea7833250>], List[<sphinx.ext.autodoc.importer._MockObject object at 0x7f0ea7833250>]][source]¶ Dereference recipient and routing keys.
Returns verification methods for a DIDComm service to enable extracting key material.
-
-
exception
aries_cloudagent.connections.base_manager.
BaseConnectionManagerError
(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseError
BaseConnectionManager error.