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

Why requires env access? #262

Closed
SnowCait opened this issue Aug 22, 2024 · 3 comments
Closed

Why requires env access? #262

SnowCait opened this issue Aug 22, 2024 · 3 comments

Comments

@SnowCait
Copy link

Deno says PermissionDenied: Requires env access, run again with the --allow-env flag.
Other libraries does not requre it.
I don't think it is good to allow env access to libraries because it could be a security issue.
Permission control is the responsibility of apps, not libraries.
It would be better to accept parameters from constructor or method arguments.

@erskingardner
Copy link
Collaborator

Hmm, I'm not sure why NDK would need env access. there's nothing I'm aware of in the codebase that is asking for env access.

@pablof7z
Copy link
Collaborator

yeah, I don't think this is related to NDK, please reopen if you pinpoint something where this is happening.

@SnowCait
Copy link
Author

SnowCait commented Sep 11, 2024

Why not?
It's very easy to reproduce. Where else could the cause be other than the NDK?

Code (ndk.ts):

import NDK from "npm:@nostr-dev-kit/ndk";
new NDK();

Execution (--allow-read is required too, but I don't know it is related to this issue.):

> deno run --allow-read .\ndk.ts
┏ ⚠️  Deno requests env access.
┠─ Learn more at: https://docs.deno.com/go/--allow-env
┠─ Run again with --allow-env to bypass this prompt.
┗ Allow? [y/n/A] (y = yes, allow; n = no, deny; A = allow all env permissions) >

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

3 participants