@forge/tunnel 0.0.0-experimental-3b4aabe → 0.0.0-experimental-fbe27f8

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/CHANGELOG.md CHANGED
@@ -1,19 +1,133 @@
1
1
  # @forge/tunnel
2
2
 
3
- ## 0.0.0-experimental-3b4aabe
3
+ ## 0.0.0-experimental-fbe27f8
4
4
 
5
5
  ### Minor Changes
6
6
 
7
- - 189ba71: Add keytar to shrinkwrap package list
7
+ - 8b1a49b: Update ngrok version
8
+
9
+ ### Patch Changes
10
+
11
+ - @forge/cli-shared@0.0.0-experimental-fbe27f8
12
+ - @forge/bundler@0.0.0-experimental-fbe27f8
13
+ - @forge/runtime@0.0.0-experimental-fbe27f8
14
+
15
+ ## 1.9.0-next.6
16
+
17
+ ### Minor Changes
18
+
19
+ - 8b1a49bd: Update ngrok version
20
+
21
+ ## 1.8.4-next.5
22
+
23
+ ### Patch Changes
24
+
25
+ - @forge/cli-shared@2.6.2-next.5
26
+ - @forge/bundler@3.0.11-next.5
27
+
28
+ ## 1.8.4-next.4
29
+
30
+ ### Patch Changes
31
+
32
+ - @forge/cli-shared@2.6.2-next.4
33
+ - @forge/bundler@3.0.11-next.4
34
+
35
+ ## 1.8.4-next.3
36
+
37
+ ### Patch Changes
38
+
39
+ - @forge/cli-shared@2.6.2-next.3
40
+ - @forge/bundler@3.0.11-next.3
41
+
42
+ ## 1.8.4-next.2
43
+
44
+ ### Patch Changes
45
+
46
+ - @forge/cli-shared@2.6.2-next.2
47
+ - @forge/bundler@3.0.11-next.2
48
+
49
+ ## 1.8.4-next.1
50
+
51
+ ### Patch Changes
52
+
53
+ - @forge/cli-shared@2.6.2-next.1
54
+ - @forge/bundler@3.0.11-next.1
55
+
56
+ ## 1.8.4-next.0
57
+
58
+ ### Patch Changes
59
+
60
+ - @forge/cli-shared@2.6.2-next.0
61
+ - @forge/bundler@3.0.11-next.0
62
+
63
+ ## 1.8.3
64
+
65
+ ### Patch Changes
66
+
67
+ - Updated dependencies [13f2ae81]
68
+ - @forge/bundler@3.0.10
69
+ - @forge/runtime@2.2.1
70
+ - @forge/cli-shared@2.6.1
71
+
72
+ ## 1.8.3-next.6
73
+
74
+ ### Patch Changes
75
+
76
+ - @forge/cli-shared@2.6.1-next.6
77
+ - @forge/bundler@3.0.10-next.6
78
+
79
+ ## 1.8.3-next.5
80
+
81
+ ### Patch Changes
82
+
83
+ - @forge/cli-shared@2.6.1-next.5
84
+ - @forge/bundler@3.0.10-next.5
85
+
86
+ ## 1.8.3-next.4
87
+
88
+ ### Patch Changes
89
+
90
+ - @forge/cli-shared@2.6.1-next.4
91
+ - @forge/bundler@3.0.10-next.4
92
+
93
+ ## 1.8.3-next.3
94
+
95
+ ### Patch Changes
96
+
97
+ - @forge/cli-shared@2.6.1-next.3
98
+ - @forge/bundler@3.0.10-next.3
99
+
100
+ ## 1.8.3-next.2
101
+
102
+ ### Patch Changes
103
+
104
+ - Updated dependencies [13f2ae81]
105
+ - @forge/bundler@3.0.10-next.2
106
+ - @forge/runtime@2.2.1-next.0
107
+ - @forge/cli-shared@2.6.1-next.2
108
+
109
+ ## 1.8.3-next.1
110
+
111
+ ### Patch Changes
112
+
113
+ - @forge/cli-shared@2.6.1-next.1
114
+ - @forge/bundler@3.0.10-next.1
115
+
116
+ ## 1.8.3-next.0
117
+
118
+ ### Patch Changes
119
+
120
+ - @forge/cli-shared@2.6.1-next.0
121
+ - @forge/bundler@3.0.10-next.0
122
+
123
+ ## 1.8.2
8
124
 
