-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
fix(core): capability filtering crashing allowed command generation #13476
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
Conversation
tauri-plugin and tauri build scripts cannot have access to the capabilities file (generated by tauri-build) and can only infer capabilities from the config path
Package Changes Through 39938efThere are 8 changes which include tauri-bundler with patch, tauri with minor, tauri-cli with patch, tauri-codegen with minor, tauri-utils with minor, @tauri-apps/api with minor, @tauri-apps/cli with patch, tauri-runtime-wry with patch Planned Package VersionsThe following package releases are the planned based on the context of changes in this pull request.
Add another change file through the GitHub UI by following this link. Read about change files or the docs at github.com/jbolda/covector |
crates/tauri-utils/src/acl/build.rs
Outdated
| capabilities.extend(crate::acl::get_capabilities(&config, None, None)?); | ||
| let capabilities_file_path = out_dir.join(CAPABILITIES_FILE_NAME); | ||
| // the capabilities file only exist in the tauri-build context | ||
| if !capabilities_file_path.exists() { |
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.
Would this call be a problem when the build script re-runs? I think maybe we could move back the
if let Some(capabilities_file_path) = pre_built_capabilities_file_path {
if capabilities_file_path.exists() {
let capabilities_file =
std::fs::read_to_string(capabilities_file_path).context("failed to read capabilities")?;
capabilities_from_files =
serde_json::from_str(&capabilities_file).context("failed to parse capabilities")?;
}
}part to tauri-codegen, and replace pre_built_capabilities_file_path param with capabilities_from_files: BTreeMap<String, Capability>, and we don't have to save the files here (this file should only be used for passing the data from tauri-build to tauri-codegen right? (maybe we should document this, I'm having a hard time revisiting this code 😂))
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.
same, it was a nightmare 🤣
Co-authored-by: Tony <68118705+Legend-Master@users.noreply.github.com>
tauri-plugin and tauri build scripts cannot have access to the capabilities file (generated by tauri-build) and can only infer capabilities from the config path (from the env var)