@tauri-apps/plugin-http 2.0.0-beta.4 → 2.0.0-beta.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist-js/index.cjs CHANGED
@@ -10,16 +10,18 @@ var core = require('@tauri-apps/api/core');
10
10
  *
11
11
  * ## Security
12
12
  *
13
- * This API has a scope configuration that forces you to restrict the URLs and paths that can be accessed using glob patterns.
13
+ * This API has a scope configuration that forces you to restrict the URLs that can be accessed using glob patterns.
14
14
  *
15
- * For instance, this scope configuration only allows making HTTP requests to the GitHub API for the `tauri-apps` organization:
15
+ * For instance, this scope configuration only allows making HTTP requests to all subdomains for `tauri.app` except for `https://private.tauri.app`:
16
16
  * ```json
17
17
  * {
18
- * "plugins": {
19
- * "http": {
20
- * "scope": ["https://api.github.com/repos/tauri-apps/*"]
18
+ * "permissions": [
19
+ * {
20
+ * "identifier": "http:default",
21
+ * "allow": [{ "url": "https://*.tauri.app" }],
22
+ * "deny": [{ "url": "https://private.tauri.app" }]
21
23
  * }
22
- * }
24
+ * ]
23
25
  * }
24
26
  * ```
25
27
  * Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access.
@@ -71,6 +73,7 @@ async function fetch(input, init) {
71
73
  : Array.isArray(headers)
72
74
  ? headers
73
75
  : Object.entries(headers);
76
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
74
77
  const mappedHeaders = headersArray.map(([name, val]) => [
75
78
  name,
76
79
  // we need to ensure we have all header values as strings
package/dist-js/index.js CHANGED
@@ -8,16 +8,18 @@ import { invoke } from '@tauri-apps/api/core';
8
8
  *
9
9
  * ## Security
10
10
  *
11
- * This API has a scope configuration that forces you to restrict the URLs and paths that can be accessed using glob patterns.
11
+ * This API has a scope configuration that forces you to restrict the URLs that can be accessed using glob patterns.
12
12
  *
13
- * For instance, this scope configuration only allows making HTTP requests to the GitHub API for the `tauri-apps` organization:
13
+ * For instance, this scope configuration only allows making HTTP requests to all subdomains for `tauri.app` except for `https://private.tauri.app`:
14
14
  * ```json
15
15
  * {
16
- * "plugins": {
17
- * "http": {
18
- * "scope": ["https://api.github.com/repos/tauri-apps/*"]
16
+ * "permissions": [
17
+ * {
18
+ * "identifier": "http:default",
19
+ * "allow": [{ "url": "https://*.tauri.app" }],
20
+ * "deny": [{ "url": "https://private.tauri.app" }]
19
21
  * }
20
- * }
22
+ * ]
21
23
  * }
22
24
  * ```
23
25
  * Trying to execute any API with a URL not configured on the scope results in a promise rejection due to denied access.
@@ -69,6 +71,7 @@ async function fetch(input, init) {
69
71
  : Array.isArray(headers)
70
72
  ? headers
71
73
  : Object.entries(headers);
74
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
72
75
  const mappedHeaders = headersArray.map(([name, val]) => [
73
76
  name,
74
77
  // we need to ensure we have all header values as strings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tauri-apps/plugin-http",
3
- "version": "2.0.0-beta.4",
3
+ "version": "2.0.0-beta.6",
4
4
  "license": "MIT or APACHE-2.0",
5
5
  "authors": [
6
6
  "Tauri Programme within The Commons Conservancy"
@@ -20,7 +20,7 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "dependencies": {
23
- "@tauri-apps/api": "2.0.0-beta.12"
23
+ "@tauri-apps/api": "2.0.0-beta.13"
24
24
  },
25
25
  "scripts": {
26
26
  "build": "rollup -c"