-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic support for credential revocation and revocation registry handling #306
Basic support for credential revocation and revocation registry handling #306
Conversation
andrewwhitehead
commented
Dec 13, 2019
- Adds RevocationRegistry class for interfacing with local and external revocation registries
- Adds IssuerRevocationRecord for tracking revocation registry generation and issuance
- Adds an admin route for generating a new registry against a credential definition
- Adds parameters to credential-definition and issue-credential routes for supporting revocation
This pull request introduces 1 alert when merging c3c1010 into 6d42d1e - view on LGTM.com new alerts:
|
Codecov Report
@@ Coverage Diff @@
## master #306 +/- ##
=========================================
Coverage ? 86.85%
=========================================
Files ? 243
Lines ? 11874
Branches ? 0
=========================================
Hits ? 10313
Misses ? 1561
Partials ? 0 |
This pull request introduces 1 alert when merging a5bfd36 into 6d42d1e - view on LGTM.com new alerts:
|
Remaining work:
|
**INDY_SCHEMA_ID | ||
schema_id = fields.Str(description="Schema identifier", **INDY_SCHEMA_ID) | ||
support_revocation = fields.Boolean( | ||
required=False, description="Revocation supported flag" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default=False is implicit here by the way the code gets the value, but setting it explicitly could be useful here for clarity of intent?
required=True, | ||
description="List of schema attributes" | ||
description="List of schema attributes", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma consistency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an annoying issue with the Black autoformatter, it will insert the trailing comma when a call spans multiple lines, but doesn't remove it when it later shortens it to one line.
description="attribute name", | ||
example="score", | ||
), | ||
fields.Str(description="attribute name", example="score",), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma consistency
description="Schema name", | ||
example="prefs", | ||
) | ||
schema_name = fields.Str(required=True, description="Schema name", example="prefs",) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma consistency
description="Attribute name", | ||
example="score", | ||
), | ||
fields.Str(description="Attribute name", example="score",), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comma consistency
"schema": {"type": "string"}, | ||
"required": False, | ||
} for p in SCHEMA_TAGS | ||
{"name": p, "in": "query", "schema": {"type": "string"}, "required": False} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me this looks way less clear than the one on the left. My impression only.
@@ -142,7 +154,7 @@ def context(self) -> InjectionContext: | |||
schema_name=schema_name, | |||
schema_version=schema_version, | |||
cred_def_id=cred_def_id, | |||
issuer_did=issuer_did | |||
issuer_did=issuer_did, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate to harp on comma consistency so I'll stop here.
9302af9
to
3f63113
Compare
This pull request introduces 1 alert when merging 3f63113 into 9e30014 - view on LGTM.com new alerts:
|
This pull request introduces 2 alerts when merging 26c8228 into 0b3cdc0 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 705c463 into 0b3cdc0 - view on LGTM.com new alerts:
|
log_msg(f"Revocation Registry ID: {revocation_registry_id}") | ||
assert tails_hash == my_tails_hash | ||
|
||
# Real app should publish tail file somewhere and update the revocation registry with the URI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tails
except RevocationNotSupportedError as e: | ||
raise web.HTTPBadRequest(reason=e.message) from e | ||
await shield( | ||
registry_record.generate_registry(context, RevocationRegistry.get_temp_dir()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This operation can take minutes - consider a background process that generates the revocation registry ahead of time, with tag increment.
Alternatively, the non-secrets API could hold a work queue.
…n-revoked proof Signed-off-by: Pengyu Chen <[email protected]>
…f is not valid. Signed-off-by: Pengyu Chen <[email protected]>
Signed-off-by: Pengyu Chen <[email protected]>
Signed-off-by: Pengyu Chen <[email protected]>
Signed-off-by: Pengyu Chen <[email protected]>
Signed-off-by: Pengyu Chen <[email protected]>
The revocation part in performance demo is disabled because the revocation registry won't be found immediately after they are registered. Signed-off-by: Pengyu Chen <[email protected]>
Signed-off-by: Pengyu Chen <[email protected]>
Changed the faber demo to add another revocation registry when it is full. Signed-off-by: Pengyu Chen <[email protected]>
- Select latest credential when making proof - Add an option to add revocation registry - Catch error when issuing credential Signed-off-by: Pengyu Chen <[email protected]>
Signed-off-by: Pengyu Chen <[email protected]>
Signed-off-by: Andrew Whitehead <[email protected]>
Signed-off-by: Andrew Whitehead <[email protected]>
Signed-off-by: Andrew Whitehead <[email protected]>
a5c6cd2
to
75fd1be
Compare
This pull request introduces 1 alert when merging 75fd1be into 26f7107 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 4522cee into 3c719eb - view on LGTM.com new alerts:
|
Signed-off-by: Andrew Whitehead <[email protected]>
This pull request introduces 1 alert when merging 3b95740 into 3c719eb - view on LGTM.com new alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!