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: ability to reset allowed/forbidden fs scope paths, closes #7366 #7371

Open
wants to merge 16 commits into
base: 1.x
Choose a base branch
from

Conversation

LacombeJ
Copy link

@LacombeJ LacombeJ commented Jul 6, 2023

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

Issue: #7366

core/tauri/src/scope/fs.rs Outdated Show resolved Hide resolved
amrbashir
amrbashir previously approved these changes Jul 10, 2023
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

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

Thank you

@amrbashir
Copy link
Member

uh I should've noticed this earlier, @LacombeJ could you rebase this PR to target 1.x branch instead?

@LacombeJ
Copy link
Author

uh I should've noticed this earlier, @LacombeJ could you rebase this PR to target 1.x branch instead?

Yeah sure, I was actually going to ask about that

@LacombeJ
Copy link
Author

@amrbashir Let me know if I rebased properly.

This reset signature takes two arguments because 1.x has two possible scopes unlike dev/2.0.

pub fn reset<R: crate::Runtime>(&self, &App<R>, scope: &FsAllowlistScope) -> crate::Result<()> 

scope.reset(&app, &app.config().tauri.allowlist.fs.scope).unwrap();
scope.reset(&app, &app.config().tauri.allowlist.protocol.asset_scope).unwrap();

core/tauri/src/scope/fs.rs Outdated Show resolved Hide resolved
core/tauri/src/scope/fs.rs Outdated Show resolved Hide resolved
amrbashir
amrbashir previously approved these changes Jul 12, 2023
@lucasfernog
Copy link
Member

Now I see it's kinda hard to use the ResetScope values so we could actually add a function that pulls a ResetScope and readds the patterns to the Scope.

@lucasfernog
Copy link
Member

This now just needs an approval from the security team.

@lucasfernog lucasfernog added the security: needs audit This issue/PR needs a security audit label Jul 13, 2023
@lucasfernog lucasfernog requested a review from a team July 13, 2023 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security: needs audit This issue/PR needs a security audit
Projects
Status: 🔎 In audit
Development

Successfully merging this pull request may close these issues.

[feat] Ability to disallow previously added files/directories in FsScope
3 participants