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

Allow probing for permissions #26

Open
Giszmo opened this issue Dec 8, 2023 · 6 comments
Open

Allow probing for permissions #26

Giszmo opened this issue Dec 8, 2023 · 6 comments

Comments

@Giszmo
Copy link

Giszmo commented Dec 8, 2023

noStrudel does not decrypt messages automatically because its author prefers to not give the extension permanent decrypt permission. As most users probably give this permission it would be nice if the nostr client could detect this.

I thought there was maybe a hack one could do - cancel request if it doesn't resolve in 100ms - but I could not find a way to do that.

I think a boolean parameter could be used.

async window.nostr.nip04.decrypt(pubkey, ciphertext, interactive): string // takes ciphertext and iv as specified in nip-04

If interactive is set to false, immediately throw an exception if the action is not permitted already.

@diegogurpegui
Copy link
Owner

I just tested it and if I authorize the site in nos2x-fox for like 5 minutes, I can decrypt messages for 5 minutes without the popup being brought up. Just as intended.
Did I understand your request correctly?

@Giszmo
Copy link
Author

Giszmo commented Dec 12, 2023

This is a feature request.

noStrudel dev had it such that you had to click on each message to decrypt it and only recently added support to decrypt all messages at once and his reason was that he wants control over what his extension decrypts but that comes at the cost of a horrible UI for users that want messages to decrypt always.

Currently the nip07 api does not allow the client dev to figure out if decrypt would open a popup or not but if there was, the client dev could decrypt by default if no popup was involved and show the "decrypt" button else.

I thinkthought the most elegant way of achieving such an API extension would be to add a parameter as described above but now I think it should be a separate call as the caller wouldn't know if it's supported else.

@diegogurpegui
Copy link
Owner

Let me see if I understand it correctly:
You want the client site to know if the user "trusts" or "authorized" the site for decryption so instead of displaying the "Decrypt" button, it can just decrypt all directly without user interaction. Is that right?
Or does the site still display the "Decrypt" button in all cases? Because this last scenario is whats already happening. I kept clicking "Decrypt" and saw all messages being decrypted without getting a single popup (because I authorized once).

I'm guessing you're talking about the first scenario.

@Giszmo
Copy link
Author

Giszmo commented Dec 13, 2023

The first, yes. I want NoStrudel to not show decrypt buttons if decrypt works non-interactively.

@diegogurpegui
Copy link
Owner

I wonder if revealing this information to a site could have negative consequences. I mean, letting the site find out if I have authorized some action automatically. The site could take advantage of this.

@Giszmo
Copy link
Author

Giszmo commented Dec 14, 2023

Yeah, I thought of that, too. The plugin could still track or even show what's going on so it could at least prevent it from happening secretly. Some toast "decrypted 12 messages" ...

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

No branches or pull requests

2 participants