Let users add a verified nostr pubkey to their account #101
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "feature/98-nostr_nip05"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a settings page (for experimental settings) that can verify and save nostr pubkeys for user accounts. It currently only allows adding keys from a browser extension, but not from manual signing outside of the browser.
This can then be used for:
Note: tagged WIP, because without any of the above-mentioned features, this is currently not useful to anyone. Adding the NIP-05 endpoint is the first and easiest feature to base on top of this now.
Update: NIP-05 support has been added in the meantime, see comments and commits.
closes #98
@ -49,2 +49,4 @@
gem 'sidekiq-scheduler'
# Services
gem 'nostr', git: 'https://gitea.kosmos.org/kosmos/nostr-gem.git', branch: 'feature/ruby_2.7_compat'
adds quite some dependencies (like the websocket stuff) but I guess it's fine here as it is not conflicting with any dependencies that we already have.
Yeah, the idea is that we can very easily add more nostr features using the same library.
@ -30,3 +30,2 @@
scope :confirmed, -> { where.not(confirmed_at: nil) }
scope :pending, -> { where(confirmed_at: nil) }
validates_uniqueness_of :nostr_pubkey, scope: :ou, allow_blank: true
why the
scope :ou
?It was supposed to be so that you can add the same key for accounts with different domains, but actually now that you mention it, I think it should always be unique, since you can only point back to one of them anyway.
@ -33,0 +32,4 @@
scope :confirmed, -> { where.not(confirmed_at: nil) }
scope :pending, -> { where(confirmed_at: nil) }
scope :all_except, -> (user) { where.not(id: user) }
does this need
where.not(id: user.id)
?It's magic. ;)
wondering if any other nip05 provider implements this that well currently
Thanks. I was wondering the same. :)
I addressed your comments and resolved the one about the uniqueness validation.
WIP: Let users add a verified nostr pubkey to their accountto Let users add a verified nostr pubkey to their accountThis is now ready to merge. I have adjusted all the code to the refactored user settings routes and controller, as well as resolved the other merge conflicts.
Also, NIP-05 support was added a few weeks ago, so it's actually useful now. And I also just added a hint for users to update their public profile with the address, which is visible when a pubkey has been added.
caeb13974c
tobfc0969829