@forge/api 6.3.0-next.3 → 6.4.0-next.0

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,5 +1,42 @@
1
1
  # @forge/api
2
2
 
3
+ ## 6.4.0-next.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5e160b1: Fixed a bug where protocols were not accounted for in egresses
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [5e160b1]
12
+ - @forge/egress@2.3.0-next.0
13
+
14
+ ## 6.3.0
15
+
16
+ ### Minor Changes
17
+
18
+ - def4ec3: add `requestTwg` helper for Teamwork Graph API
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies [559c541]
23
+ - Updated dependencies [d7f1cb8]
24
+ - Updated dependencies [b5f0775]
25
+ - Updated dependencies [af4af6f]
26
+ - Updated dependencies [2f0c3c2]
27
+ - Updated dependencies [c50eeb5]
28
+ - Updated dependencies [beefc94]
29
+ - Updated dependencies [00eaa35]
30
+ - Updated dependencies [b9cefff]
31
+ - Updated dependencies [b5f0775]
32
+ - Updated dependencies [069288e]
33
+ - Updated dependencies [d317f2e]
34
+ - Updated dependencies [bf0e0f6]
35
+ - Updated dependencies [af4af6f]
36
+ - Updated dependencies [bb6e58a]
37
+ - @forge/manifest@11.1.0
38
+ - @forge/egress@2.2.0
39
+
3
40
  ## 6.3.0-next.3
4
41
 
5
42
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/api/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,sBAAsB,EAAE,kBAAkB,EAAgB,MAAM,WAAW,CAAC;AAGpG,OAAO,EAAU,QAAQ,EAAS,MAAM,iBAAiB,CAAC;AAK1D,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,M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B,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,kBAAkB,CAAC;CAC9B;AAqID,eAAO,MAAM,aAAa,iBAAkB,QAAQ,sBAAsB,CAAC,KAAG,gBAE7E,CAAC;AA8DF,eAAO,MAAM,QAAQ,UAAW,MAAM,KAAG,OAKxC,CAAC;AAyBF,eAAO,MAAM,YAAY,SAAU,SAAS,GAAG,QAAQ,OAAO,MAAM,KAAG,OAKtE,CAAC;AAyBF,eAAO,MAAM,eAAe,SAAU,QAAQ,MAAM,QAAQ,EAAE,OAAO,CAAC,OAAO,MAAM,KAAG,OAKrF,CAAC;AAKF,eAAO,MAAM,WAAW;kCAtIoB,QAAQ,sBAAsB,CAAC,KAAG,gBAAgB;sBAgE9D,MAAM,KAAG,OAAO;yBA8Bb,SAAS,GAAG,QAAQ,OAAO,MAAM,KAAG,OAAO;4BA8BxC,QAAQ,MAAM,QAAQ,EAAE,OAAO,CAAC,OAAO,MAAM,KAAG,OAAO;CAe5F,CAAC"}
@@ -4,6 +4,7 @@ exports.permissions = exports.canLoadResource = exports.canFetchFrom = exports.h
4
4
  const runtime_1 = require("./runtime");
5
5
  const errors_1 = require("./errors");
6
6
  const minimatch_1 = require("minimatch");
7
+ const egress_1 = require("@forge/egress");
7
8
  function extractUrlString(url) {
8
9
  if (typeof url === 'string') {
9
10
  return url;
@@ -14,6 +15,10 @@ function extractUrlString(url) {
14
15
  return url.remote;
15
16
  }
16
17
  exports.extractUrlString = extractUrlString;
18
+ function normalizeUrl(url) {
19
+ const { protocol, hostname } = (0, egress_1.parseUrl)(url);
20
+ return `${protocol}//${hostname}`;
21
+ }
17
22
  function wrapInSyncMetrics(options, cb) {
18
23
  const metrics = (0, runtime_1.__getRuntime)().metrics;
19
24
  metrics.counter(options.name, options.tags).incr();
@@ -34,7 +39,11 @@ const getMissingScopes = (requiredScopes, currentlyGrantedScopes) => {
34
39
  };
35
40
  const getMissingUrls = (requiredUrls, currentlyGrantedUrls) => {
36
41
  const missingUrls = requiredUrls.filter((requiredUrl) => {
37
- const isUrlAlreadyGranted = currentlyGrantedUrls.some((currentGrantedUrl) => (0, minimatch_1.minimatch)(extractUrlString(requiredUrl), extractUrlString(currentGrantedUrl)));
42
+ const normalizedRequiredUrl = normalizeUrl(extractUrlString(requiredUrl));
43
+ const isUrlAlreadyGranted = currentlyGrantedUrls.some((currentGrantedUrl) => {
44
+ const normalizedGrantedUrl = normalizeUrl(extractUrlString(currentGrantedUrl));
45
+ return (0, minimatch_1.minimatch)(normalizedRequiredUrl, normalizedGrantedUrl);
46
+ });
38
47
  return !isUrlAlreadyGranted;
39
48
  });
40
49
  return missingUrls;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/api",
3
- "version": "6.3.0-next.3",
3
+ "version": "6.4.0-next.0",
4
4
  "description": "Forge API methods",
5
5
  "author": "Atlassian",
6
6
  "license": "SEE LICENSE IN LICENSE.txt",
@@ -26,9 +26,9 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@forge/auth": "0.0.9",
29
- "@forge/egress": "2.2.0-next.0",
29
+ "@forge/egress": "2.3.0-next.0",
30
30
  "@forge/i18n": "0.0.7",
31
- "@forge/manifest": "^11.1.0-next.8",
31
+ "@forge/manifest": "^11.1.0",
32
32
  "@forge/storage": "2.0.3",
33
33
  "headers-utils": "^3.0.2",
34
34
  "minimatch": "^9.0.5"