9
125
  ### Patch Changes
10
126
 
11
127
  - Updated dependencies [69f42bd]
12
128
  - Updated dependencies [e0f6a1c]
13
- - Updated dependencies [189ba71]
14
- - @forge/cli-shared@0.0.0-experimental-3b4aabe
15
- - @forge/bundler@0.0.0-experimental-3b4aabe
16
- - @forge/runtime@0.0.0-experimental-3b4aabe
129
+ - @forge/cli-shared@2.6.0
130
+ - @forge/bundler@3.0.9
17
131
 
18
132
  ## 1.8.2-next.6
19
133
 
@@ -17,6 +17,7 @@ export declare class ResourceTunnelServer {
17
17
  private server;
18
18
  private readonly proxy;
19
19
  private socket;
20
+ private cspReporterServerPort;
20
21
  constructor({ port, key, path, tunnel, permissions, remotes, logger, cspReporterServerPort }: ResourceTunnelServerArgs);
21
22
  getApp(): Express;
22
23
  static transformPermissionsWithRemotes(permissions: Permissions, remotes: Remotes): {
@@ -1 +1 @@
1
- {"version":3,"file":"resource-tunnel-server.d.ts","sourceRoot":"","sources":["../../../src/tunnelling/servers/resource-tunnel-server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAmD,MAAM,EAAkB,MAAM,mBAAmB,CAAC;AACtH,OAAgB,EAAE,OAAO,EAAqB,MAAM,SAAS,CAAC;AAK9D,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE5D,MAAM,WAAW,wBAAyB,SAAQ,QAAQ;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;IACzB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;CAClB;AAYD,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAS;IAC9B,SAAgB,GAAG,EAAE,MAAM,CAAC;IAC5B,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,MAAM,EAAE,MAAM,CAAC;IAC/B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAU;IAC9B,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;IACnD,OAAO,CAAC,MAAM,CAAqB;gBAEvB,EACV,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,EACN,qBAAqB,EACtB,EAAE,wBAAwB;IAyC3B,MAAM,IAAI,OAAO;IAIjB,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qBAAqB,CAAS;gBAE1B,EACV,IAAI,EACJ,GAAG,EACH,IAAI,EACJ,MAAM,EACN,WAAW,EACX,OAAO,EACP,MAAM,EACN,qBAAqB,EACtB,EAAE,wBAAwB;IA0C3B,MAAM,IAAI,OAAO;IAIjB,MAAM,CAAC,+BAA+B,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO;;;;;;;;;;;;;;;;;IAa3E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAc3B,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,gCAAgC;IAoBxC,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,YAAY,CAOJ;IAEhB,OAAO,CAAC,wBAAwB,CAG3B;IAEL,OAAO,CAAC,yBAAyB,CAG5B;IAEL,OAAO,CAAC,6BAA6B,CAwBhC;CACN"}
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const cli_shared_1 = require("@forge/cli-shared");
6
6
  const express_1 = tslib_1.__importDefault(require("express"));
7
7
  const http_proxy_middleware_1 = require("http-proxy-middleware");
8
+ const csp_1 = require("@forge/csp");
8
9
  const express_mung_1 = require("express-mung");
9
10
  var ConnectionErrorCode;
10
11
  (function (ConnectionErrorCode) {
@@ -13,7 +14,9 @@ var ConnectionErrorCode;
13
14
  const HOST = process.env.FORGE_DEV_TUNNEL ? 'localhost' : 'host.docker.internal';
14
15
  class ResourceTunnelServer {
15
16
  constructor({ port, key, path, tunnel, permissions, remotes, logger, cspReporterServerPort }) {
16
- this.getCspHeader = () => '';
17
+ this.getCspHeader = (existingCsp) => new csp_1.CSPInjectionService()
18
+ .getInjectableCSP(existingCsp, cli_shared_1.getEnvironment(cli_shared_1.CDNEnvironments), `http://localhost:${this.cspReporterServerPort}`)
19
+ .join('; ');
17
20
  this.injectGlobalBridgeScript = (htmlContent) => new cli_shared_1.BridgeScriptService().injectBridgeCore(htmlContent, () => {
18
21
  throw new Error('Malformed HTML document');
19
22
  });
@@ -27,13 +30,15 @@ class ResourceTunnelServer {
27
30
  res.removeHeader('content-length');
28
31
  const htmlContentWithIframeResizerScript = this.injectIframeResizerScript(body);
29
32
  const htmlContentWithBridgeScript = this.injectGlobalBridgeScript(htmlContentWithIframeResizerScript);
30
- res.setHeader('Content-Security-Policy', this.getCspHeader());
33
+ const cspDetails = new csp_1.CSPProcessingService({ info: () => { } }).getCspDetails(htmlContentWithBridgeScript, ResourceTunnelServer.transformPermissionsWithRemotes(permissions, remotes));
34
+ res.setHeader('Content-Security-Policy', this.getCspHeader(cspDetails));
31
35
  return htmlContentWithBridgeScript;
32
36
  });
33
37
  this.port = port;
34
38
  this.key = key;
35
39
  this.path = path;
36
40
  this.logger = logger;
41
+ this.cspReporterServerPort = cspReporterServerPort;
37
42
  this.app = express_1.default();
38
43
  this.app.use(this.getCustomUIResourceMiddleware(permissions, remotes));
39
44
  if (tunnel) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/tunnel",
3
- "version": "0.0.0-experimental-3b4aabe",
3
+ "version": "0.0.0-experimental-fbe27f8",
4
4
  "description": "Tunnel functionality for Forge CLI",
5
5
  "author": "Atlassian",
6
6
  "license": "UNLICENSED",
@@ -16,21 +16,22 @@
16
16
  "postbuild": "chmod +x out/*.js"
17
17
  },
18
18
  "dependencies": {
19
- "@forge/bundler": "0.0.0-experimental-3b4aabe",
20
- "@forge/cli-shared": "0.0.0-experimental-3b4aabe",
19
+ "@forge/bundler": "0.0.0-experimental-fbe27f8",
20
+ "@forge/cli-shared": "0.0.0-experimental-fbe27f8",
21
+ "@forge/csp": "^1.11.0",
21
22
  "@forge/isolated-vm": "3.3.10",
22
- "@forge/runtime": "0.0.0-experimental-3b4aabe",
23
+ "@forge/runtime": "0.0.0-experimental-fbe27f8",
23
24
  "express": "^4.17.1",
24
25
  "express-mung": "^0.5.1",
25
26
  "http-proxy-middleware": "^1.0.6",
26
- "ngrok": "^4.0.1",
27
+ "ngrok": "^4.3.1",
27
28
  "node-cache": "^5.1.2",
28
29
  "tmp": "^0.1.0",
29
30
  "tslib": "^1.11.0",
30
31
  "uuid": "^3.4.0"
31
32
  },
32
33
  "devDependencies": {
33
- "@forge/manifest": "^0.0.0-experimental-3b4aabe",
34
+ "@forge/manifest": "^0.0.0-experimental-fbe27f8",
34
35
  "@types/express": "^4.17.2",
35
36
  "@types/express-mung": "^0.5.2",
36
37
  "@types/jest": "^26.0.0",
@@ -43,6 +44,6 @@
43
44
  "supertest": "^6.1.3"
44
45
  },
45
46
  "optionalDependencies": {
46
- "keytar": "^7.9.0"
47
+ "keytar": "^7.0.0"
47
48
  }
48
49
  }