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: generate keys when extension is installed #93

Merged
merged 3 commits into from
Feb 21, 2024

Conversation

raducristianpopa
Copy link
Member

Context

Closes #92.

Changes proposed in this pull request

Whenever the extension is installed, the key pair is generated, alongside a key ID:

  • public key is stored as a base64 encoded JWK
  • private key is stored as hex
  • key id is stored as a string (UUID v4)

@github-actions github-actions bot added the area: background Improvements or additions to extension background script label Feb 12, 2024
@raducristianpopa
Copy link
Member Author

raducristianpopa commented Feb 12, 2024

Extension builds preview

Name Link
Latest commit e5a4ed5
Latest job logs Run #7984848542
BadgeDownload
BadgeDownload
BadgeDownload
BadgeDownload

src/utils/crypto.ts Outdated Show resolved Hide resolved
src/utils/crypto.ts Show resolved Hide resolved
@raducristianpopa raducristianpopa marked this pull request as ready for review February 12, 2024 06:00
dianafulga
dianafulga previously approved these changes Feb 20, 2024
@@ -53,6 +55,33 @@ class Background {
unsubscribeFromMessages() {
this.subscriptions.forEach((sub: any) => sub())
}

private async keyExists(): Promise<boolean> {
Copy link
Contributor

Choose a reason for hiding this comment

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

there is no reason for this method to be here, it's independent of the background class. Maybe a better place would be the storage wrapper to access different variables in there

Copy link
Member Author

Choose a reason for hiding this comment

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

Currently, there isn't a storage wrapper available. Once the storage wrapper is implemented, transferring it there will be straightforward. I'll add a comment.

src/background/container.ts Outdated Show resolved Hide resolved
src/utils/crypto.ts Outdated Show resolved Hide resolved
src/utils/crypto.ts Show resolved Hide resolved
@raducristianpopa raducristianpopa merged commit 4025f6b into main Feb 21, 2024
9 checks passed
@raducristianpopa raducristianpopa deleted the rp--generate-keys branch February 21, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: background Improvements or additions to extension background script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate key pair when the extension is installed
3 participants