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:store additional data with permissions #3035

Closed
wants to merge 1 commit into from

Conversation

pavanjoshi914
Copy link
Contributor

Describe the changes you have made in this PR

prototype to store nostr permssions in db.

looking over the designs and code i think we don't need to add additional data in the db for permissions and we can achieve it without such changes. as such changes will also need migrations.

  1. we declare our permsision types in such enum, we can just add new permissions and change names of permssions according to which we want to display it in site preferences dialogue
export enum PermissionMethodNostr {
  NOSTR_SIGNMESSAGE = "nostr/signMessage",
  NOSTR_SIGNSCHNORR = "nostr/signSchnorr",
  // this can be nostr login
  NOSTR_GETPUBLICKEY = "nostr/getPublicKey",
  NOSTR_NIP04DECRYPT = "nostr/nip04decrypt",
  NOSTR_NIP04ENCRYPT = "nostr/nip04encrypt",
}

  1. we store enabled property to true when we add permissions and set it to false when we revoke permissions so we don't need to store allow and deny as well we can use this variable and just change ui to use buttons which to allow or revoke a permissions

  2. type definitions: type definitions are incomplete for event kinds we need to add type definitions

From the above explanation, i think we can achieve permission management without storing additional metadata. wdyt @reneaaron

@pavanjoshi914 pavanjoshi914 marked this pull request as draft February 11, 2024 10:17
@reneaaron
Copy link
Contributor

Closing in favor of #3054

@reneaaron reneaaron closed this Feb 22, 2024
@pavanjoshi914 pavanjoshi914 deleted the nostr-permissions branch February 23, 2024 09:36
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.

2 participants