@forge/lint 0.0.0-experimental-64caa5a → 0.0.0-experimental-490cfcf
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 +440 -14
- package/out/lint/lint.d.ts.map +1 -1
- package/out/lint/lint.js +3 -1
- package/out/lint/linters/permission-linter/permission-linter.d.ts +1 -0
- package/out/lint/linters/permission-linter/permission-linter.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/permission-linter.js +19 -4
- package/out/lint/linters/permission-linter/verifiers/content-property-verifier.d.ts +6 -1
- package/out/lint/linters/permission-linter/verifiers/content-property-verifier.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/verifiers/content-property-verifier.js +66 -16
- package/out/lint/linters/permission-linter/verifiers/product-verifier.d.ts +1 -0
- package/out/lint/linters/permission-linter/verifiers/product-verifier.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/verifiers/product-verifier.js +28 -6
- package/out/lint/linters/permission-linter/verifiers/ui-hook-verifier.d.ts.map +1 -1
- package/out/lint/linters/permission-linter/verifiers/ui-hook-verifier.js +37 -11
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,42 +1,468 @@
|
|
|
1
1
|
# @forge/lint
|
|
2
2
|
|
|
3
|
-
## 0.0.0-experimental-
|
|
3
|
+
## 0.0.0-experimental-490cfcf
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [54bf134]
|
|
8
|
+
- Updated dependencies [2484683]
|
|
9
|
+
- @forge/manifest@0.0.0-experimental-490cfcf
|
|
10
|
+
- @forge/cli-shared@0.0.0-experimental-490cfcf
|
|
11
|
+
|
|
12
|
+
## 3.0.3-next.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [24846832]
|
|
17
|
+
- @forge/manifest@3.3.1-next.1
|
|
18
|
+
- @forge/cli-shared@2.3.1-next.1
|
|
19
|
+
|
|
20
|
+
## 3.0.3-next.0
|
|
21
|
+
|
|
22
|
+
### Patch Changes
|
|
23
|
+
|
|
24
|
+
- Updated dependencies [54bf134]
|
|
25
|
+
- @forge/manifest@3.3.1-next.0
|
|
26
|
+
- @forge/cli-shared@2.3.1-next.0
|
|
27
|
+
|
|
28
|
+
## 3.0.2
|
|
29
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [fcd9580]
|
|
33
|
+
- Updated dependencies [47a71a6]
|
|
34
|
+
- Updated dependencies [6c44d2b]
|
|
35
|
+
- Updated dependencies [e95919f]
|
|
36
|
+
- Updated dependencies [56164fe]
|
|
37
|
+
- Updated dependencies [949bd40]
|
|
38
|
+
- Updated dependencies [cf2420d]
|
|
39
|
+
- Updated dependencies [e822a8a]
|
|
40
|
+
- Updated dependencies [720953f]
|
|
41
|
+
- Updated dependencies [2420378]
|
|
42
|
+
- Updated dependencies [051ed1f]
|
|
43
|
+
- Updated dependencies [ad94136]
|
|
44
|
+
- Updated dependencies [e65d33e]
|
|
45
|
+
- Updated dependencies [ae111cd]
|
|
46
|
+
- Updated dependencies [8e35955]
|
|
47
|
+
- Updated dependencies [c255b24]
|
|
48
|
+
- Updated dependencies [f894871]
|
|
49
|
+
- @forge/manifest@3.3.0
|
|
50
|
+
- @forge/cli-shared@2.3.0
|
|
51
|
+
- @forge/csp@1.10.0
|
|
52
|
+
|
|
53
|
+
## 3.0.2-next.12
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [720953f]
|
|
58
|
+
- @forge/manifest@3.3.0-next.9
|
|
59
|
+
- @forge/cli-shared@2.3.0-next.11
|
|
60
|
+
|
|
61
|
+
## 3.0.2-next.11
|
|
62
|
+
|
|
63
|
+
### Patch Changes
|
|
64
|
+
|
|
65
|
+
- Updated dependencies [fcd95803]
|
|
66
|
+
- Updated dependencies [47a71a62]
|
|
67
|
+
- Updated dependencies [e65d33e6]
|
|
68
|
+
- @forge/manifest@3.3.0-next.8
|
|
69
|
+
- @forge/cli-shared@2.3.0-next.10
|
|
70
|
+
|
|
71
|
+
## 3.0.2-next.10
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Updated dependencies [cf2420d2]
|
|
76
|
+
- @forge/cli-shared@2.3.0-next.9
|
|
77
|
+
|
|
78
|
+
## 3.0.2-next.9
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- Updated dependencies [8e35955]
|
|
83
|
+
- @forge/manifest@3.3.0-next.7
|
|
84
|
+
- @forge/cli-shared@2.3.0-next.8
|
|
85
|
+
|
|
86
|
+
## 3.0.2-next.8
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Updated dependencies [ad94136]
|
|
91
|
+
- @forge/manifest@3.3.0-next.6
|
|
92
|
+
- @forge/cli-shared@2.3.0-next.7
|
|
93
|
+
|
|
94
|
+
## 3.0.2-next.7
|
|
95
|
+
|
|
96
|
+
### Patch Changes
|
|
97
|
+
|
|
98
|
+
- Updated dependencies [e95919f]
|
|
99
|
+
- Updated dependencies [f894871]
|
|
100
|
+
- @forge/csp@1.10.0-next.1
|
|
101
|
+
- @forge/manifest@3.3.0-next.5
|
|
102
|
+
- @forge/cli-shared@2.3.0-next.6
|
|
103
|
+
|
|
104
|
+
## 3.0.2-next.6
|
|
105
|
+
|
|
106
|
+
### Patch Changes
|
|
107
|
+
|
|
108
|
+
- Updated dependencies [ae111cd]
|
|
109
|
+
- @forge/manifest@3.3.0-next.4
|
|
110
|
+
- @forge/cli-shared@2.3.0-next.5
|
|
111
|
+
|
|
112
|
+
## 3.0.2-next.5
|
|
113
|
+
|
|
114
|
+
### Patch Changes
|
|
115
|
+
|
|
116
|
+
- Updated dependencies [6c44d2b]
|
|
117
|
+
- Updated dependencies [051ed1f]
|
|
118
|
+
- @forge/manifest@3.3.0-next.3
|
|
119
|
+
- @forge/cli-shared@2.3.0-next.4
|
|
120
|
+
|
|
121
|
+
## 3.0.2-next.4
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- Updated dependencies [e822a8a]
|
|
126
|
+
- Updated dependencies [c255b24]
|
|
127
|
+
- @forge/manifest@3.3.0-next.2
|
|
128
|
+
- @forge/cli-shared@2.3.0-next.3
|
|
129
|
+
|
|
130
|
+
## 3.0.2-next.3
|
|
131
|
+
|
|
132
|
+
### Patch Changes
|
|
133
|
+
|
|
134
|
+
- Updated dependencies [24203783]
|
|
135
|
+
- @forge/manifest@3.3.0-next.1
|
|
136
|
+
- @forge/cli-shared@2.3.0-next.2
|
|
137
|
+
|
|
138
|
+
## 3.0.2-next.2
|
|
139
|
+
|
|
140
|
+
### Patch Changes
|
|
141
|
+
|
|
142
|
+
- Updated dependencies [56164fe]
|
|
143
|
+
- @forge/csp@1.10.0-next.0
|
|
144
|
+
|
|
145
|
+
## 3.0.2-next.1
|
|
146
|
+
|
|
147
|
+
### Patch Changes
|
|
148
|
+
|
|
149
|
+
- Updated dependencies [c145946]
|
|
150
|
+
- @forge/manifest@3.3.0-next.0
|
|
151
|
+
- @forge/cli-shared@2.3.0-next.1
|
|
152
|
+
|
|
153
|
+
## 3.0.2-next.0
|
|
154
|
+
|
|
155
|
+
### Patch Changes
|
|
156
|
+
|
|
157
|
+
- Updated dependencies [949bd40]
|
|
158
|
+
- @forge/cli-shared@2.3.0-next.0
|
|
159
|
+
|
|
160
|
+
## 3.0.1
|
|
161
|
+
|
|
162
|
+
### Patch Changes
|
|
163
|
+
|
|
164
|
+
- Updated dependencies [7f869f7]
|
|
165
|
+
- Updated dependencies [72e020c]
|
|
166
|
+
- Updated dependencies [b2cef71]
|
|
167
|
+
- Updated dependencies [254b239]
|
|
168
|
+
- Updated dependencies [47744fc]
|
|
169
|
+
- Updated dependencies [860c4fb]
|
|
170
|
+
- Updated dependencies [66e969f]
|
|
171
|
+
- Updated dependencies [2c635f9]
|
|
172
|
+
- @forge/manifest@3.2.0
|
|
173
|
+
- @forge/cli-shared@2.2.2
|
|
174
|
+
|
|
175
|
+
## 3.0.1-next.6
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- Updated dependencies [860c4fb0]
|
|
180
|
+
- @forge/manifest@3.2.0-next.6
|
|
181
|
+
- @forge/cli-shared@2.2.2-next.6
|
|
182
|
+
|
|
183
|
+
## 3.0.1-next.5
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Updated dependencies [72e020c]
|
|
188
|
+
- @forge/manifest@3.2.0-next.5
|
|
189
|
+
- @forge/cli-shared@2.2.2-next.5
|
|
190
|
+
|
|
191
|
+
## 3.0.1-next.4
|
|
192
|
+
|
|
193
|
+
### Patch Changes
|
|
194
|
+
|
|
195
|
+
- Updated dependencies [254b2397]
|
|
196
|
+
- @forge/manifest@3.2.0-next.4
|
|
197
|
+
- @forge/cli-shared@2.2.2-next.4
|
|
198
|
+
|
|
199
|
+
## 3.0.1-next.3
|
|
200
|
+
|
|
201
|
+
### Patch Changes
|
|
202
|
+
|
|
203
|
+
- Updated dependencies [b2cef71d]
|
|
204
|
+
- @forge/manifest@3.2.0-next.3
|
|
205
|
+
- @forge/cli-shared@2.2.2-next.3
|
|
206
|
+
|
|
207
|
+
## 3.0.1-next.2
|
|
208
|
+
|
|
209
|
+
### Patch Changes
|
|
210
|
+
|
|
211
|
+
- Updated dependencies [7f869f7]
|
|
212
|
+
- @forge/manifest@3.2.0-next.2
|
|
213
|
+
- @forge/cli-shared@2.2.2-next.2
|
|
214
|
+
|
|
215
|
+
## 3.0.1-next.1
|
|
216
|
+
|
|
217
|
+
### Patch Changes
|
|
218
|
+
|
|
219
|
+
- Updated dependencies [47744fc]
|
|
220
|
+
- @forge/manifest@3.1.1-next.1
|
|
221
|
+
- @forge/cli-shared@2.2.2-next.1
|
|
222
|
+
|
|
223
|
+
## 3.0.1-next.0
|
|
224
|
+
|
|
225
|
+
### Patch Changes
|
|
226
|
+
|
|
227
|
+
- Updated dependencies [2c635f9]
|
|
228
|
+
- @forge/manifest@3.1.1-next.0
|
|
229
|
+
- @forge/cli-shared@2.2.2-next.0
|
|
230
|
+
|
|
231
|
+
## 3.0.0
|
|
232
|
+
|
|
233
|
+
### Major Changes
|
|
234
|
+
|
|
235
|
+
- 4922d09: Only errors set the process exitCode to 1, warnings do not anymore.
|
|
236
|
+
|
|
237
|
+
### Minor Changes
|
|
238
|
+
|
|
239
|
+
- 83ca609: Adding environment variables to override production swagger with local files.
|
|
240
|
+
- 037c31a5: Upgrade webpack from 4 to 5 and other relavent packages to fix the issue for node17+ (openssl change)
|
|
241
|
+
|
|
242
|
+
### Patch Changes
|
|
243
|
+
|
|
244
|
+
- ffa0050: Accept both deprecated scopes and granular scopes when verifying scopes required for Forge UI hooks.
|
|
245
|
+
- f5d4a63: Fix unhandled error when invalid method used for Product REST API endpoint.
|
|
246
|
+
- 1f7c428: Accept both deprecated scopes and granular scopes when verifying scopes required for REST product endpoints.
|
|
247
|
+
- 2e70a0b: Accept both granular and deprecated scopes when verifying scopes required for Content Properties.
|
|
248
|
+
- Updated dependencies [debe251]
|
|
249
|
+
- Updated dependencies [037c31a5]
|
|
250
|
+
- Updated dependencies [f6901fd]
|
|
251
|
+
- Updated dependencies [813f8f3]
|
|
252
|
+
- Updated dependencies [8ee1c58]
|
|
253
|
+
- Updated dependencies [67d2e17]
|
|
254
|
+
- Updated dependencies [14102be]
|
|
255
|
+
- Updated dependencies [7b2d17a]
|
|
256
|
+
- Updated dependencies [8aaa65c]
|
|
257
|
+
- Updated dependencies [d3ccc04]
|
|
258
|
+
- Updated dependencies [5152239]
|
|
259
|
+
- @forge/manifest@3.1.0
|
|
260
|
+
- @forge/cli-shared@2.2.1
|
|
261
|
+
|
|
262
|
+
## 3.0.0-next.11
|
|
263
|
+
|
|
264
|
+
### Patch Changes
|
|
265
|
+
|
|
266
|
+
- Updated dependencies [8aaa65c]
|
|
267
|
+
- @forge/manifest@3.1.0-next.9
|
|
268
|
+
- @forge/cli-shared@2.2.1-next.9
|
|
269
|
+
|
|
270
|
+
## 3.0.0-next.10
|
|
271
|
+
|
|
272
|
+
### Patch Changes
|
|
273
|
+
|
|
274
|
+
- f5d4a636: Fix unhandled error when invalid method used for Product REST API endpoint.
|
|
275
|
+
- Updated dependencies [67d2e17c]
|
|
276
|
+
- @forge/manifest@3.1.0-next.8
|
|
277
|
+
- @forge/cli-shared@2.2.1-next.8
|
|
278
|
+
|
|
279
|
+
## 3.0.0-next.9
|
|
280
|
+
|
|
281
|
+
### Minor Changes
|
|
282
|
+
|
|
283
|
+
- 037c31a: Upgrade webpack from 4 to 5 and other relavent packages to fix the issue for node17+ (openssl change)
|
|
284
|
+
|
|
285
|
+
### Patch Changes
|
|
286
|
+
|
|
287
|
+
- Updated dependencies [037c31a]
|
|
288
|
+
- @forge/manifest@3.1.0-next.7
|
|
289
|
+
- @forge/cli-shared@2.2.1-next.7
|
|
290
|
+
|
|
291
|
+
## 3.0.0-next.8
|
|
292
|
+
|
|
293
|
+
### Minor Changes
|
|
294
|
+
|
|
295
|
+
- 83ca609e: Adding environment variables to override production swagger with local files.
|
|
296
|
+
|
|
297
|
+
## 3.0.0-next.7
|
|
298
|
+
|
|
299
|
+
### Patch Changes
|
|
300
|
+
|
|
301
|
+
- Updated dependencies [7b2d17a]
|
|
302
|
+
- @forge/manifest@3.1.0-next.6
|
|
303
|
+
- @forge/cli-shared@2.2.1-next.6
|
|
304
|
+
|
|
305
|
+
## 3.0.0-next.6
|
|
306
|
+
|
|
307
|
+
### Major Changes
|
|
308
|
+
|
|
309
|
+
- 4922d09: Only errors set the process exitCode to 1, warnings do not anymore.
|
|
310
|
+
|
|
311
|
+
## 2.0.1-next.5
|
|
312
|
+
|
|
313
|
+
### Patch Changes
|
|
314
|
+
|
|
315
|
+
- Updated dependencies [f6901fd]
|
|
316
|
+
- @forge/manifest@3.1.0-next.5
|
|
317
|
+
- @forge/cli-shared@2.2.1-next.5
|
|
318
|
+
|
|
319
|
+
## 2.0.1-next.4
|
|
320
|
+
|
|
321
|
+
### Patch Changes
|
|
322
|
+
|
|
323
|
+
- 2e70a0b: Accept both granular and deprecated scopes when verifying scopes required for Content Properties.
|
|
324
|
+
- Updated dependencies [d3ccc04]
|
|
325
|
+
- @forge/manifest@3.1.0-next.4
|
|
326
|
+
- @forge/cli-shared@2.2.1-next.4
|
|
327
|
+
|
|
328
|
+
## 2.0.1-next.3
|
|
329
|
+
|
|
330
|
+
### Patch Changes
|
|
331
|
+
|
|
332
|
+
- 1f7c428: Accept both deprecated scopes and granular scopes when verifying scopes required for REST product endpoints.
|
|
333
|
+
- Updated dependencies [debe251]
|
|
334
|
+
- @forge/manifest@3.1.0-next.3
|
|
335
|
+
- @forge/cli-shared@2.2.1-next.3
|
|
336
|
+
|
|
337
|
+
## 2.0.1-next.2
|
|
338
|
+
|
|
339
|
+
### Patch Changes
|
|
340
|
+
|
|
341
|
+
- ffa0050: Accept both deprecated scopes and granular scopes when verifying scopes required for Forge UI hooks.
|
|
342
|
+
- Updated dependencies [14102be]
|
|
343
|
+
- @forge/manifest@3.1.0-next.2
|
|
344
|
+
- @forge/cli-shared@2.2.1-next.2
|
|
345
|
+
|
|
346
|
+
## 2.0.1-next.1
|
|
347
|
+
|
|
348
|
+
### Patch Changes
|
|
349
|
+
|
|
350
|
+
- Updated dependencies [8ee1c58]
|
|
351
|
+
- @forge/manifest@3.1.0-next.1
|
|
352
|
+
- @forge/cli-shared@2.2.1-next.1
|
|
353
|
+
|
|
354
|
+
## 2.0.1-next.0
|
|
355
|
+
|
|
356
|
+
### Patch Changes
|
|
357
|
+
|
|
358
|
+
- Updated dependencies [813f8f3]
|
|
359
|
+
- Updated dependencies [5152239]
|
|
360
|
+
- @forge/manifest@3.1.0-next.0
|
|
361
|
+
- @forge/cli-shared@2.2.1-next.0
|
|
362
|
+
|
|
363
|
+
## 2.0.0
|
|
364
|
+
|
|
365
|
+
### Major Changes
|
|
366
|
+
|
|
367
|
+
- 6ceb574: Update ui-hooks to use new granular scopes
|
|
4
368
|
|
|
5
369
|
### Patch Changes
|
|
6
370
|
|
|
7
|
-
- c156c18: Reverting ui-hooks changes for Granular scopes since the release date is delayed by 2 weeks
|
|
8
371
|
- 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.
|
|
9
372
|
- Updated dependencies [bd6e025]
|
|
10
|
-
- Updated dependencies [
|
|
373
|
+
- Updated dependencies [1c196ff]
|
|
374
|
+
- Updated dependencies [271b98a]
|
|
375
|
+
- Updated dependencies [4cfa56d]
|
|
11
376
|
- Updated dependencies [22a488e]
|
|
12
|
-
- Updated dependencies [
|
|
13
|
-
- Updated dependencies [
|
|
14
|
-
- Updated dependencies [
|
|
15
|
-
- Updated dependencies [
|
|
16
|
-
- Updated dependencies [2338be5]
|
|
377
|
+
- Updated dependencies [218fe20]
|
|
378
|
+
- Updated dependencies [1dba082]
|
|
379
|
+
- Updated dependencies [2bca1c0]
|
|
380
|
+
- Updated dependencies [1dba082]
|
|
17
381
|
- Updated dependencies [689c09b]
|
|
18
382
|
- Updated dependencies [b97660c]
|
|
19
383
|
- Updated dependencies [7c0d2ee]
|
|
20
|
-
- Updated dependencies [
|
|
384
|
+
- Updated dependencies [1dba082]
|
|
21
385
|
- Updated dependencies [d3afe01]
|
|
22
386
|
- Updated dependencies [dfe9dd8]
|
|
23
387
|
- Updated dependencies [91ea057]
|
|
24
388
|
- Updated dependencies [3010f0e]
|
|
25
389
|
- Updated dependencies [2b7c32b]
|
|
390
|
+
- Updated dependencies [e7ee3a7]
|
|
26
391
|
- Updated dependencies [92d081d]
|
|
27
392
|
- Updated dependencies [d3c8c8d]
|
|
393
|
+
- Updated dependencies [fca240d]
|
|
28
394
|
- Updated dependencies [36c7c8f]
|
|
29
395
|
- Updated dependencies [d2f6992]
|
|
30
|
-
- Updated dependencies [
|
|
396
|
+
- Updated dependencies [d18c9f1]
|
|
397
|
+
- Updated dependencies [1dba082]
|
|
398
|
+
- Updated dependencies [fa963b1]
|
|
31
399
|
- Updated dependencies [0a7725f]
|
|
32
|
-
- Updated dependencies [
|
|
400
|
+
- Updated dependencies [1dba082]
|
|
33
401
|
- Updated dependencies [e4a14c7]
|
|
34
402
|
- Updated dependencies [2bb89c5]
|
|
403
|
+
- Updated dependencies [5875eb3]
|
|
35
404
|
- Updated dependencies [b63af27]
|
|
36
405
|
- Updated dependencies [0a39c43]
|
|
37
|
-
- @forge/manifest@
|
|
38
|
-
- @forge/
|
|
39
|
-
- @forge/
|
|
406
|
+
- @forge/manifest@3.0.0
|
|
407
|
+
- @forge/csp@1.9.0
|
|
408
|
+
- @forge/cli-shared@2.2.0
|
|
409
|
+
|
|
410
|
+
## 2.0.0-next.24
|
|
411
|
+
|
|
412
|
+
### Major Changes
|
|
413
|
+
|
|
414
|
+
- 6ceb574: Update ui-hooks to use new granular scopes
|
|
415
|
+
|
|
416
|
+
### Patch Changes
|
|
417
|
+
|
|
418
|
+
- Updated dependencies [4cfa56d]
|
|
419
|
+
- Updated dependencies [fca240d]
|
|
420
|
+
- @forge/manifest@3.0.0-next.21
|
|
421
|
+
- @forge/cli-shared@2.2.0-next.22
|
|
422
|
+
|
|
423
|
+
## 2.0.0-next.23
|
|
424
|
+
|
|
425
|
+
### Patch Changes
|
|
426
|
+
|
|
427
|
+
- Updated dependencies [271b98a]
|
|
428
|
+
- Updated dependencies [2bca1c0]
|
|
429
|
+
- @forge/manifest@2.6.0-next.20
|
|
430
|
+
- @forge/cli-shared@2.2.0-next.21
|
|
431
|
+
|
|
432
|
+
## 2.0.0-next.22
|
|
433
|
+
|
|
434
|
+
### Patch Changes
|
|
435
|
+
|
|
436
|
+
- Updated dependencies [d18c9f1]
|
|
437
|
+
- Updated dependencies [5875eb3]
|
|
438
|
+
- @forge/manifest@2.6.0-next.19
|
|
439
|
+
- @forge/cli-shared@2.2.0-next.20
|
|
440
|
+
|
|
441
|
+
## 2.0.0-next.21
|
|
442
|
+
|
|
443
|
+
### Patch Changes
|
|
444
|
+
|
|
445
|
+
- Updated dependencies [1c196ff]
|
|
446
|
+
- Updated dependencies [e7ee3a7]
|
|
447
|
+
- @forge/csp@1.9.0-next.1
|
|
448
|
+
- @forge/manifest@2.6.0-next.18
|
|
449
|
+
- @forge/cli-shared@2.2.0-next.19
|
|
450
|
+
|
|
451
|
+
## 2.0.0-next.20
|
|
452
|
+
|
|
453
|
+
### Patch Changes
|
|
454
|
+
|
|
455
|
+
- Updated dependencies [fa963b1]
|
|
456
|
+
- @forge/manifest@2.6.0-next.17
|
|
457
|
+
- @forge/cli-shared@2.2.0-next.18
|
|
458
|
+
|
|
459
|
+
## 2.0.0-next.19
|
|
460
|
+
|
|
461
|
+
### Patch Changes
|
|
462
|
+
|
|
463
|
+
- Updated dependencies [218fe20]
|
|
464
|
+
- @forge/manifest@2.6.0-next.16
|
|
465
|
+
- @forge/cli-shared@2.2.0-next.17
|
|
40
466
|
|
|
41
467
|
## 2.0.0-next.18
|
|
42
468
|
|
package/out/lint/lint.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/lint/lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;AAIpB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAQxG,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,WAAY,UAAU,eAAe,UAAU,EAAE,4BAAuB,
|
|
1
|
+
{"version":3,"file":"lint.d.ts","sourceRoot":"","sources":["../../src/lint/lint.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,MAAM,IAAI,CAAC;AAIpB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAQxG,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,iBAAiB,WAAY,UAAU,eAAe,UAAU,EAAE,4BAAuB,IA+CrG,CAAC;AAEF,eAAO,MAAM,YAAY,gBAAiB,UAAU,EAAE,KAAG,YAQxD,CAAC;AAEF,eAAO,MAAM,eAAe,aAChB,MAAM,UACR,OAAO,QAAQ,oBACN,OAAO,EAAE,CAAC,QAAQ,CAAC,aAAa,KAChD,OAAO,CAAC,SAAS,CAOnB,CAAC;AAEF,eAAO,MAAM,IAAI,gBACF,MAAM,EAAE,YACX,QAAQ,eACL,MAAM,UACX,UAAU,6BAhBR,MAAM,UACR,OAAO,QAAQ,oBACN,OAAO,EAAE,CAAC,QAAQ,CAAC,aAAa,KAChD,OAAO,CAAC,SAAS,CAAC,YAeV,eAAe,EAAE,KAOzB,OAAO,CAAC,UAAU,EAAE,CAmCtB,CAAC;AAEF,eAAO,MAAM,QAAQ,WACX,UAAU,WACV,eAAe,KACtB,OAAO,CAAC,UAAU,EAAE,CAGtB,CAAC"}
|
package/out/lint/lint.js
CHANGED
|
@@ -55,7 +55,9 @@ exports.reportLintResults = (logger, lintResults, showSummary = true) => {
|
|
|
55
55
|
logger.info(cli_shared_1.Text.lint.noFixableProblems);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
|
|
58
|
+
if (numErrors) {
|
|
59
|
+
process.exitCode = 1;
|
|
60
|
+
}
|
|
59
61
|
}
|
|
60
62
|
};
|
|
61
63
|
exports.problemCount = (lintResults) => {
|
|
@@ -32,6 +32,7 @@ export declare class PermissionLinter extends BaseLinter<ApiCall, PermissionLint
|
|
|
32
32
|
protected getFixer(): ((errors: LintResultRule[], warnings: LintResultRule[], state: LintFixState) => Promise<LintFixState>) | undefined;
|
|
33
33
|
protected addLintCriteriaMatch(apiCall: ApiCall, filepath: string): void;
|
|
34
34
|
getProductPaths(cacheKey: string, url: string): Promise<SwaggerFormat>;
|
|
35
|
+
getProductPathsFile(url: string): Promise<SwaggerFormat>;
|
|
35
36
|
private processPaths;
|
|
36
37
|
}
|
|
37
38
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permission-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/permission-linter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAe,MAAM,iBAAiB,CAAC;AAE/E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACL,OAAO,EAEP,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,WAAW,EAGZ,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"permission-linter.d.ts","sourceRoot":"","sources":["../../../../src/lint/linters/permission-linter/permission-linter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,IAAI,QAAQ,EAAe,MAAM,iBAAiB,CAAC;AAE/E,OAAO,UAAU,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EACL,OAAO,EAEP,eAAe,EACf,cAAc,EACd,cAAc,EACd,aAAa,EACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,WAAW,EAGZ,MAAM,aAAa,CAAC;AAUrB,UAAU,aAAa;IACrB,KAAK,EAAE;QACL,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;KAC7B,CAAC;CACH;AAED,eAAO,MAAM,mBAAmB,eAAe,CAAC;AAKhD,eAAO,MAAM,sBAAsB,WACzB,cAAc,EAAE,YACd,cAAc,EAAE,mBACT,mBAAmB,GAAG,gCAAgC,GAAG,+BAA+B,uCAExG,GAAG,CAAC,MAAM,CAkBZ,CAAC;AAEF,eAAO,MAAM,qBAAqB,WACxB,cAAc,EAAE,YACd,cAAc,EAAE,SACnB,YAAY,KAClB,OAAO,CAAC,YAAY,CAsEtB,CAAC;AAEF,UAAU,6BAA6B;IACrC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,EAAE,CAAC;IACzB,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,IAAI,EAAE,cAAc,EAAE,CAAC;IACvB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,QAAQ,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED,qBAAa,gBAAiB,SAAQ,UAAU,CAAC,OAAO,EAAE,6BAA6B,EAAE,OAAO,EAAE,CAAC;IAQhE,OAAO,CAAC,QAAQ;IAPjD,MAAM,CAAC,cAAc,SAAgC;IACrD,MAAM,CAAC,oBAAoB,SAAsC;IAEjE,OAAO,CAAC,IAAI,CAAC,CAA0B;IACvC,OAAO,CAAC,UAAU,CAAC,CAA0B;IAC7C,OAAO,CAAC,KAAK,CAAC,CAAa;gBAEf,WAAW,EAAE,MAAM,EAAU,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU;IAIlE,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IA4CvC,SAAS,CAAC,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAajD,SAAS,CAAC,QAAQ,IACd,CAAC,CAAC,MAAM,EAAE,cAAc,EAAE,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,KAAK,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC,GACtG,SAAS;IAIb,SAAS,CAAC,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAsB3D,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAWtE,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAKrE,OAAO,CAAC,YAAY;CAarB"}
|
|
@@ -8,6 +8,7 @@ const base_linter_1 = tslib_1.__importDefault(require("../../base-linter"));
|
|
|
8
8
|
const api_call_interface_1 = require("./api-call-interface");
|
|
9
9
|
const verifiers_1 = require("./verifiers");
|
|
10
10
|
const visitors_1 = require("./visitors");
|
|
11
|
+
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
11
12
|
exports.NON_FWD_SLASH_REGEX = '[^\\/\\s]*';
|
|
12
13
|
const CACHE_KEY = 'PERMISSIONS_LINTER';
|
|
13
14
|
const ONE_HOUR_MS = 1000 * 60 * 60;
|
|
@@ -81,10 +82,20 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
81
82
|
}
|
|
82
83
|
async bootstrap() {
|
|
83
84
|
this.cache = cli_shared_1.CachedConf.getCache(CACHE_KEY);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
const LOCAL_CONF_SWAGGER = process.env.LOCAL_CONF_SWAGGER;
|
|
86
|
+
const LOCAL_JIRA_SWAGGER = process.env.LOCAL_JIRA_SWAGGER;
|
|
87
|
+
const USE_LOCAL_SWAGGER = process.env.USE_LOCAL_SWAGGER;
|
|
88
|
+
let swaggerFiles;
|
|
89
|
+
if (USE_LOCAL_SWAGGER && LOCAL_CONF_SWAGGER && LOCAL_JIRA_SWAGGER) {
|
|
90
|
+
swaggerFiles = [this.getProductPathsFile(LOCAL_JIRA_SWAGGER), this.getProductPathsFile(LOCAL_CONF_SWAGGER)];
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
swaggerFiles = [
|
|
94
|
+
this.getProductPaths(PermissionLinter.JIRA_CACHE_KEY, 'https://developer.atlassian.com/cloud/jira/platform/swagger-v3.v3.json'),
|
|
95
|
+
this.getProductPaths(PermissionLinter.CONFLUENCE_CACHE_KEY, 'https://developer.atlassian.com/cloud/confluence/swagger.v3.json')
|
|
96
|
+
];
|
|
97
|
+
}
|
|
98
|
+
const [jira, confluence] = await Promise.all(swaggerFiles);
|
|
88
99
|
this.jira = this.processPaths(jira.paths);
|
|
89
100
|
this.confluence = this.processPaths(confluence.paths);
|
|
90
101
|
this.nodeVisitors = [
|
|
@@ -150,6 +161,10 @@ class PermissionLinter extends base_linter_1.default {
|
|
|
150
161
|
}
|
|
151
162
|
return cached;
|
|
152
163
|
}
|
|
164
|
+
async getProductPathsFile(url) {
|
|
165
|
+
const response = fs_1.default.readFileSync(url);
|
|
166
|
+
return JSON.parse(response.toString());
|
|
167
|
+
}
|
|
153
168
|
processPaths(paths) {
|
|
154
169
|
const pathMap = new Map();
|
|
155
170
|
Object.keys(paths).forEach((path) => {
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { LintClass, LintResultRule } from '../../../linter-interface';
|
|
2
2
|
import { BaseLintIssueVerifier, LintIssueVerifier } from '../../verifier-interface';
|
|
3
3
|
import { ContentPropertyApiCall } from '../api-call-interface';
|
|
4
|
-
|
|
4
|
+
declare type ContentPropertyPermissions = {
|
|
5
|
+
current: string[];
|
|
6
|
+
deprecated: string[];
|
|
7
|
+
};
|
|
8
|
+
export declare const CONTENT_PROPERTY_PERMISSIONS_MAP: Record<string, Record<string, ContentPropertyPermissions>>;
|
|
5
9
|
export declare class ContentPropertyVerifier extends BaseLintIssueVerifier implements LintIssueVerifier<ContentPropertyApiCall[]> {
|
|
6
10
|
protected getLintClass(): LintClass;
|
|
7
11
|
process(apiCalls: ContentPropertyApiCall[]): Promise<LintResultRule[]>;
|
|
8
12
|
private getMissingScopes;
|
|
9
13
|
}
|
|
14
|
+
export {};
|
|
10
15
|
//# sourceMappingURL=content-property-verifier.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-property-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/content-property-verifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,
|
|
1
|
+
{"version":3,"file":"content-property-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/content-property-verifier.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AACpF,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,aAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,0BAA0B,CAAC,CAyDvG,CAAC;AAEF,qBAAa,uBACX,SAAQ,qBACR,YAAW,iBAAiB,CAAC,sBAAsB,EAAE,CAAC;IACtD,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,sBAAsB,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAuBnF,OAAO,CAAC,gBAAgB;CAyBzB"}
|
|
@@ -7,24 +7,60 @@ const text_1 = require("../../../text");
|
|
|
7
7
|
const verifier_interface_1 = require("../../verifier-interface");
|
|
8
8
|
exports.CONTENT_PROPERTY_PERMISSIONS_MAP = {
|
|
9
9
|
onJiraIssue: {
|
|
10
|
-
get:
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
get: {
|
|
11
|
+
current: ['read:issue.property:jira'],
|
|
12
|
+
deprecated: ['read:jira-work']
|
|
13
|
+
},
|
|
14
|
+
set: {
|
|
15
|
+
current: ['write:issue.property:jira'],
|
|
16
|
+
deprecated: ['write:jira-work']
|
|
17
|
+
},
|
|
18
|
+
delete: {
|
|
19
|
+
current: ['delete:issue.property:jira'],
|
|
20
|
+
deprecated: ['write:jira-work']
|
|
21
|
+
}
|
|
13
22
|
},
|
|
14
23
|
onJiraProject: {
|
|
15
|
-
get:
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
get: {
|
|
25
|
+
current: ['read:project.property:jira'],
|
|
26
|
+
deprecated: ['read:jira-work']
|
|
27
|
+
},
|
|
28
|
+
set: {
|
|
29
|
+
current: ['write:project.property:jira'],
|
|
30
|
+
deprecated: ['manage:jira-project']
|
|
31
|
+
},
|
|
32
|
+
delete: {
|
|
33
|
+
current: ['delete:project.property:jira'],
|
|
34
|
+
deprecated: ['manage:jira-project']
|
|
35
|
+
}
|
|
18
36
|
},
|
|
19
37
|
onConfluencePage: {
|
|
20
|
-
get:
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
get: {
|
|
39
|
+
current: ['read:content-details:confluence'],
|
|
40
|
+
deprecated: ['read:confluence-props']
|
|
41
|
+
},
|
|
42
|
+
set: {
|
|
43
|
+
current: ['read:content.property:confluence', 'write:content.property:confluence'],
|
|
44
|
+
deprecated: ['read:confluence-props', 'write:confluence-props']
|
|
45
|
+
},
|
|
46
|
+
delete: {
|
|
47
|
+
current: ['write:content.property:confluence'],
|
|
48
|
+
deprecated: ['write:confluence-props']
|
|
49
|
+
}
|
|
23
50
|
},
|
|
24
51
|
onConfluenceSpace: {
|
|
25
|
-
get:
|
|
26
|
-
|
|
27
|
-
|
|
52
|
+
get: {
|
|
53
|
+
current: ['read:content-details:confluence'],
|
|
54
|
+
deprecated: ['read:confluence-props']
|
|
55
|
+
},
|
|
56
|
+
set: {
|
|
57
|
+
current: ['read:space.property:confluence', 'write:space.property:confluence'],
|
|
58
|
+
deprecated: ['read:confluence-props', 'write:confluence-props']
|
|
59
|
+
},
|
|
60
|
+
delete: {
|
|
61
|
+
current: ['write:space.property:confluence'],
|
|
62
|
+
deprecated: ['write:confluence-props']
|
|
63
|
+
}
|
|
28
64
|
}
|
|
29
65
|
};
|
|
30
66
|
class ContentPropertyVerifier extends verifier_interface_1.BaseLintIssueVerifier {
|
|
@@ -50,10 +86,24 @@ class ContentPropertyVerifier extends verifier_interface_1.BaseLintIssueVerifier
|
|
|
50
86
|
getMissingScopes({ context, method }) {
|
|
51
87
|
var _a, _b;
|
|
52
88
|
const existingScopes = (_b = (_a = this.manifest) === null || _a === void 0 ? void 0 : _a.permissions) === null || _b === void 0 ? void 0 : _b.scopes;
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
89
|
+
const requiredScopesCurrent = exports.CONTENT_PROPERTY_PERMISSIONS_MAP[context][method]['current'];
|
|
90
|
+
const requiredScopesDeprecated = exports.CONTENT_PROPERTY_PERMISSIONS_MAP[context][method]['deprecated'];
|
|
91
|
+
const missingCurrentPerms = requiredScopesCurrent.filter((perm) => !(existingScopes === null || existingScopes === void 0 ? void 0 : existingScopes.includes(perm)));
|
|
92
|
+
if (missingCurrentPerms.length == 0)
|
|
93
|
+
return [];
|
|
94
|
+
let missingDeprecatedPerms = null;
|
|
95
|
+
if (requiredScopesDeprecated) {
|
|
96
|
+
missingDeprecatedPerms = requiredScopesDeprecated.filter((perm) => !(existingScopes === null || existingScopes === void 0 ? void 0 : existingScopes.includes(perm)));
|
|
97
|
+
if (missingDeprecatedPerms.length == 0)
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
if (missingCurrentPerms.length < requiredScopesCurrent.length) {
|
|
101
|
+
return missingCurrentPerms;
|
|
102
|
+
}
|
|
103
|
+
if (missingDeprecatedPerms && missingDeprecatedPerms.length < requiredScopesDeprecated.length) {
|
|
104
|
+
return missingDeprecatedPerms;
|
|
105
|
+
}
|
|
106
|
+
return requiredScopesCurrent;
|
|
57
107
|
}
|
|
58
108
|
}
|
|
59
109
|
exports.ContentPropertyVerifier = ContentPropertyVerifier;
|
|
@@ -27,6 +27,7 @@ export declare class ProductVerifier extends BaseLintIssueVerifier implements Li
|
|
|
27
27
|
private lookupApiCall;
|
|
28
28
|
private getMissingPermissionScopes;
|
|
29
29
|
private getRequiredScopes;
|
|
30
|
+
private getRequiredDeprecatedScopes;
|
|
30
31
|
}
|
|
31
32
|
export {};
|
|
32
33
|
//# sourceMappingURL=product-verifier.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/product-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGpF,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,MAAM,EAAE,MAAM,GAAG;QAChB,QAAQ,EAAE,aAAa,EAAE,CAAC;QAC1B,2BAA2B,CAAC,EAAE,qBAAqB,EAAE,CAAC;KACvD,CAAC;CACH;AAED,UAAU,aAAa;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B;AAED,oBAAY,uBAAuB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEjE,qBAAa,eAAgB,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAI9F,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAHxB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,EACD,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,MAAM;IAKlC,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAoC3E,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,0BAA0B;
|
|
1
|
+
{"version":3,"file":"product-verifier.d.ts","sourceRoot":"","sources":["../../../../../src/lint/linters/permission-linter/verifiers/product-verifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGpF,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;AAE7D,MAAM,WAAW,aAAa;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,MAAM,WAAW,WAAW;IAC1B,CAAC,MAAM,EAAE,MAAM,GAAG;QAChB,QAAQ,EAAE,aAAa,EAAE,CAAC;QAC1B,2BAA2B,CAAC,EAAE,qBAAqB,EAAE,CAAC;KACvD,CAAC;CACH;AAED,UAAU,aAAa;IACrB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC9B;AAED,oBAAY,uBAAuB,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEjE,qBAAa,eAAgB,SAAQ,qBAAsB,YAAW,iBAAiB,CAAC,OAAO,EAAE,CAAC;IAI9F,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAHxB,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,QAAQ,EACD,OAAO,EAAE,uBAAuB,EAChC,OAAO,EAAE,MAAM;IAKlC,SAAS,CAAC,YAAY,IAAI,SAAS;IAItB,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAoC3E,OAAO,CAAC,aAAa;IAerB,OAAO,CAAC,0BAA0B;IA8BlC,OAAO,CAAC,iBAAiB;IAqBzB,OAAO,CAAC,2BAA2B;CAWpC"}
|
|
@@ -53,24 +53,46 @@ class ProductVerifier extends verifier_interface_1.BaseLintIssueVerifier {
|
|
|
53
53
|
}
|
|
54
54
|
getMissingPermissionScopes(apiCall) {
|
|
55
55
|
var _a, _b, _c;
|
|
56
|
-
const
|
|
56
|
+
const currentScopes = this.getRequiredScopes(apiCall);
|
|
57
|
+
const deprecatedScopes = this.getRequiredDeprecatedScopes(apiCall);
|
|
57
58
|
if (!((_c = (_b = (_a = this.manifest) === null || _a === void 0 ? void 0 : _a.permissions) === null || _b === void 0 ? void 0 : _b.scopes) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
58
|
-
return
|
|
59
|
+
return currentScopes;
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
+
const missingCurrentScopes = currentScopes.filter((scope) => { 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(scope)); });
|
|
62
|
+
if (!missingCurrentScopes.length)
|
|
63
|
+
return [];
|
|
64
|
+
const missingDeprecatedScopes = deprecatedScopes.filter((scope) => { 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(scope)); });
|
|
65
|
+
if (deprecatedScopes.length && !missingDeprecatedScopes.length)
|
|
66
|
+
return [];
|
|
67
|
+
if (missingCurrentScopes.length < currentScopes.length) {
|
|
68
|
+
return missingCurrentScopes;
|
|
69
|
+
}
|
|
70
|
+
if (missingDeprecatedScopes.length < deprecatedScopes.length) {
|
|
71
|
+
return missingDeprecatedScopes;
|
|
72
|
+
}
|
|
73
|
+
return missingCurrentScopes;
|
|
61
74
|
}
|
|
62
75
|
getRequiredScopes({ regex, method }) {
|
|
63
|
-
var _a, _b, _c;
|
|
76
|
+
var _a, _b, _c, _d;
|
|
64
77
|
if (!regex)
|
|
65
78
|
return [];
|
|
66
|
-
const oAuth2Scopes = (_a = this.pathMap.get(regex)) === null || _a === void 0 ? void 0 : _a.methods[method]['x-atlassian-oauth2-scopes'];
|
|
79
|
+
const oAuth2Scopes = (_b = (_a = this.pathMap.get(regex)) === null || _a === void 0 ? void 0 : _a.methods[method]) === null || _b === void 0 ? void 0 : _b['x-atlassian-oauth2-scopes'];
|
|
67
80
|
if (oAuth2Scopes) {
|
|
68
81
|
return array_prototype_flatmap_1.default(oAuth2Scopes.filter((scope) => scope.state === 'Current').map((scope) => scope.scopes), (x) => x);
|
|
69
82
|
}
|
|
70
|
-
const swaggerEntries = (
|
|
83
|
+
const swaggerEntries = (_d = (_c = this.pathMap.get(regex)) === null || _c === void 0 ? void 0 : _c.methods[method]) === null || _d === void 0 ? void 0 : _d.security;
|
|
71
84
|
if (!swaggerEntries)
|
|
72
85
|
return [];
|
|
73
86
|
return swaggerEntries === null || swaggerEntries === void 0 ? void 0 : swaggerEntries.reduce((prev, curr) => [...prev, ...(curr['OAuth2'] || []), ...(curr['oAuthDefinitions'] || [])], []);
|
|
74
87
|
}
|
|
88
|
+
getRequiredDeprecatedScopes({ regex, method }) {
|
|
89
|
+
var _a, _b;
|
|
90
|
+
if (!regex)
|
|
91
|
+
return [];
|
|
92
|
+
const oAuth2Scopes = (_b = (_a = this.pathMap.get(regex)) === null || _a === void 0 ? void 0 : _a.methods[method]) === null || _b === void 0 ? void 0 : _b['x-atlassian-oauth2-scopes'];
|
|
93
|
+
if (!oAuth2Scopes)
|
|
94
|
+
return [];
|
|
95
|
+
return array_prototype_flatmap_1.default(oAuth2Scopes.filter((scope) => scope.state === 'Deprecated').map((scope) => scope.scopes), (x) => x);
|
|
96
|
+
}
|
|
75
97
|
}
|
|
76
98
|
exports.ProductVerifier = ProductVerifier;
|
|
@@ -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,9 +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
|
-
|
|
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
|
+
}
|
|
11
24
|
};
|
|
12
25
|
class UIHookVerifier extends verifier_interface_1.BaseLintIssueVerifier {
|
|
13
26
|
getLintClass() {
|
|
@@ -15,17 +28,30 @@ class UIHookVerifier extends verifier_interface_1.BaseLintIssueVerifier {
|
|
|
15
28
|
}
|
|
16
29
|
async process(apiCalls) {
|
|
17
30
|
const rules = [];
|
|
18
|
-
|
|
31
|
+
for (const apiCall of apiCalls) {
|
|
19
32
|
const requiredPermissions = FORGE_UI_HOOK_PERMISSIONS[apiCall.hookName];
|
|
20
33
|
if (!requiredPermissions)
|
|
21
34
|
return rules;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
+
}
|
|
29
55
|
return rules;
|
|
30
56
|
}
|
|
31
57
|
getHookRule(apiCall, permission) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/lint",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-490cfcf",
|
|
4
4
|
"description": "Linting for forge apps",
|
|
5
5
|
"main": "out/index.js",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@types/cross-spawn": "^6.0.1",
|
|
14
|
-
"@types/eslint": "
|
|
14
|
+
"@types/eslint": "8.2.2",
|
|
15
15
|
"@types/node-fetch": "^2.5.7"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@forge/cli-shared": "0.0.0-experimental-
|
|
19
|
-
"@forge/csp": "
|
|
20
|
-
"@forge/manifest": "0.0.0-experimental-
|
|
18
|
+
"@forge/cli-shared": "0.0.0-experimental-490cfcf",
|
|
19
|
+
"@forge/csp": "1.10.0",
|
|
20
|
+
"@forge/manifest": "0.0.0-experimental-490cfcf",
|
|
21
21
|
"@typescript-eslint/typescript-estree": "^3.5.0",
|
|
22
22
|
"cross-spawn": "^7.0.1",
|
|
23
|
-
"node-fetch": "
|
|
23
|
+
"node-fetch": "2.6.1",
|
|
24
24
|
"atlassian-openapi": "^1.0.13"
|
|
25
25
|
}
|
|
26
26
|
}
|