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

fix(cli): migration for http plugin ACL #9049

Merged
merged 2 commits into from
Mar 3, 2024
Merged

fix(cli): migration for http plugin ACL #9049

merged 2 commits into from
Mar 3, 2024

Conversation

i-c-b
Copy link
Contributor

@i-c-b i-c-b commented Mar 1, 2024

tauri migrate creates an array of strings but http plugin expects an array of objects with a key of url and a string value.

@i-c-b i-c-b requested a review from a team as a code owner March 1, 2024 12:20
@i-c-b i-c-b changed the title fix(cli): cli migration for http plugin ACL fix(cli): migration for http plugin ACL Mar 1, 2024
@amrbashir
Copy link
Member

seems like the better change here would be to change the http plugin scope to take array of url patterns instead of objects, cc @lucasfernog

@lucasfernog
Copy link
Member

IIRC I kept the object way of defining scopes because it looked better on TOML files.. if you guys wanna double check it's fine

@lucasfernog lucasfernog merged commit 947a50b into tauri-apps:dev Mar 3, 2024
11 checks passed
@amrbashir
Copy link
Member

amrbashir commented Mar 4, 2024

Just checked this and there is a few things to improve:

  1. permissions in a capability file using toml need to use [[permissions]] synatx, you can't permissions = ["allow"] Edit: this isn't true, only the generated schema doesn't match this variant
  2. the scope in toml will need to be defined as allow = [{ url = "hello" }] which is not very nice

Here is an example of the whole scope file:

"$schema" = "../gen/schemas/desktop-schema.json"
identifier = "run-app-base"
description = "Base permissions to run the app"
windows = ["main"]

[[permissions]]
identifier = "http:default"
allow = [{ url = "hello" }]

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.

3 participants