aries_cloudagent.revocation.models package

Submodules

aries_cloudagent.revocation.models.indy module

Indy utilities for revocation.

class aries_cloudagent.revocation.models.indy.NonRevocationInterval(fro: int = None, to: int = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModel

Indy non-revocation interval.

class Meta[source]

Bases: object

NonRevocationInterval metadata.

schema_class = 'NonRevocationIntervalSchema'
covers(timestamp: int = None) → bool[source]

Whether input timestamp (default now) lies within non-revocation interval.

Parameters:timestamp – time of interest
Returns:whether input time satisfies non-revocation interval
timestamp() → bool[source]

Return a timestamp that the non-revocation interval covers.

class aries_cloudagent.revocation.models.indy.NonRevocationIntervalSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base.BaseModelSchema

Schema to allow serialization/deserialization of non-revocation intervals.

class Meta[source]

Bases: object

NonRevocationIntervalSchema metadata.

model_class

alias of NonRevocationInterval

fro = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IntEpoch object>, 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 integer.', 'too_large': 'Number too large.'})>
to = <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IntEpoch object>, 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 integer.', 'too_large': 'Number too large.'})>

aries_cloudagent.revocation.models.issuer_cred_rev_record module

Issuer credential revocation information.

class aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord(*, record_id: str = None, state: str = None, cred_ex_id: str = None, rev_reg_id: str = None, cred_rev_id: str = None, cred_def_id: str = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Represents credential revocation information to retain post-issue.

class Meta[source]

Bases: object

IssuerCredRevRecord metadata.

schema_class = 'IssuerCredRevRecordSchema'
RECORD_ID_NAME = 'record_id'
RECORD_TOPIC = 'issuer_cred_rev'
RECORD_TYPE = 'issuer_cred_rev'
STATE_ISSUED = 'issued'
STATE_REVOKED = 'revoked'
TAG_NAMES = {'cred_def_id', 'cred_ex_id', 'cred_rev_id', 'rev_reg_id', 'state'}
classmethod query_by_ids(session: aries_cloudagent.core.profile.ProfileSession, *, cred_def_id: str = None, rev_reg_id: str = None, state: str = None) → Sequence[aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord][source]

Retrieve issuer cred rev records by cred def id and/or rev reg id.

Parameters:
  • session – the profile session to use
  • cred_def_id – the cred def id by which to filter
  • rev_reg_id – the rev reg id by which to filter
  • state – a state value by which to filter
record_id

Accessor for the ID associated with this exchange.

classmethod retrieve_by_cred_ex_id(session: aries_cloudagent.core.profile.ProfileSession, cred_ex_id: str) → aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord[source]

Retrieve an issuer cred rev record by rev reg id and cred rev id.

classmethod retrieve_by_ids(session: aries_cloudagent.core.profile.ProfileSession, rev_reg_id: str, cred_rev_id: str) → aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord[source]

Retrieve an issuer cred rev record by rev reg id and cred rev id.

set_state(session: aries_cloudagent.core.profile.ProfileSession, state: str = None)[source]

Change the issuer cred rev record state (default issued).

class aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

Schema to allow de/serialization of credential revocation records.

class Meta[source]

Bases: object

IssuerCredRevRecordSchema metadata.

model_class

alias of IssuerCredRevRecord

cred_def_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredDefId object>, 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_rev_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredRevId object>, 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.'})>
record_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.'})>
rev_reg_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegId object>, 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=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.'})>

aries_cloudagent.revocation.models.issuer_rev_reg_record module

Issuer revocation registry storage handling.

class aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord(*, record_id: str = None, state: str = None, cred_def_id: str = None, error_msg: str = None, issuer_did: str = None, max_cred_num: int = None, revoc_def_type: str = None, revoc_reg_id: str = None, revoc_reg_def: Union[aries_cloudagent.indy.models.revocation.IndyRevRegDef, Mapping[KT, VT_co]] = None, revoc_reg_entry: Union[aries_cloudagent.indy.models.revocation.IndyRevRegEntry, Mapping[KT, VT_co]] = None, tag: str = None, tails_hash: str = None, tails_local_path: str = None, tails_public_uri: str = None, pending_pub: Sequence[str] = None, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecord

Class for managing local issuing revocation registries.

LOG_STATE_FLAG = 'debug.revocation'
class Meta[source]

Bases: object

IssuerRevRegRecord metadata.

schema_class = 'IssuerRevRegRecordSchema'
RECORD_ID_NAME = 'record_id'
RECORD_TOPIC = 'revocation_registry'
RECORD_TYPE = 'issuer_rev_reg'
REVOC_DEF_TYPE_CL = 'CL_ACCUM'
STATE_ACTIVE = 'active'
STATE_FULL = 'full'
STATE_GENERATED = 'generated'
STATE_INIT = 'init'
STATE_POSTED = 'posted'
TAG_NAMES = {'cred_def_id', 'issuer_did', 'revoc_def_type', 'revoc_reg_id', 'state'}
clear_pending(session: aries_cloudagent.core.profile.ProfileSession, cred_rev_ids: Sequence[str] = None) → None[source]

Clear pending revocations and save any resulting record change.

Parameters:
  • session – The profile session to use
  • cred_rev_ids – Credential revocation identifiers to clear; default all
generate_registry(profile: aries_cloudagent.core.profile.Profile)[source]

Create the revocation registry definition and tails file.

get_registry() → aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry[source]

Create a RevocationRegistry instance from this record.

mark_pending(session: aries_cloudagent.core.profile.ProfileSession, cred_rev_id: str) → None[source]

Mark a credential revocation id as revoked pending publication to ledger.

Parameters:
  • session – The profile session to use
  • cred_rev_id – The credential revocation identifier for credential to revoke
classmethod query_by_cred_def_id(session: aries_cloudagent.core.profile.ProfileSession, cred_def_id: str, state: str = None) → Sequence[aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord][source]

Retrieve issuer revocation registry records by credential definition ID.

Parameters:
  • session – The profile session to use
  • cred_def_id – The credential definition ID to filter by
  • state – A state value to filter by
classmethod query_by_pending(session: aries_cloudagent.core.profile.ProfileSession) → Sequence[aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord][source]

Retrieve issuer revocation records with revocations pending.

Parameters:session – The profile session to use
record_id

Accessor for the record ID.

record_value

Accessor for JSON value properties of this revocation registry record.

classmethod retrieve_by_revoc_reg_id(session: aries_cloudagent.core.profile.ProfileSession, revoc_reg_id: str) → aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord[source]

Retrieve a revocation registry record by revocation registry ID.

Parameters:
  • session – The profile session to use
  • revoc_reg_id – The revocation registry ID
revoc_reg_def

Accessor; get deserialized.

revoc_reg_entry

Accessor; get deserialized.

send_def(profile: aries_cloudagent.core.profile.Profile, write_ledger: bool = True, endorser_did: str = None)[source]

Send the revocation registry definition to the ledger.

send_entry(profile: aries_cloudagent.core.profile.Profile, write_ledger: bool = True, endorser_did: str = None)[source]

Send a registry entry to the ledger.

set_state(session: aries_cloudagent.core.profile.ProfileSession, state: str = None)[source]

Change the registry state (default full).

set_tails_file_public_uri(profile: aries_cloudagent.core.profile.Profile, tails_file_uri: str)[source]

Update tails file’s publicly accessible URI.

stage_pending_registry(profile: aries_cloudagent.core.profile.Profile, max_attempts: int = 5)[source]

Prepare registry definition for future use.

class aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecordSchema(*args, **kwargs)[source]

Bases: aries_cloudagent.messaging.models.base_record.BaseRecordSchema

Schema to allow serialization/deserialization of issuer rev reg records.

class Meta[source]

Bases: object

IssuerRevRegRecordSchema metadata.

model_class

alias of IssuerRevRegRecord

cred_def_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredDefId object>, 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.'})>
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.'})>
issuer_did = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyDID object>, 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.'})>
max_cred_num = <fields.Integer(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 integer.', 'too_large': 'Number too large.'})>
pending_pub = <fields.List(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 list.'})>
record_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.'})>
revoc_def_type = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<Equal(comparable='CL_ACCUM', error='Must be equal to {other}.')>, 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.'})>
revoc_reg_def = <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.'})>
revoc_reg_entry = <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.'})>
revoc_reg_id = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegId object>, 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=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.'})>
tag = <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.'})>
tails_hash = <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.Base58SHA256Hash object>, 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.'})>
tails_local_path = <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.'})>
tails_public_uri = <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.'})>

aries_cloudagent.revocation.models.revocation_registry module

Classes for managing a revocation registry.

class aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry(registry_id: str = None, *, cred_def_id: str = None, issuer_did: str = None, max_creds: int = None, reg_def_type: str = None, tag: str = None, tails_local_path: str = None, tails_public_uri: str = None, tails_hash: str = None, reg_def: dict = None)[source]

Bases: object

Manage a revocation registry and tails file.

MAX_SIZE = 32768
MIN_SIZE = 4
cred_def_id

Accessor for the credential definition ID.

classmethod from_definition(revoc_reg_def: dict, public_def: bool) → aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry[source]

Initialize a revocation registry instance from a definition.

get_or_fetch_local_tails_path()[source]

Get the local tails path, retrieving from the remote if necessary.

get_receiving_tails_local_path()[source]

Make the local path to the tails file we download from remote URI.

has_local_tails_file() → bool[source]

Test if the tails file exists locally.

issuer_did

Accessor for the issuer DID.

max_creds

Accessor for the maximum number of issued credentials.

reg_def

Accessor for the revocation registry definition.

reg_def_type

Accessor for the revocation registry type.

registry_id

Accessor for the revocation registry ID.

retrieve_tails()[source]

Fetch the tails file from the public URI.

tag

Accessor for the tag part of the revoc. reg. ID.

tails_hash

Accessor for the tails file hash.

tails_local_path

Accessor for the tails file local path.

tails_public_uri

Accessor for the tails file public URI.