Skip to content

Commit

Permalink
Merge branch 'pstlouis/add-did-key-route' of github.com:OpSecId/aries…
Browse files Browse the repository at this point in the history
…-cloudagent-python into pstlouis/add-did-key-route
  • Loading branch information
PatStLouis committed Sep 16, 2024
2 parents 1f0ea9b + 66f0ab1 commit 3e9d329
Show file tree
Hide file tree
Showing 9 changed files with 44 additions and 49 deletions.
24 changes: 12 additions & 12 deletions aries_cloudagent/revocation_anoncreds/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@ async def revoke_credential(
f"No revocation registry record found for id: {rev_reg_id}"
)

if notify:
thread_id = thread_id or f"indy::{rev_reg_id}::{cred_rev_id}"
rev_notify_rec = RevNotificationRecord(
rev_reg_id=rev_reg_id,
cred_rev_id=cred_rev_id,
thread_id=thread_id,
connection_id=connection_id,
comment=comment,
version=notify_version,
)
async with self._profile.session() as session:
await rev_notify_rec.save(session, reason="New revocation notification")
if publish:
await revoc.get_or_fetch_local_tails_path(rev_reg_def)
result = await revoc.revoke_pending_credentials(
Expand All @@ -164,18 +176,6 @@ async def revoke_credential(

else:
await revoc.mark_pending_revocations(rev_reg_id, int(cred_rev_id))
if notify:
thread_id = thread_id or f"indy::{rev_reg_id}::{cred_rev_id}"
rev_notify_rec = RevNotificationRecord(
rev_reg_id=rev_reg_id,
cred_rev_id=cred_rev_id,
thread_id=thread_id,
connection_id=connection_id,
comment=comment,
version=notify_version,
)
async with self._profile.session() as session:
await rev_notify_rec.save(session, reason="New revocation notification")

async def update_rev_reg_revoked_state(
self,
Expand Down
46 changes: 23 additions & 23 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pyyaml="~6.0.2"
qrcode = {version = ">=6.1,<7.0", extras = ["pil"]}
requests="~2.32.3"
rlp="4.0.1"
unflatten="~0.1"
unflatten="~0.2"
sd-jwt = "^0.10.3"
did-peer-2 = "^0.1.2"
did-peer-4 = "^0.1.4"
Expand All @@ -64,7 +64,7 @@ didcomm-messaging = {version = "^0.1.1a0", optional = true }
[tool.poetry.group.dev.dependencies]
pre-commit = "~3.8.0"
# Sync with version in .pre-commit-config.yaml
ruff = "0.6.3"
ruff = "0.6.4"

sphinx="^5.3.0"
sphinx-rtd-theme=">=0.4.3"
Expand Down
4 changes: 2 additions & 2 deletions scenarios/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Every test example will have a docker-compose.yml file for all the agents and se
- From the scenarios directory.
- Make sure the local acapy image is up to date.
- `cd ..`
- `docker build -t acapy-test -f ../docker/Dockerfile.run .`
- `docker build -t acapy-test -f ./docker/Dockerfile.run .`
- `cd scenarios`
- Navigate to the base example. `cd examples/simple`
- `docker compose up`
Expand All @@ -19,7 +19,7 @@ To run all the tests with pytest:
- From the scenarios directory.
- Make sure the local acapy image is up to date.
- `cd ..`
- `docker build -t acapy-test -f ../docker/Dockerfile.run .`
- `docker build -t acapy-test -f ./docker/Dockerfile.run .`
- `cd scenarios`
- `poetry run pytest -m examples`
- TODO: easily run individual tests with pytest.
3 changes: 1 addition & 2 deletions scenarios/examples/connectionless/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ async def icv2():
"role": "ENDORSER",
},
) as resp:
if resp.ok:
return await resp.json()
assert resp.ok

await alice.post("/wallet/did/public", params=params(did=public_did.did))

Expand Down
3 changes: 1 addition & 2 deletions scenarios/examples/json_ld/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ async def main():
"role": "ENDORSER",
},
) as resp:
if resp.ok:
return await resp.json()
assert resp.ok

await alice.post(
"/wallet/did/public", params=params(did=public_did.did)
Expand Down
3 changes: 1 addition & 2 deletions scenarios/examples/multitenancy/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ async def main():
"role": "ENDORSER",
},
) as resp:
if resp.ok:
return await resp.json()
assert resp.ok

await alice.post("/wallet/did/public", params=params(did=public_did.did))
_, cred_def = await indy_anoncred_credential_artifacts(
Expand Down
3 changes: 1 addition & 2 deletions scenarios/examples/presenting_revoked_credential/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@ async def main():
"role": "ENDORSER",
},
) as resp:
if resp.ok:
return await resp.json()
assert resp.ok

await alice.post("/wallet/did/public", params=params(did=public_did.did))
schema, cred_def = await indy_anoncred_credential_artifacts(
Expand Down
3 changes: 1 addition & 2 deletions scenarios/examples/self_attested/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ async def main():
"role": "ENDORSER",
},
) as resp:
if resp.ok:
return await resp.json()
assert resp.ok

await alice.post("/wallet/did/public", params=params(did=public_did.did))
schema, cred_def = await indy_anoncred_credential_artifacts(
Expand Down

0 comments on commit 3e9d329

Please sign in to comment.