-
Notifications
You must be signed in to change notification settings - Fork 521
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
Additional endpoints to get revocation details and fix "published" status #1783
Additional endpoints to get revocation details and fix "published" status #1783
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1783 +/- ##
==========================================
- Coverage 94.11% 93.76% -0.36%
==========================================
Files 533 534 +1
Lines 33640 33829 +189
==========================================
+ Hits 31661 31719 +58
- Misses 1979 2110 +131 |
Signed-off-by: Ian Costanzo <[email protected]>
Signed-off-by: Ian Costanzo <[email protected]>
LOGGER.info( | ||
">>> pre-pending -endian character to TAA acceptance text" | ||
) | ||
accept_input["text"] = "\ufeff" + accept_input["text"] |
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 ran into this issue specifically on the Sovrin builder net, not sure if it would happen on the other networks.
This function can be used if there were previous revocation errors (i.e. the | ||
credential revocation was successfully written to the wallet but the ledger write | ||
failed.) | ||
""" |
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 tried to keep this script relatively self-contained (no dependencies on other aca-py code) to make it easier to port if anyone else needs to do this (any other agents), I expect the revocation corruption problem will be fairly common.
|
||
@T003-TAA @taa_required | ||
Scenario Outline: Fail to publish revoked credential using a ledger with TAA required, and fix the ledger | ||
Given we have "2" agents |
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 is the scenario that we ran into with LSBC - a failed ledger transaction corrupted the revocation registry and caused future revocations to fail. The "posts a correction to the ledger" step invokes the new aca-py endpoint to fix the ledger.
Signed-off-by: Ian Costanzo <[email protected]>
) | ||
await issuer_cr_rec.set_state( | ||
txn, IssuerCredRevRecord.STATE_REVOKED | ||
) |
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.
Moved this code per @andrewwhitehead comment
aries_cloudagent/ledger/routes.py
Outdated
async with ledger: | ||
try: | ||
taa_info = await ledger.get_txn_author_agreement() | ||
if not taa_info["taa_required"]: | ||
raise web.HTTPBadRequest( | ||
reason=f"Ledger {ledger.pool_name} TAA not available" | ||
) | ||
LOGGER.info(f"TAA on ledger: {taa_info}") |
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.
LOGGER.info(f"TAA on ledger: {taa_info}") | |
LOGGER.info("TAA on ledger: %r", taa_info) |
|
||
LOGGER.debug(">>> apply_ledger_update = %s", apply_ledger_update) | ||
if apply_ledger_update: | ||
ledger = session.inject(BaseLedger) |
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 think this needs to be inject_or if you want to handle a missing ledger
async def fetch_txns(genesis_txns, registry_id): | ||
"""Fetch tails file and revocation registry information.""" | ||
|
||
vdr_module = importlib.import_module("indy_vdr") |
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.
Maybe we can handle an import error here if the dependencies are missing?
Signed-off-by: Ian Costanzo <[email protected]>
Signed-off-by: Ian Costanzo <[email protected]>
Signed-off-by: Ian Costanzo [email protected]
This PR is good to go:
--taa-accept
to enforce TAA acceptance when required