aries_cloudagent.revocation package¶
Subpackages¶
Submodules¶
aries_cloudagent.revocation.error module¶
Revocation error classes.
-
exception
aries_cloudagent.revocation.error.RevocationError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseErrorBase exception for revocation-related errors.
-
exception
aries_cloudagent.revocation.error.RevocationNotSupportedError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.revocation.error.RevocationErrorAttempted to perform revocation-related operation where inapplicable.
-
exception
aries_cloudagent.revocation.error.RevocationRegistryBadSizeError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.revocation.error.RevocationErrorAttempted to create registry with maximum credentials too large or too small.
aries_cloudagent.revocation.indy module¶
Indy revocation registry management.
-
class
aries_cloudagent.revocation.indy.IndyRevocation(profile: aries_cloudagent.core.profile.Profile)[source]¶ Bases:
objectClass for managing Indy credential revocation.
-
REV_REG_CACHE= {}¶
-
get_active_issuer_rev_reg_record(cred_def_id: str) → aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord[source]¶ Return current active registry for issuing a given credential definition.
Parameters: cred_def_id – ID of the base credential definition
-
get_issuer_rev_reg_record(revoc_reg_id: str) → aries_cloudagent.revocation.models.issuer_rev_reg_record.IssuerRevRegRecord[source]¶ Return a revocation registry record by identifier.
Parameters: revoc_reg_id – ID of the revocation registry
-
get_ledger_registry(revoc_reg_id: str) → aries_cloudagent.revocation.models.revocation_registry.RevocationRegistry[source]¶ Get a revocation registry from the ledger, fetching as necessary.
-
aries_cloudagent.revocation.manager module¶
Classes to manage credential revocation.
-
class
aries_cloudagent.revocation.manager.RevocationManager(profile: aries_cloudagent.core.profile.Profile)[source]¶ Bases:
objectClass for managing revocation operations.
-
clear_pending_revocations(purge: Mapping[str, Sequence[str]] = None) → Mapping[str, Sequence[str]][source]¶ Clear pending revocation publications.
Parameters: purge – Mapping from revocation registry identifiers to all credential revocation identifiers within each to clear. Specify null/empty map for all revocation registries. Specify empty sequence per revocation registry identifier for all pending within the revocation registry; e.g.,
{} - clear all pending revocations from all revocation registries
- {
- “R17v42T4pk…:4:R17v42T4pk…:3:CL:19:tag:CL_ACCUM:0”: [], “R17v42T4pk…:4:R17v42T4pk…:3:CL:19:tag:CL_ACCUM:1”: [“1”, “2”]
- } - clear
- all pending revocations from all revocation registry tagged 0
- pending [“1”, “2”] from revocation registry tagged 1
- no pending revocations from any other revocation registries.
Returns: mapping from revocation registry id to its remaining cred rev ids still marked pending, omitting revocation registries with no remaining pending publications.
-
publish_pending_revocations(rrid2crid: Mapping[str, Sequence[str]] = None) → Mapping[str, Sequence[str]][source]¶ Publish pending revocations to the ledger.
Parameters: rrid2crid – Mapping from revocation registry identifiers to all credential revocation identifiers within each to publish. Specify null/empty map for all revocation registries. Specify empty sequence per revocation registry identifier for all pending within the revocation registry; e.g.,
{} - publish all pending revocations from all revocation registries
- {
- “R17v42T4pk…:4:R17v42T4pk…:3:CL:19:tag:CL_ACCUM:0”: [], “R17v42T4pk…:4:R17v42T4pk…:3:CL:19:tag:CL_ACCUM:1”: [“1”, “2”]
- } - publish:
- all pending revocations from all revocation registry tagged 0
- pending [“1”, “2”] from revocation registry tagged 1
- no pending revocations from any other revocation registries.
Returns: mapping from each revocation registry id to its cred rev ids published.
-
revoke_credential(rev_reg_id: str, cred_rev_id: str, publish: bool = False)[source]¶ Revoke a credential.
Optionally, publish the corresponding revocation registry delta to the ledger.
Parameters: - rev_reg_id – revocation registry id
- cred_rev_id – credential revocation id
- publish – whether to publish the resulting revocation registry delta, along with any revocations pending against it
-
revoke_credential_by_cred_ex_id(cred_ex_id: str, publish: bool = False)[source]¶ Revoke a credential by its credential exchange identifier at issue.
Optionally, publish the corresponding revocation registry delta to the ledger.
Parameters: - cred_ex_id – credential exchange identifier
- publish – whether to publish the resulting revocation registry delta, along with any revocations pending against it
-
-
exception
aries_cloudagent.revocation.manager.RevocationManagerError(*args, error_code: str = None, **kwargs)[source]¶ Bases:
aries_cloudagent.core.error.BaseErrorRevocation manager error.
aries_cloudagent.revocation.routes module¶
Revocation registry admin routes.
-
class
aries_cloudagent.revocation.routes.ClearPendingRevocationsRequestSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaRequest schema for clear pending revocations API call.
-
purge= <fields.Dict(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 mapping type.'})>¶
-
-
class
aries_cloudagent.revocation.routes.CredDefIdMatchInfoSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaPath parameters and validators for request taking cred def id.
-
cred_def_id= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyCredDefId object>, required=True, 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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.CredExIdMatchInfoSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaPath parameters and validators for request taking credential exchange id.
-
cred_ex_id= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour object>, required=True, 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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.CredRevRecordQueryStringSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaParameters and validators for credential revocation record request.
-
cred_ex_id= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.UUIDFour 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_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.'})>¶
-
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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.CredRevRecordResultSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaResult schema for credential revocation record request.
-
result¶ Schema to allow de/serialization of credential revocation records.
-
-
class
aries_cloudagent.revocation.routes.PublishRevocationsSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaRequest and result schema for revocation publication API call.
-
rrid2crid= <fields.Dict(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 mapping type.'})>¶
-
-
class
aries_cloudagent.revocation.routes.RevRegCreateRequestSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaRequest schema for revocation registry creation request.
-
credential_definition_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.'})>¶
-
max_cred_num= <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegSize 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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.RevRegIdMatchInfoSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaPath parameters and validators for request taking rev reg id.
-
rev_reg_id= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.IndyRevRegId object>, required=True, 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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.RevRegIssuedResultSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaResult schema for revocation registry credentials issued request.
-
result= <fields.Integer(default=<marshmallow.missing>, attribute=None, validate=<aries_cloudagent.messaging.valid.WholeNumber 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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.RevRegResultSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaResult schema for revocation registry creation request.
-
result¶ Schema to allow serialization/deserialization of issuer rev reg records.
-
-
class
aries_cloudagent.revocation.routes.RevRegUpdateTailsFileUriSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaRequest schema for updating tails file URI.
-
tails_public_uri= <fields.Url(default=<marshmallow.missing>, attribute=None, validate=None, required=True, 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 URL.', 'invalid_utf8': 'Not a valid utf-8 string.'})>¶
-
-
class
aries_cloudagent.revocation.routes.RevRegsCreatedQueryStringSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaQuery string parameters and validators for rev regs created request.
-
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.'})>¶
-
state= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['init', 'generated', 'posted', 'active', 'full'], 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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.RevRegsCreatedSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaResult schema for request for revocation registries created.
-
rev_reg_ids= <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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.RevocationModuleResponseSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaResponse schema for Revocation Module.
-
class
aries_cloudagent.revocation.routes.RevokeRequestSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.revocation.routes.CredRevRecordQueryStringSchemaParameters and validators for revocation request.
-
publish= <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.'})>¶
-
-
class
aries_cloudagent.revocation.routes.SetRevRegStateQueryStringSchema(*args, **kwargs)[source]¶ Bases:
aries_cloudagent.messaging.models.openapi.OpenAPISchemaQuery string parameters and validators for request to set rev reg state.
-
state= <fields.String(default=<marshmallow.missing>, attribute=None, validate=<OneOf(choices=['init', 'generated', 'posted', 'active', 'full'], labels=[], error='Must be one of: {choices}.')>, required=True, 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.routes.clear_pending_revocations(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler for clearing pending revocations.
Parameters: request – aiohttp request object Returns: Credential revocation ids still pending revocation by revocation registry id.
-
aries_cloudagent.revocation.routes.create_rev_reg(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to create a new revocation registry.
Parameters: request – aiohttp request object Returns: The issuer revocation registry record
-
aries_cloudagent.revocation.routes.get_active_rev_reg(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to get current active revocation registry by cred def id.
Parameters: request – aiohttp request object Returns: The revocation registry identifier
-
aries_cloudagent.revocation.routes.get_cred_rev_record(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to get credential revocation record.
Parameters: request – aiohttp request object Returns: The issuer credential revocation record
-
aries_cloudagent.revocation.routes.get_rev_reg(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to get a revocation registry by rev reg id.
Parameters: request – aiohttp request object Returns: The revocation registry
-
aries_cloudagent.revocation.routes.get_rev_reg_issued(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to get number of credentials issued against revocation registry.
Parameters: request – aiohttp request object Returns: Number of credentials issued against revocation registry
-
aries_cloudagent.revocation.routes.get_tails_file(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>) → <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>[source]¶ Request handler to download tails file for revocation registry.
Parameters: request – aiohttp request object Returns: The tails file in FileResponse
-
aries_cloudagent.revocation.routes.post_process_routes(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Amend swagger API.
-
aries_cloudagent.revocation.routes.publish_revocations(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler for publishing pending revocations to the ledger.
Parameters: request – aiohttp request object Returns: Credential revocation ids published as revoked by revocation registry id.
-
aries_cloudagent.revocation.routes.register(app: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Register routes.
-
aries_cloudagent.revocation.routes.rev_regs_created(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to get revocation registries that current agent created.
Parameters: request – aiohttp request object Returns: List of identifiers of matching revocation registries.
-
aries_cloudagent.revocation.routes.revoke(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler for storing a credential request.
Parameters: request – aiohttp request object Returns: The credential request details.
-
aries_cloudagent.revocation.routes.send_rev_reg_def(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to send revocation registry definition by reg reg id to ledger.
Parameters: request – aiohttp request object Returns: The issuer revocation registry record
-
aries_cloudagent.revocation.routes.send_rev_reg_entry(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to send rev reg entry by registry id to ledger.
Parameters: request – aiohttp request object Returns: The revocation registry record
-
aries_cloudagent.revocation.routes.set_rev_reg_state(request: <sphinx.ext.autodoc.importer._MockObject object at 0x7f760d85a810>)[source]¶ Request handler to set a revocation registry state manually.
Parameters: request – aiohttp request object Returns: The revocation registry record, updated