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

feat(did creation route): reject unregistered did methods #2262

Conversation

chumbert
Copy link
Contributor

@chumbert chumbert commented Jun 9, 2023

Change a small oversight in did creation admin route:

  • Missing method parameter will default to sov
  • Unknown (ie: not registed in DIDMethods) methods will be rejected

@chumbert chumbert force-pushed the feature/reject-unknown-did-methods branch from 54b25da to ac5c4de Compare June 9, 2023 10:42
@swcurran
Copy link
Contributor

swcurran commented Jun 9, 2023

This needs an update of the base-branch, please.

A question from a dummy looking at the code. It looks like the list of acceptable methods is kind of hard-coded (e.g. "SOV" in the code). Is there somewhere (that I'm missing) where there are other permitted methods, and a way to add more? Or is that not important in this context?

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@chumbert
Copy link
Contributor Author

A question from a dummy looking at the code. It looks like the list of acceptable methods is kind of hard-coded (e.g. "SOV" in the code). Is there somewhere (that I'm missing) where there are other permitted methods, and a way to add more? Or is that not important in this context?

A very good question. Within ACA-Py the methods are hardcoded and are SOV and KEY.

However, ACA-Py provides DIDMethods, a registry of supported DID methods. Plugins can use this registry to register additional methods.

With this PR, the did creation endpoint checks the request method against the content of DIDMethods and rejects unknown methods. Without this PR, the endpoint would default any unknown method to SOV.

@swcurran swcurran merged commit 7c15f1d into openwallet-foundation:main Jun 10, 2023
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 this pull request may close these issues.

3 participants