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: allow multiple keys per wallet address #1122

Merged
merged 5 commits into from
Feb 21, 2024
Merged

Conversation

dragosp1011
Copy link
Contributor

@dragosp1011 dragosp1011 commented Feb 9, 2024

Context

Changes

  • moved wallet address keys in a separate table
  • added endpoint to upload JWK
  • added endpoint to update key name
  • added endpoint to list keys for an wallet addres

@github-actions github-actions bot added package: wallet/backend Wallet backend implementations type: source Source changes labels Feb 9, 2024
@github-actions github-actions bot added the type: test Improvements or additions to tests label Feb 9, 2024
@dragosp1011 dragosp1011 marked this pull request as ready for review February 9, 2024 12:39
Comment on lines +71 to +73
const publicKeyPEM = publicKey
.export({ type: 'spki', format: 'pem' })
.toString()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason for not storing the JWK directly?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this was the format that we kept the public key before, kept it for the uploaded keys as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also regarding this, do we need to store the public key at all in our db?
does not look like we do anything with it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this moment, we allow the users to visualize the public key in the Developer Keys section.

Copy link
Member

@beniaminmunteanu beniaminmunteanu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Only suggestion i would have is that the getAccounts method receives both include params as an object.
But since it's just 2 optional "includes", I'm fine with it like this as well.

@dragosp1011 dragosp1011 merged commit a10d9b9 into main Feb 21, 2024
10 checks passed
@dragosp1011 dragosp1011 deleted the dev-keys-improvements branch February 21, 2024 12:57
devcer pushed a commit to devcer/testnet that referenced this pull request Mar 13, 2024
* feat: allow multiple keys per wallet address

* test: remove revoke/register tests

* feat: rename name to nickname

* feat: include wallet keys in response

* fix: update revoke key endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: wallet/backend Wallet backend implementations type: source Source changes type: test Improvements or additions to tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Developer Keys improvement
4 participants