aries_cloudagent.protocols.coordinate_mediation package

Subpackages

Submodules

aries_cloudagent.protocols.coordinate_mediation.definition module

Version definitions for this protocol.

aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store module

Storage management for configuration-provided mediation invite.

Handle storage and retrieval of mediation invites provided through arguments. Enables having the mediation invite config be the same for provision and starting commands.

class aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord[source]

Bases: tuple

A record to store mediation invites and their freshness.

static from_json(json_invite_record: str) → aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord[source]
Returns:a mediation invite record deserialized from a json string.
invite

Alias for field number 0

to_json() → str[source]
Returns:The current record serialized into a json string.
static unused(invite: str) → aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord[source]
Parameters:invite – invite string as provided by the mediator.
Returns:An unused mediation invitation for the given invite string
used

Alias for field number 1

class aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteStore(storage: aries_cloudagent.storage.base.BaseStorage)[source]

Bases: object

Store and retrieve mediation invite configuration.

INVITE_RECORD_CATEGORY = 'config'
MEDIATION_INVITE_ID = 'mediation_invite'
get_mediation_invite_record(provided_mediation_invitation: Optional[str]) → Optional[aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord][source]

Provide the MediationInviteRecord to use/that was used for mediation.

Returned record may have been used already.

Stored record is updated if provided_mediation_invitation has changed. Updated record is marked as unused.

Parameters:provided_mediation_invitation – mediation invite provided by user
Returns:mediation invite to use/that was used to connect to the mediator. None if no invitation was provided/provisioned.
mark_default_invite_as_used()[source]

Mark the currently stored invitation as used if one exists.

Raises:NoDefaultMediationInviteException – if trying to mark invite as used when there is no invite stored.
store(mediation_invite: aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord) → aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.MediationInviteRecord[source]

Store the mediator’s invite for further use when starting the agent.

Update the currently stored invite if one already exists. This assumes a new invite and as such, marks it as unused.

Parameters:mediation_invite – mediation invite url
Returns:stored mediation invite
exception aries_cloudagent.protocols.coordinate_mediation.mediation_invite_store.NoDefaultMediationInviteException[source]

Bases: Exception

Raised if trying to mark a default invite as used when none exist.