-
Notifications
You must be signed in to change notification settings - Fork 26
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: app child key derived from wallet master key #736
Merged
Merged
Changes from all commits
Commits
Show all changes
55 commits
Select commit
Hold shift + click to select a range
83de003
feat(appwalletKey): add GetBIP32ChildKey
frnandu 546322c
feat: fix interface
frnandu 8cbe566
feat: adding subscription WiP
frnandu 853beed
feat: handle nostr subscriptions for lifecycle of apps
frnandu 8cb135d
Delete .idea/.gitignore
frnandu 616a69b
Delete .idea/hub.iml
frnandu 55113ce
Delete .idea/modules.xml
frnandu 78c2faa
Delete .idea/vcs.xml
frnandu e7ae82c
fix: remove unnecessary
frnandu dc404dd
fix: missing handling legacy app
frnandu b145c41
fix: review fixes
frnandu 23b35c8
fix: use app.ID for key calculation instead of passing in event
frnandu b64c8cf
fix: add TODO
frnandu d0b0354
fix: remove unnecessary check
frnandu 0c5949c
fix: improve err handling and remove check
frnandu 324f113
Merge remote-tracking branch 'origin/master' into feat/wallet-child-k…
rolznz b4d1f3e
chore: store master nostr key to avoid deriving each time
rolznz a1dc936
chore: rename app nostr_pubkey to app_pubkey, extract app consumers i…
rolznz bedc82d
chore: finish renaming
rolznz 200c172
fix: update app wallet pubkey on app creation
rolznz aef3142
fix: not NULL check
rolznz 96a71bc
fix: fix HandleEvent
frnandu b359339
fix: error handling
frnandu aa2c3c1
fix: error handling
frnandu 9f69b1a
fix: move StartSubscription to start.go
frnandu 0d61bb2
fix: remove duplicated error check
frnandu b530632
fix: make tests use AppsService for creating apps
frnandu d4c6a60
chore: remove unused code
rolznz 63c3fd9
chore: minor event handler improvements
rolznz 1d79b8a
fix: add event_handler tests for legacy app
frnandu 55d9515
chore: add comment about legacy apps in deleteAppConsumer
rolznz b1bcc58
Merge branch 'feat/wallet-child-key-per-connection' of github.com:get…
rolznz c56d1d1
fix: remove unused app from tests
rolznz bc923eb
fix: error handling in startAppWalletSubscription
rolznz 606fb32
fix: only create event info and nostr subscription for master key if …
frnandu 932a9fb
fix: add legacy tests
frnandu 17c9c0b
fix: move fetching of Nip47 event info to deleteAppConsumer
frnandu 8127fea
fix: fixed arguments
frnandu 7cff2a7
fix: use require instead of assert
frnandu 339d420
Merge branch 'master' into feat/wallet-child-key-per-connection
frnandu 606c33b
fix: adapt GetAppWalletKey to use DeriveKey with path 1'
frnandu 877509e
fix: for backends that don't use a mnemonic, create appKey from nostr…
frnandu c47d923
fix: cleanup eventPublisher Subscribers when relay reconnects
frnandu 7bfd140
fix: bip32.FirstHardenedChild + appID
frnandu ce4c5cf
fix: remove unused env vars
frnandu 8c1ef4b
fix: generate new mnemonic if empty
frnandu aea59f0
fix: add tests.CreateTestServiceWithMnemonic to fix TestEncryptedBackup
frnandu 78f59bc
fix: handle both relay and main ctx Done
frnandu b322f4c
Merge branch 'master' into feat/wallet-child-key-per-connection
rolznz b4bf53f
chore: add keys tests
rolznz caed3b3
chore: add extra assertions to keys test
rolznz 2b14d3c
chore: log when legacy app subscription is created
rolznz dc54213
chore: remove unnecessary break
rolznz 0be7e32
chore: add log when relay is successfully connected
rolznz 287607d
fix: only auto-start node if it has been started before
rolznz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package migrations | ||
|
||
import ( | ||
_ "embed" | ||
|
||
"github.com/go-gormigrate/gormigrate/v2" | ||
"gorm.io/gorm" | ||
) | ||
|
||
var _202410141503_add_wallet_pubkey = &gormigrate.Migration{ | ||
ID: "202410141503_add_wallet_pubkey", | ||
Migrate: func(tx *gorm.DB) error { | ||
|
||
if err := tx.Exec(` | ||
ALTER TABLE apps ADD COLUMN wallet_pubkey TEXT; | ||
ALTER TABLE apps RENAME COLUMN nostr_pubkey TO app_pubkey; | ||
`).Error; err != nil { | ||
return err | ||
} | ||
|
||
return nil | ||
}, | ||
Rollback: func(tx *gorm.DB) error { | ||
return nil | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow-up issue: The
expiresAt
,scopes
checks above are to be shifted toCreateApp
method inapps_service
andUpdateApp
,GetApp
,ListApps
,TopupIsolatedApp
methods need to be added there. I think we can alsoGetAppByPubkey
directly in those methods so we don't have to call it separately inhttp_service
andwails_service
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@im-adithya could you create an issue and link some code?