Skip to content
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

Keria fails to return registry by aid and name when multiple registries created with same name in agent #190

Closed
lenkan opened this issue Feb 9, 2024 · 0 comments · Fixed by #195

Comments

@lenkan
Copy link
Collaborator

lenkan commented Feb 9, 2024

This happens when there are two AIDs in a wallet and each of them have their own registry with the same name.

Steps to reproduce:

  1. Create keria agent
  2. Create identifier aid1
  3. Create new registry named registry for aid aid1
  4. Create identifier aid2.
  5. Create new registry also named registry, but for aid aid2.
  6. Do GET /identifiers/aid2/registries/registry

Expected result

Keria returns the registry created for aid aid2.

Actual result

Keria returns HTTP GET /identifiers/aid2/registries/registry - 404 Not Found - {"title": "404 Not Found", "description": "registry is not a valid registry for AID aid2"}.

Notes

See implementation:

registry = agent.rgy.registryByName(registryName)
if registry is None:
raise falcon.HTTPNotFound(description=f"{registryName} is not a valid reference to a credential registry")
if not registry.hab.pre == hab.pre:
raise falcon.HTTPNotFound(description=f"{registryName} is not a valid registry for AID {name}")

I assume this only finds the first registry with the given name in the agent. So it returns the registry created for aid1 instead of the one created for aid2.

I have verified that both registries do exists and they are returned by the list endpoints for aid1 and aid2 respectively.

See reproduction script in signify-ts here: https://github.com/lenkan/signify-ts/blob/252ec4dd17f5aaf2e2299610f4f17bcb5c71dfcf/examples/integration-scripts/registry.test.ts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant