-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Tauri ACL/Allowlist v2 Implementation and Plugin System Refactor #8428
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tweidinger
added
scope: core
Core packages of Tauri
priority: 1 high
type: breaking change
This issue or pull request will introduce a breaking change and requires major version bump
labels
Dec 18, 2023
there is a man standing behind me
2 tasks
lucasfernog
reviewed
Jan 3, 2024
chippers
previously approved these changes
Jan 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good as a basis for the ACL. There are some improvements I have in a project for this rep that we ideally land before stable, but I think we can mark this PR as complete and a good MVP
chippers
previously approved these changes
Jan 20, 2024
chippers
previously approved these changes
Jan 22, 2024
lucasfernog
approved these changes
Jan 23, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
priority: 1 high
scope: core
Core packages of Tauri
type: breaking change
This issue or pull request will introduce a breaking change and requires major version bump
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains several (breaking) changes related to:
The current proposal and extended documentation for these changes can be found in a public HackMD document here. This document will be undergoing several changes during the implementation but shows the general approach and architecture. We strongly recommend reading this document before commenting.
We currently believe this is the one big major change needed to make v2.0 feature complete for a beta/rc/release,
therefore work on this PR should be prioritized.
Tauri Plugins
In v2 of Tauri most of the commands were moved into dedicated plugins and outside of the core of Tauri.
The move to plugins rendered the existing allowlist unusable, as the system was not designed to be compatible with plugins or code outside of Tauri. This PR addresses this by adding a new allowlist and access control for Tauri commands written by app or plugin developers.
The plugin-workspace repository contains all of the previous (and more) functionality now available as plugins (see the v2 branch). This reduces the amount of complexity in Tauri itself. Additionally, it allows more fast paced changes of system interaction functionality, as no complete understanding of Tauri itself is needed to contribute. It also allows breaking releases/changes to specific plugins independently from Tauri.
To further define what Tauri plugins are and what they need to implement the
tauri-plugin
crate was created.It can be found in
core/tauri-plugin
in this PR branch.Plugin developers need to depend on this crate and implement the defined traits, define default permissions and optionally define scope types.
A lot of work (not tracked here) is required to upgrade plugins from v1 to v2 and convenience tooling like
tauri plugin init
,tauri permission init/add/remove
needs to be created, while existing tooling liketauri-cli
andcreate-tauri-app
need to be changed to be compatible with the new permissions/capabilities/plugins.Allowlist
In v1 of Tauri most of the commands were Tauri internal APIs built into the core of Tauri. The allowlist was used to restrict the access from the Webview to the Tauri core and system resources.
With this PR the new allowlist is built in a way to be used by all plugins and application developers and is no longer exclusive for Tauri inbuilt functionality. It also allows more fine grained control, while being able to abstract away a lot of things.
We introduce several new naming conventions and move the allowlist to a capability driven configuration. Permissions define command enablement and scope, while capabilities link permissions with windows of the application.
A simplified example allowlist/capabilities configuration could look like:
with an example permission, which could also be inbuilt/defined by the
fs
plugin:or even simpler when the capabilities are further abstracted:
Tauri Build System
The build system will be enhanced (most likely) in a non-breaking way to understand metadata information provided by plugins and will allow us to pass information from plugins into the Tauri application.
It also will allow us to highlight issues to the application developer when commands are enabled in the capabilities but the plugin implementing these commands is not initialized/used. Also the other way around when no commands of a plugin are enabled but the plugin is initialized.
What kind of change does this PR introduce?
Does this PR introduce a breaking change?
Checklist
fix: remove a typo, closes #___, #___
)Other information
Related issues:
dangerousRemoteIPCAccess
as it will be part of the capability definition