aries_cloudagent.protocols.issue_credential.v2_0.models package

Package-wide code and data.

Submodules

aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record module

Aries#0453 v2.0 credential exchange information with non-secrets storage.

class aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord(*, cred_ex_id: str = None, connection_id: str = None, thread_id: str = None, parent_thread_id: str = None, initiator: str = None, role: str = None, state: str = None, cred_proposal: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_proposal.V20CredProposal] = None, cred_offer: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_offer.V20CredOffer] = None, cred_request: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_request.V20CredRequest] = None, cred_issue: Union[Mapping[KT, VT_co], aries_cloudagent.protocols.issue_credential.v2_0.messages.cred_issue.V20CredIssue] = None, auto_offer: bool = False, auto_issue: bool = False, auto_remove: bool = True, error_msg: str = None, trace: bool = False, cred_id_stored: str = None, conn_id: str = None, by_format: Mapping[KT, VT_co] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeRecord

Represents an Aries#0036 credential exchange.

INITIATOR_EXTERNAL = 'external'
INITIATOR_SELF = 'self'
class Meta[source]

Bases: object

CredentialExchange metadata.

schema_class = 'V20CredExRecordSchema'
RECORD_ID_NAME = 'cred_ex_id'
RECORD_TOPIC = 'issue_credential_v2_0'
RECORD_TYPE = 'cred_ex_v20'
ROLE_HOLDER = 'holder'
ROLE_ISSUER = 'issuer'
STATE_CREDENTIAL_RECEIVED = 'credential-received'
STATE_DONE = 'done'
STATE_ISSUED = 'credential-issued'
STATE_OFFER_RECEIVED = 'offer-received'
STATE_OFFER_SENT = 'offer-sent'
STATE_PROPOSAL_RECEIVED = 'proposal-received'
STATE_PROPOSAL_SENT = 'proposal-sent'
STATE_REQUEST_RECEIVED = 'request-received'
STATE_REQUEST_SENT = 'request-sent'
TAG_NAMES = {'thread_id'}
by_format

Record proposal, offer, request, and credential attachments by format.

cred_ex_id

Accessor for the ID associated with this exchange.

cred_issue

Accessor; get deserialized view.

cred_offer

Accessor; get deserialized view.

cred_preview

Credential preview (deserialized view) from credential proposal.

cred_proposal

Accessor; get deserialized view.

cred_request

Accessor; get deserialized view.

record_value

Accessor for the JSON record value generated for this credential exchange.

classmethod retrieve_by_conn_and_thread(session: aries_cloudagent.core.profile.ProfileSession, connection_id: str, thread_id: str) → aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecord[source]

Retrieve a credential exchange record by connection and thread ID.

save_error_state(session: aries_cloudagent.core.profile.ProfileSession, *, reason: str = None, log_params: Mapping[str, Any] = None, log_override: bool = False)[source]

Save record error state if need be; log and swallow any storage error.

Parameters:
  • session – The profile session to use
  • reason – A reason to add to the log
  • log_params – Additional parameters to log
  • override – Override configured logging regimen, print to stderr instead
class aries_cloudagent.protocols.issue_credential.v2_0.models.cred_ex_record.V20CredExRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseExchangeSchema

Schema to allow serialization/deserialization of credential exchange records.

class Meta[source]

Bases: object

V20CredExSchema metadata.

model_class

alias of V20CredExRecord

auto_issue = <fields.Boolean(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid boolean.'})>
auto_offer = <fields.Boolean(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid boolean.'})>
auto_remove = <fields.Boolean(default=True, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid boolean.'})>
by_format = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=True, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
connection_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
cred_ex_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
cred_issue = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
cred_offer = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
cred_preview = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=True, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
cred_proposal = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
cred_request = <fields.Nested(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'type': 'Invalid type.'})>
error_msg = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
initiator = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['self', 'external'], labels=[], error='Must be one of: {choices}.')>, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
parent_thread_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
role = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['issuer', 'holder'], labels=[], error='Must be one of: {choices}.')>, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
state = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['proposal-sent', 'proposal-received', 'offer-sent', 'offer-received', 'request-sent', 'request-received', 'credential-issued', 'credential-received', 'done'], labels=[], error='Must be one of: {choices}.')>, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>
thread_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=None, required=False, load_only=False, dump_only=False, missing=<marshmallow.missing>, allow_none=False, error_messages={'required': 'Missing data for required field.', 'null': 'Field may not be null.', 'validator_failed': 'Invalid value.', 'invalid': 'Not a valid string.', 'invalid_utf8': 'Not a valid utf-8 string.'})>