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(permissions): allow run permission to take values #9833

Merged
merged 13 commits into from
Apr 9, 2021

Conversation

crowlKats
Copy link
Member

@crowlKats crowlKats commented Mar 19, 2021

Closes #9925

@ry ry added this to the 1.9.0 milestone Mar 19, 2021
crowlKats and others added 5 commits March 19, 2021 19:22
# Conflicts:
#	runtime/ops/worker_host.rs
# Conflicts:
#	runtime/ops/worker_host.rs
#	runtime/permissions.rs
cli/flags.rs Outdated
if let Some(run_wl) = matches.values_of("allow-run") {
let run_allowlist: Vec<String> = run_wl.map(ToString::to_string).collect();
flags.allow_run = Some(run_allowlist);
debug!("env allowlist: {:#?}", &flags.allow_run);
Copy link
Member

Choose a reason for hiding this comment

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

Remove?

.min_values(0)
.takes_value(true)
.use_delimiter(true)
.require_equals(true)
Copy link
Member

Choose a reason for hiding this comment

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

I think some kind of validator is needed here, similar to --allow-env PR

Copy link
Member Author

@crowlKats crowlKats Mar 24, 2021

Choose a reason for hiding this comment

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

sure, but how would we validate passed commands? check if they actually exist? That would be somewhat weird, as we don't chck if a path exists for the path related permissions

@bartlomieju
Copy link
Member

@crowlKats this PR looks good to me, let's land it for 1.9. Please rebase

# Conflicts:
#	runtime/ops/process.rs
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

@crowlKats before landing can you add an integration test to cli/tests/integration_tests.rs that uses an allow list? Something like _045_proxy that runs Deno executable.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

LGTM, great feature @crowlKats!

@bartlomieju bartlomieju merged commit e7b7129 into denoland:main Apr 9, 2021
@crowlKats crowlKats deleted the allow_run branch April 9, 2021 22:22
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.

Run permission can be scoped/limited
4 participants