瀏覽代碼

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

* fix cli migration of http allowlist to ACL

* Create fix-cli-migration-http-acl.md
i-c-b 1 年之前
父節點
當前提交
947a50b8e2
共有 2 個文件被更改,包括 11 次插入2 次删除
  1. 5 0
      .changes/fix-cli-migration-http-acl.md
  2. 6 2
      tooling/cli/src/migrate/config.rs

+ 5 - 0
.changes/fix-cli-migration-http-acl.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch:bug
+---
+
+Fix `tauri migrate` for http plugin ACL.

+ 6 - 2
tooling/cli/src/migrate/config.rs

@@ -14,7 +14,7 @@ use tauri_utils::{
 };
 
 use std::{
-  collections::HashSet,
+  collections::{BTreeMap, HashSet},
   fs::{create_dir_all, write},
   path::Path,
 };
@@ -443,7 +443,11 @@ fn allowlist_to_permissions(
       .scope
       .0
       .into_iter()
-      .map(|p| AclValue::String(p.to_string()))
+      .map(|p| {
+        let mut map = BTreeMap::new();
+        map.insert("url".to_string(), AclValue::String(p.to_string()));
+        AclValue::Map(map)
+      })
       .collect::<Vec<_>>();
 
     permissions.push(PermissionEntry::ExtendedPermission {