aries_cloudagent.connections.models package¶
Subpackages¶
Submodules¶
aries_cloudagent.connections.models.conn_record module¶
Handle connection information interface with non-secrets storage.
-
class
aries_cloudagent.connections.models.conn_record.
ConnRecord
(*, connection_id: str = None, my_did: str = None, their_did: str = None, their_label: str = None, their_role: Union[str, ConnRecord.Role] = None, invitation_key: str = None, invitation_msg_id: str = None, request_id: str = None, state: Union[str, ConnRecord.State] = None, inbound_connection_id: str = None, error_msg: str = None, routing_state: str = None, accept: str = None, invitation_mode: str = None, alias: str = None, their_public_did: str = None, rfc23_state: str = None, initiator: str = None, connection_protocol: Union[str, ConnRecord.Protocol] = None, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecord
Represents a single pairwise connection.
-
ACCEPT_AUTO
= 'auto'¶
-
ACCEPT_MANUAL
= 'manual'¶
-
INVITATION_MODE_MULTI
= 'multi'¶
-
INVITATION_MODE_ONCE
= 'once'¶
-
INVITATION_MODE_STATIC
= 'static'¶
-
LOG_STATE_FLAG
= 'debug.connections'¶
-
class
Protocol
[source]¶ Bases:
enum.Enum
Supported Protocols for Connection.
-
RFC_0023
= 'didexchange/1.0'¶
-
RFC_0160
= 'connections/1.0'¶
-
aries_protocol
¶ Return used connection protocol.
-
-
RECORD_ID_NAME
= 'connection_id'¶
-
RECORD_TOPIC
= 'connections'¶
-
RECORD_TYPE
= 'connection'¶
-
RECORD_TYPE_INVITATION
= 'connection_invitation'¶
-
RECORD_TYPE_METADATA
= 'connection_metadata'¶
-
RECORD_TYPE_REQUEST
= 'connection_request'¶
-
ROUTING_STATE_ACTIVE
= 'active'¶
-
ROUTING_STATE_ERROR
= 'error'¶
-
ROUTING_STATE_NONE
= 'none'¶
-
ROUTING_STATE_REQUEST
= 'request'¶
-
class
Role
[source]¶ Bases:
enum.Enum
RFC 160 (inviter, invitee) = RFC 23 (responder, requester).
-
REQUESTER
= ('invitee', 'requester')¶
-
RESPONDER
= ('inviter', 'responder')¶
-
rfc160
¶ Return RFC 160 (connection protocol) nomenclature.
-
rfc23
¶ Return RFC 23 (DID exchange protocol) nomenclature.
-
-
class
State
[source]¶ Bases:
enum.Enum
Collator for equivalent states between RFC 160 and RFC 23.
On the connection record, the state has to serve for both RFCs. Hence, internally, RFC23 requester/responder states collate to their RFC160 condensed equivalent.
-
ABANDONED
= ('error', 'abandoned')¶
-
COMPLETED
= ('active', 'completed')¶
-
INIT
= ('init', 'start')¶
-
INVITATION
= ('invitation', 'invitation')¶
-
REQUEST
= ('request', 'request')¶
-
RESPONSE
= ('response', 'response')¶
-
rfc160
¶ Return RFC 160 (connection protocol) nomenclature.
-
rfc23
¶ Return RFC 23 (DID exchange protocol) nomenclature to record logic.
-
-
TAG_NAMES
= {'invitation_key', 'invitation_msg_id', 'my_did', 'request_id', 'state', 'their_did', 'their_public_did', 'their_role'}¶
-
abandon
(session: aries_cloudagent.core.profile.ProfileSession, *, reason: Optional[str] = None)[source]¶ Set state to abandoned.
-
attach_invitation
(session: aries_cloudagent.core.profile.ProfileSession, invitation: Union[aries_cloudagent.protocols.connections.v1_0.messages.connection_invitation.ConnectionInvitation, aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage])[source]¶ Persist the related connection invitation to storage.
Parameters: - session – The active profile session
- invitation – The invitation to relate to this connection record
-
attach_request
(session: aries_cloudagent.core.profile.ProfileSession, request: Union[aries_cloudagent.protocols.connections.v1_0.messages.connection_request.ConnectionRequest, aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest])[source]¶ Persist the related connection request to storage.
Parameters: - session – The active profile session
- request – The request to relate to this connection record
-
connection_id
¶ Accessor for the ID associated with this connection.
-
delete_record
(session: aries_cloudagent.core.profile.ProfileSession)[source]¶ Perform connection record deletion actions.
Parameters: session (ProfileSession) – session
-
classmethod
find_existing_connection
(session: aries_cloudagent.core.profile.ProfileSession, their_public_did: str) → Optional[aries_cloudagent.connections.models.conn_record.ConnRecord][source]¶ Retrieve existing active connection records (public did).
Parameters: - session – The active profile session
- their_public_did – Inviter public DID
-
is_multiuse_invitation
¶ Accessor for multi use invitation mode.
-
is_ready
¶ Accessor for connection readiness.
-
metadata_delete
(session: aries_cloudagent.core.profile.ProfileSession, key: str)[source]¶ Delete custom metadata associated with this connection.
Parameters: - session (ProfileSession) – session used for storage
- key (str) – key of metadata to delete
-
metadata_get
(session: aries_cloudagent.core.profile.ProfileSession, key: str, default: Any = None) → Any[source]¶ Retrieve arbitrary metadata associated with this connection.
Parameters: - session (ProfileSession) – session used for storage
- key (str) – key identifying metadata
- default (Any) – default value to get; type should be a JSON compatible value.
Returns: metadata stored by key
Return type: Any
-
metadata_get_all
(session: aries_cloudagent.core.profile.ProfileSession) → dict[source]¶ Return all custom metadata associated with this connection.
Parameters: session (ProfileSession) – session used for storage Returns: dictionary representation of all metadata values Return type: dict
-
metadata_set
(session: aries_cloudagent.core.profile.ProfileSession, key: str, value: Any)[source]¶ Set arbitrary metadata associated with this connection.
Parameters: - session (ProfileSession) – session used for storage
- key (str) – key identifying metadata
- value (Any) – value to set
-
post_save
(session: aries_cloudagent.core.profile.ProfileSession, *args, **kwargs)[source]¶ Perform post-save actions.
Parameters: session – The active profile session
-
record_value
¶ Accessor to for the JSON record value properties for this connection.
-
classmethod
retrieve_by_alias
(session: aries_cloudagent.core.profile.ProfileSession, alias: str) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]¶ Retrieve a connection record from an alias.
Parameters: - session – The active profile session
- alias – The alias of the connection
-
classmethod
retrieve_by_did
(session: aries_cloudagent.core.profile.ProfileSession, their_did: Optional[str] = None, my_did: Optional[str] = None, their_role: Optional[str] = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]¶ Retrieve a connection record by target DID.
Parameters: - session – The active profile session
- their_did – The target DID to filter by
- my_did – One of our DIDs to filter by
- my_role – Filter connections by their role
-
classmethod
retrieve_by_invitation_key
(session: aries_cloudagent.core.profile.ProfileSession, invitation_key: str, their_role: str = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]¶ Retrieve a connection record by invitation key.
Parameters: - session – The active profile session
- invitation_key – The key on the originating invitation
- initiator – Filter by the initiator value
-
classmethod
retrieve_by_invitation_msg_id
(session: aries_cloudagent.core.profile.ProfileSession, invitation_msg_id: str, their_role: str = None) → Optional[aries_cloudagent.connections.models.conn_record.ConnRecord][source]¶ Retrieve a connection record by invitation_msg_id.
Parameters: - session – The active profile session
- invitation_msg_id – Invitation message identifier
- initiator – Filter by the initiator value
-
classmethod
retrieve_by_request_id
(session: aries_cloudagent.core.profile.ProfileSession, request_id: str, their_role: str = None) → aries_cloudagent.connections.models.conn_record.ConnRecord[source]¶ Retrieve a connection record from our previous request ID.
Parameters: - session – The active profile session
- request_id – The ID of the originating connection request
-
retrieve_invitation
(session: aries_cloudagent.core.profile.ProfileSession) → Union[aries_cloudagent.protocols.connections.v1_0.messages.connection_invitation.ConnectionInvitation, aries_cloudagent.protocols.out_of_band.v1_0.messages.invitation.InvitationMessage][source]¶ Retrieve the related connection invitation.
Parameters: session – The active profile session
-
retrieve_request
(session: aries_cloudagent.core.profile.ProfileSession) → Union[aries_cloudagent.protocols.connections.v1_0.messages.connection_request.ConnectionRequest, aries_cloudagent.protocols.didexchange.v1_0.messages.request.DIDXRequest][source]¶ Retrieve the related connection invitation.
Parameters: session – The active profile session
-
rfc23_state
¶ RFC23 state per RFC text, potentially particular to role.
-
-
class
aries_cloudagent.connections.models.conn_record.
ConnRecordSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base_record.BaseRecordSchema
Schema to allow serialization/deserialization of connection records.
-
class
Meta
[source]¶ Bases:
object
ConnRecordSchema metadata.
-
model_class
¶ alias of
ConnRecord
-
-
accept
¶ Used by autodoc_mock_imports.
-
alias
¶ Used by autodoc_mock_imports.
-
connection_id
¶ Used by autodoc_mock_imports.
-
connection_protocol
¶ Used by autodoc_mock_imports.
-
error_msg
¶ Used by autodoc_mock_imports.
-
inbound_connection_id
¶ Used by autodoc_mock_imports.
-
invitation_key
¶ Used by autodoc_mock_imports.
-
invitation_mode
¶ Used by autodoc_mock_imports.
-
invitation_msg_id
¶ Used by autodoc_mock_imports.
-
my_did
¶ Used by autodoc_mock_imports.
-
request_id
¶ Used by autodoc_mock_imports.
-
rfc23_state
¶ Used by autodoc_mock_imports.
-
routing_state
¶ Used by autodoc_mock_imports.
-
their_did
¶ Used by autodoc_mock_imports.
-
their_label
¶ Used by autodoc_mock_imports.
-
their_public_did
¶ Used by autodoc_mock_imports.
-
their_role
¶ Used by autodoc_mock_imports.
-
class
aries_cloudagent.connections.models.connection_target module¶
Record used to handle routing of messages to another agent.
-
class
aries_cloudagent.connections.models.connection_target.
ConnectionTarget
(*, did: Optional[str] = None, endpoint: Optional[str] = None, label: Optional[str] = None, recipient_keys: Optional[Sequence[str]] = None, routing_keys: Optional[Sequence[str]] = None, sender_key: Optional[str] = None)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModel
Record used to handle routing of messages to another agent.
-
class
aries_cloudagent.connections.models.connection_target.
ConnectionTargetSchema
(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.base.BaseModelSchema
ConnectionTarget schema.
-
class
Meta
[source]¶ Bases:
object
ConnectionTargetSchema metadata.
-
model_class
¶ alias of
ConnectionTarget
-
unknown
¶ Used by autodoc_mock_imports.
-
-
did
¶ Used by autodoc_mock_imports.
-
endpoint
¶ Used by autodoc_mock_imports.
-
label
¶ Used by autodoc_mock_imports.
-
recipient_keys
¶ Used by autodoc_mock_imports.
-
routing_keys
¶ Used by autodoc_mock_imports.
-
sender_key
¶ Used by autodoc_mock_imports.
-
class