Skip to content

Feat: NWA auth for self-hosted hubs#1016

Merged
rolznz merged 32 commits intomasterfrom
feat/nwa
Feb 27, 2025
Merged

Feat: NWA auth for self-hosted hubs#1016
rolznz merged 32 commits intomasterfrom
feat/nwa

Conversation

@rolznz
Copy link
Copy Markdown
Contributor

@rolznz rolznz commented Jan 20, 2025

Closes #328 #1107

TODOs:

  • budget might still make sense if you have superuser access (new apps can be created to bypass the permission) - but users need to understand that other apps can be created with larger budgets, circumventing it. - If someone installs a malicious version of Alby Go it could drain a user's funds.
  • Limit superuser scope to Alby Go for now
  • TODOs in feat: nwc create_connection command (WIP) #907
  • Instead of adding the create connection method to the normal create connection UI, make Alby Go a custom detail page
  • Use standard NWC info event instead of new NWA event
  • Ensure superuser permission cannot be included as part of standard deeplink flow and NWA flow - an attacker could take advantage of this - how do we explicitly limit it to Alby Go?
  • User needs to be very clearly warned to be careful with this connection secret and not put them in other apps
  • create_connection: no spec for now
  • Alby detail page: give a default budget of 100K sats, editable after the connection is created
  • Remove "superuser" from standard connection card
  • Remove "superuser" text from permissions on view app connection page
  • Replace checkbox with "One tap connections" card and copy
  • NWA changes in JS SDK for testing - feat: NWA js-sdk#298
  • confirm way of passing lud16 as tag info event (but lightning addresses in profile metadata are leaked anyway in nostr and it's generally considered public info? the Alby relay does not allow crawling info events but this will not apply to other relays.)

Next steps:

Notes for spec later:

  • p tag added to NWC info event
  • lud16 field added to get_info
  • NWA:
    • no new NWA event - app subscribes to info event by p tag (same style as command responses - + no relay changes necessary)
    • no NWA secret
    • parameter changes: naming kept consistent with http flow

- adjust button copy
- make create_connection methods consistent with http deeplink flow
- remove unused constant
- add empty string check before adding lud16 tag
- fix test
@rolznz rolznz marked this pull request as ready for review February 24, 2025 16:51
@rolznz rolznz mentioned this pull request Feb 25, 2025
1 task
Copy link
Copy Markdown
Member

@im-adithya im-adithya left a comment

Choose a reason for hiding this comment

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

tACK 🎉

@rolznz rolznz merged commit 3e1d16d into master Feb 27, 2025
10 of 11 checks passed
@rolznz rolznz deleted the feat/nwa branch February 27, 2025 12:12
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.

Design new 1-click App Connection flow that works on all environments

2 participants