aries_cloudagent.revocation.models package

Submodules

aries_cloudagent.revocation.models.indy module

Indy utilities for revocation.

class aries_cloudagent.revocation.models.indy.NonRevocationInterval(fro: Optional[int] = None, to: Optional[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: Optional[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: Any, **kwargs: Any)[source]

Bases: marshmallow.

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

class Meta[source]

Bases: object

NonRevocationIntervalSchema metadata.

model_class

alias of aries_cloudagent.revocation.models.indy.NonRevocationInterval

fro
to

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: Optional[str] = None, state: Optional[str] = None, cred_ex_id: Optional[str] = None, rev_reg_id: Optional[str] = None, cred_rev_id: Optional[str] = None, cred_def_id: Optional[str] = None, cred_ex_version: Optional[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: Optional[str] = 'issuer_cred_rev'
RECORD_TYPE = 'issuer_cred_rev'
STATE_ISSUED = 'issued'
STATE_REVOKED = 'revoked'
TAG_NAMES = {'cred_def_id', 'cred_ex_id', 'cred_ex_version', 'cred_rev_id', 'rev_reg_id', 'state'}
VERSION_1 = '1'
VERSION_2 = '2'
async classmethod query_by_ids(session: aries_cloudagent.core.profile.ProfileSession, *, cred_def_id: Optional[str] = None, rev_reg_id: Optional[str] = None, state: Optional[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

property record_id: str

Accessor for the ID associated with this exchange.

async 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.

async classmethod retrieve_by_ids(session: aries_cloudagent.core.profile.ProfileSession, rev_reg_id: str, cred_rev_id: str, *, for_update: bool = False) aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord[source]

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

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

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

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

Bases: marshmallow.

Schema to allow de/serialization of credential revocation records.

class Meta[source]

Bases: object

IssuerCredRevRecordSchema metadata.

model_class

alias of aries_cloudagent.revocation.models.issuer_cred_rev_record.IssuerCredRevRecord

cred_def_id
cred_ex_id
cred_ex_version
cred_rev_id
record_id
rev_reg_id
state

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: Optional[str] = None, state: Optional[str] = None, cred_def_id: Optional[str] = None, error_msg: Optional[str] = None, issuer_did: Optional[str] = None, max_cred_num: Optional[int] = None, revoc_def_type: Optional[str] = None, revoc_reg_id: Optional[str] = None, revoc_reg_def: Optional[Union[aries_cloudagent.indy.models.revocation.IndyRevRegDef, Mapping]] = None, revoc_reg_entry: Optional[Union[aries_cloudagent.indy.models.revocation.IndyRevRegEntry, Mapping]] = None, tag: Optional[str] = None, tails_hash: Optional[str] = None, tails_local_path: Optional[str] = None, tails_public_uri: Optional[str] = None, pending_pub: Optional[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: Optional[str] = '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'}
async clear_pending(session: aries_cloudagent.core.profile.ProfileSession, cred_rev_ids: Optional[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

async fix_ledger_entry(profile: aries_cloudagent.core.profile.Profile, apply_ledger_update: bool, genesis_transactions: str) Tuple[dict, dict, dict][source]

Fix the ledger entry to match wallet-recorded credentials.

async 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.

property has_local_tails_file: bool

Check if a local copy of the tails file is available.

async 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

async classmethod query_by_cred_def_id(session: aries_cloudagent.core.profile.ProfileSession, cred_def_id: str, state: Optional[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

async 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

property record_id: str

Accessor for the record ID.

property record_value: Mapping

Accessor for JSON value properties of this revocation registry record.

async classmethod retrieve_by_revoc_reg_id(session: aries_cloudagent.core.profile.ProfileSession, revoc_reg_id: str, for_update: bool = False) 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

  • for_update – Retrieve for update

property revoc_reg_def: aries_cloudagent.indy.models.revocation.IndyRevRegDef

Accessor; get deserialized.

property revoc_reg_entry: aries_cloudagent.indy.models.revocation.IndyRevRegEntry

Accessor; get deserialized.

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

Send the revocation registry definition to the ledger.

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

Send a registry entry to the ledger.

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

Change the registry state (default full).

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

Update tails file’s publicly accessible URI.

async upload_tails_file(profile: aries_cloudagent.core.profile.Profile)[source]

Upload the local tails file to the tails server.

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

Bases: marshmallow.

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

class Meta[source]

Bases: object

IssuerRevRegRecordSchema metadata.

model_class

alias of aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord

cred_def_id
error_msg
issuer_did
max_cred_num
pending_pub
record_id
revoc_def_type
revoc_reg_def
revoc_reg_entry
revoc_reg_id
state
tag
tails_hash
tails_local_path
tails_public_uri

aries_cloudagent.revocation.models.revocation_registry module

Classes for managing a revocation registry.

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

Bases: object

Manage a revocation registry and tails file.

MAX_SIZE = 32768
MIN_SIZE = 4
property cred_def_id: str

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.

async 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.

property issuer_did: str

Accessor for the issuer DID.

property max_creds: int

Accessor for the maximum number of issued credentials.

property reg_def: dict

Accessor for the revocation registry definition.

property reg_def_type: str

Accessor for the revocation registry type.

property registry_id: str

Accessor for the revocation registry ID.

async retrieve_tails()[source]

Fetch the tails file from the public URI.

property tag: str

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

property tails_hash: str

Accessor for the tails file hash.

property tails_local_path: str

Accessor for the tails file local path.

property tails_public_uri: str

Accessor for the tails file public URI.