@forge/lint 2.0.0-next.24 → 2.0.1-next.2
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,78 @@
|
|
|
1
1
|
# @forge/lint
|
|
2
2
|
|
|
3
|
+
## 2.0.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- ffa0050: Accept both deprecated scopes and granular scopes when verifying scopes required for Forge UI hooks.
|
|
8
|
+
- Updated dependencies [14102be]
|
|
9
|
+
- @forge/manifest@3.1.0-next.2
|
|
10
|
+
- @forge/cli-shared@2.2.1-next.2
|
|
11
|
+
|
|
12
|
+
## 2.0.1-next.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [8ee1c58]
|
|
17
|
+
- @forge/manifest@3.1.0-next.1
|
|
18
|
+
- @forge/cli-shared@2.2.1-next.1
|
|
19
|
+
|
|
20
|
+
## 2.0.1-next.0
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [813f8f3]
|
|
25
|
+
- Updated dependencies [5152239]
|
|
26
|
+
- @forge/manifest@3.1.0-next.0
|
|
27
|
+
- @forge/cli-shared@2.2.1-next.0
|
|
28
|
+
|
|
29
|
+
## 2.0.0
|
|
30
|
+
|
|
31
|
+
### Major Changes
|
|
32
|
+
|
|
33
|
+
- 6ceb574: Update ui-hooks to use new granular scopes
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 69e25c2: Required permissions scope linter should read from the x-atlassian-oauth2-scopes. If it is not present then read from the security OAuth2 field. Combining Product DACIs https://hello.atlassian.net/wiki/spaces/redfox/pages/1046875420/RFC+OAuth+scopes+deprecation+in+Jira+-+DAC and https://hello.atlassian.net/wiki/spaces/redfox/pages/1304762888/OpenAPI+-+DAC+contract.
|
|
38
|
+
- Updated dependencies [bd6e025]
|
|
39
|
+
- Updated dependencies [1c196ff]
|
|
40
|
+
- Updated dependencies [271b98a]
|
|
41
|
+
- Updated dependencies [4cfa56d]
|
|
42
|
+
- Updated dependencies [22a488e]
|
|
43
|
+
- Updated dependencies [218fe20]
|
|
44
|
+
- Updated dependencies [1dba082]
|
|
45
|
+
- Updated dependencies [2bca1c0]
|
|
46
|
+
- Updated dependencies [1dba082]
|
|
47
|
+
- Updated dependencies [689c09b]
|
|
48
|
+
- Updated dependencies [b97660c]
|
|
49
|
+
- Updated dependencies [7c0d2ee]
|
|
50
|
+
- Updated dependencies [1dba082]
|
|
51
|
+
- Updated dependencies [d3afe01]
|
|
52
|
+
- Updated dependencies [dfe9dd8]
|
|
53
|
+
- Updated dependencies [91ea057]
|
|
54
|
+
- Updated dependencies [3010f0e]
|
|
55
|
+
- Updated dependencies [2b7c32b]
|
|
56
|
+
- Updated dependencies [e7ee3a7]
|
|
57
|
+
- Updated dependencies [92d081d]
|
|
58
|
+
- Updated dependencies [d3c8c8d]
|
|
59
|
+
- Updated dependencies [fca240d]
|
|
60
|
+
- Updated dependencies [36c7c8f]
|
|
61
|
+
- Updated dependencies [d2f6992]
|
|
62
|
+
- Updated dependencies [d18c9f1]
|
|
63
|
+
- Updated dependencies [1dba082]
|
|
64
|
+
- Updated dependencies [fa963b1]
|
|
65
|
+
- Updated dependencies [0a7725f]
|
|
66
|
+
- Updated dependencies [1dba082]
|
|
67
|
+
- Updated dependencies [e4a14c7]
|
|
68
|
+
- Updated dependencies [2bb89c5]
|
|
69
|
+
- Updated dependencies [5875eb3]
|
|
70
|
+
- Updated dependencies [b63af27]
|
|
71
|
+
- Updated dependencies [0a39c43]
|
|
72
|
+
- @forge/manifest@3.0.0
|
|
73
|
+
- @forge/csp@1.9.0
|
|
74
|
+
- @forge/cli-shared@2.2.0
|
|
75
|
+
|
|
3
76
|
## 2.0.0-next.24
|
|
4
77
|
|
|
5
78
|
### Major Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-hook-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/ui-hook-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ui-hook-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/ui-hook-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AA2BpF,qBAAa,cAAe,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAC/F,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAoC1E,OAAO,CAAC,WAAW;CAepB"}
|
|
@@ -5,17 +5,22 @@ const linter_interface_1 = require("../../../linter-interface");
|
|
|
5
5
|
const verifier_interface_1 = require("../../verifier-interface");
|
|
6
6
|
const text_1 = require("../../../text");
|
|
7
7
|
const FORGE_UI_HOOK_PERMISSIONS = {
|
|
8
|
-
useContentProperty:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
'read:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
useContentProperty: {
|
|
9
|
+
current: [
|
|
10
|
+
'read:content-details:confluence',
|
|
11
|
+
'read:content.property:confluence',
|
|
12
|
+
'write:content.property:confluence'
|
|
13
|
+
],
|
|
14
|
+
deprecated: ['read:confluence-props', 'write:confluence-props']
|
|
15
|
+
},
|
|
16
|
+
useSpaceProperty: {
|
|
17
|
+
current: ['read:content-details:confluence', 'read:space.property:confluence', 'write:space.property:confluence'],
|
|
18
|
+
deprecated: ['read:confluence-props', 'write:confluence-props']
|
|
19
|
+
},
|
|
20
|
+
useIssueProperty: {
|
|
21
|
+
current: ['read:issue.property:jira'],
|
|
22
|
+
deprecated: ['read:jira-work', 'write:jira-work']
|
|
23
|
+
}
|
|
19
24
|
};
|
|
20
25
|
class UIHookVerifier extends verifier_interface_1.BaseLintIssueVerifier {
|
|
21
26
|
getLintClass() {
|
|
@@ -23,17 +28,30 @@ class UIHookVerifier extends verifier_interface_1.BaseLintIssueVerifier {
|
|
|
23
28
|
}
|
|
24
29
|
async process(apiCalls) {
|
|
25
30
|
const rules = [];
|
|
26
|
-
|
|
31
|
+
for (const apiCall of apiCalls) {
|
|
27
32
|
const requiredPermissions = FORGE_UI_HOOK_PERMISSIONS[apiCall.hookName];
|
|
28
33
|
if (!requiredPermissions)
|
|
29
34
|
return rules;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const { current, deprecated } = requiredPermissions;
|
|
36
|
+
const missingCurrentPerms = current.filter((perm) => { var _a, _b; return !((_b = (_a = this.manifest.permissions) === null || _a === void 0 ? void 0 : _a.scopes) === null || _b === void 0 ? void 0 : _b.includes(perm)); });
|
|
37
|
+
if (!missingCurrentPerms.length)
|
|
38
|
+
continue;
|
|
39
|
+
let missingDeprecatedPerms = null;
|
|
40
|
+
if (deprecated) {
|
|
41
|
+
missingDeprecatedPerms = deprecated.filter((perm) => { var _a, _b; return !((_b = (_a = this.manifest.permissions) === null || _a === void 0 ? void 0 : _a.scopes) === null || _b === void 0 ? void 0 : _b.includes(perm)); });
|
|
42
|
+
if (!missingDeprecatedPerms.length)
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
if (missingCurrentPerms.length < current.length) {
|
|
46
|
+
missingCurrentPerms.forEach((perm) => rules.push(this.getHookRule(apiCall, perm)));
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
if (deprecated && missingDeprecatedPerms && (missingDeprecatedPerms === null || missingDeprecatedPerms === void 0 ? void 0 : missingDeprecatedPerms.length) < deprecated.length) {
|
|
50
|
+
missingDeprecatedPerms.forEach((perm) => rules.push(this.getHookRule(apiCall, perm)));
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
missingCurrentPerms.forEach((perm) => rules.push(this.getHookRule(apiCall, perm)));
|
|
54
|
+
}
|
|
37
55
|
return rules;
|
|
38
56
|
}
|
|
39
57
|
getHookRule(apiCall, permission) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/lint",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1-next.2",
|
|
4
4
|
"description": "Linting for forge apps",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"@types/node-fetch": "^2.5.7"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@forge/cli-shared": "2.2.
|
|
19
|
-
"@forge/csp": "1.9.0
|
|
20
|
-
"@forge/manifest": "3.
|
|
18
|
+
"@forge/cli-shared": "2.2.1-next.2",
|
|
19
|
+
"@forge/csp": "1.9.0",
|
|
20
|
+
"@forge/manifest": "3.1.0-next.2",
|
|
21
21
|
"@typescript-eslint/typescript-estree": "^3.5.0",
|
|
22
22
|
"cross-spawn": "^7.0.1",
|
|
23
23
|
"node-fetch": "^2.6.1",
|