@backstage/plugin-catalog-backend-module-msgraph 0.10.3 → 0.10.4

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,22 @@
1
1
  # @backstage/plugin-catalog-backend-module-msgraph
2
2
 
3
+ ## 0.10.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 06bf22e: Configuring `userGroupMember.path` together with `user.filter` is now rejected with a configuration error, as the two options are mutually exclusive. This matches the existing validation for `userGroupMember.filter` and `userGroupMember.search`.
8
+ - Updated dependencies
9
+ - @backstage/backend-plugin-api@1.9.3
10
+ - @backstage/plugin-catalog-node@2.2.3
11
+
12
+ ## 0.10.4-next.0
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies
17
+ - @backstage/backend-plugin-api@1.9.3-next.0
18
+ - @backstage/plugin-catalog-node@2.2.3-next.0
19
+
3
20
  ## 0.10.3
4
21
 
5
22
  ### Patch Changes
@@ -0,0 +1,641 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "catalog": {
6
+ "type": "object",
7
+ "properties": {
8
+ "processors": {
9
+ "type": "object",
10
+ "properties": {
11
+ "microsoftGraphOrg": {
12
+ "type": "object",
13
+ "properties": {
14
+ "providers": {
15
+ "type": "array",
16
+ "items": {
17
+ "type": "object",
18
+ "properties": {
19
+ "target": {
20
+ "type": "string",
21
+ "description": "The prefix of the target that this matches on, e.g. \"https://graph.microsoft.com/v1.0\", with no trailing slash."
22
+ },
23
+ "authority": {
24
+ "type": "string",
25
+ "description": "The auth authority used.\n\nDefault value \"https://login.microsoftonline.com\""
26
+ },
27
+ "tenantId": {
28
+ "type": "string",
29
+ "description": "The tenant whose org data we are interested in."
30
+ },
31
+ "clientId": {
32
+ "type": "string",
33
+ "description": "The OAuth client ID to use for authenticating requests."
34
+ },
35
+ "clientSecret": {
36
+ "type": "string",
37
+ "description": "The OAuth client secret to use for authenticating requests.",
38
+ "visibility": "secret"
39
+ },
40
+ "userFilter": {
41
+ "type": "string",
42
+ "description": "The filter to apply to extract users. Disabled users (`accountEnabled === false`) are always filtered out client-side regardless of this setting.\n\nE.g. \"userType eq 'member'\""
43
+ },
44
+ "groupFilter": {
45
+ "type": "string",
46
+ "description": "The filter to apply to extract groups.\n\nE.g. \"securityEnabled eq false and mailEnabled eq true\""
47
+ },
48
+ "userSelect": {
49
+ "type": "array",
50
+ "items": {
51
+ "type": "string"
52
+ },
53
+ "description": "The fields to be fetched on query.\n\nE.g. [\"id\", \"displayName\", \"description\"]"
54
+ },
55
+ "groupSearch": {
56
+ "type": "string",
57
+ "description": "The search criteria to apply to extract users by groups memberships.\n\nE.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'"
58
+ },
59
+ "groupSelect": {
60
+ "type": "array",
61
+ "items": {
62
+ "type": "string"
63
+ },
64
+ "description": "The fields to be fetched on query.\n\nE.g. [\"id\", \"displayName\", \"description\"]"
65
+ },
66
+ "userGroupMemberFilter": {
67
+ "type": "string",
68
+ "description": "The filter to apply to extract users by groups memberships.\n\nE.g. \"displayName eq 'Backstage Users'\""
69
+ },
70
+ "userGroupMemberSearch": {
71
+ "type": "string",
72
+ "description": "The search criteria to apply to extract groups.\n\nE.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'"
73
+ }
74
+ },
75
+ "required": [
76
+ "target",
77
+ "tenantId"
78
+ ]
79
+ },
80
+ "description": "The configuration parameters for each single Microsoft Graph provider."
81
+ }
82
+ },
83
+ "required": [
84
+ "providers"
85
+ ],
86
+ "description": "MicrosoftGraphOrgReaderProcessor configuration",
87
+ "deprecated": "Use `catalog.providers.microsoftGraphOrg` instead."
88
+ }
89
+ }
90
+ },
91
+ "providers": {
92
+ "type": "object",
93
+ "properties": {
94
+ "microsoftGraphOrg": {
95
+ "anyOf": [
96
+ {
97
+ "type": "object",
98
+ "properties": {
99
+ "target": {
100
+ "type": "string",
101
+ "description": "The prefix of the target that this matches on, e.g. \"https://graph.microsoft.com/v1.0\", with no trailing slash."
102
+ },
103
+ "authority": {
104
+ "type": "string",
105
+ "description": "The auth authority used.\n\nDefault value \"https://login.microsoftonline.com\""
106
+ },
107
+ "tenantId": {
108
+ "type": "string",
109
+ "description": "The tenant whose org data we are interested in."
110
+ },
111
+ "clientId": {
112
+ "type": "string",
113
+ "description": "The OAuth client ID to use for authenticating requests."
114
+ },
115
+ "clientSecret": {
116
+ "type": "string",
117
+ "description": "The OAuth client secret to use for authenticating requests.",
118
+ "visibility": "secret"
119
+ },
120
+ "queryMode": {
121
+ "type": "string",
122
+ "description": "By default, the Microsoft Graph API only provides the basic feature set for querying. Certain features are limited to advanced query capabilities (see https://docs.microsoft.com/en-us/graph/aad-advanced-queries) and need to be enabled.\n\nSome features like `$expand` are not available for advanced queries, though."
123
+ },
124
+ "user": {
125
+ "type": "object",
126
+ "properties": {
127
+ "path": {
128
+ "type": "string",
129
+ "description": "The url path to fetch groups, defaults to `/users`.\n\nE.g. \"groups/{id}/transitiveMembers/microsoft.graph.user/\"."
130
+ },
131
+ "expand": {
132
+ "type": "string",
133
+ "description": "The \"expand\" argument to apply to users.\n\nE.g. \"manager\"."
134
+ },
135
+ "filter": {
136
+ "type": "string",
137
+ "description": "The filter to apply to extract users. Disabled users (`accountEnabled === false`) are always filtered out client-side regardless of this setting.\n\nE.g. \"userType eq 'member'\""
138
+ },
139
+ "loadPhotos": {
140
+ "type": "boolean",
141
+ "description": "Set to false to not load user photos. This can be useful for huge organizations."
142
+ },
143
+ "select": {
144
+ "type": "array",
145
+ "items": {
146
+ "type": "string"
147
+ },
148
+ "description": "The fields to be fetched on query.\n\nE.g. [\"id\", \"displayName\", \"description\"]"
149
+ }
150
+ }
151
+ },
152
+ "group": {
153
+ "type": "object",
154
+ "properties": {
155
+ "path": {
156
+ "type": "string",
157
+ "description": "The url path to fetch groups, defaults to `/groups`.\n\nE.g. \"groups/{id}/transitiveMembers/microsoft.graph.group/\"."
158
+ },
159
+ "expand": {
160
+ "type": "string",
161
+ "description": "The \"expand\" argument to apply to groups.\n\nE.g. \"member\"."
162
+ },
163
+ "filter": {
164
+ "type": "string",
165
+ "description": "The filter to apply to extract groups.\n\nE.g. \"securityEnabled eq false and mailEnabled eq true\""
166
+ },
167
+ "search": {
168
+ "type": "string",
169
+ "description": "The search criteria to apply to extract users by groups memberships.\n\nE.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'"
170
+ },
171
+ "select": {
172
+ "type": "array",
173
+ "items": {
174
+ "type": "string"
175
+ },
176
+ "description": "The fields to be fetched on query.\n\nE.g. [\"id\", \"displayName\", \"description\"]"
177
+ },
178
+ "includeSubGroups": {
179
+ "type": "boolean",
180
+ "description": "Whether to ingest groups that are members of the found/filtered/searched groups. Default value is `false`."
181
+ }
182
+ }
183
+ },
184
+ "userGroupMember": {
185
+ "type": "object",
186
+ "properties": {
187
+ "path": {
188
+ "type": "string",
189
+ "description": "The url path to fetch groups, defaults to `/groups`.\n\nE.g. \"groups/{id}/transitiveMembers/microsoft.graph.group/\"."
190
+ },
191
+ "filter": {
192
+ "type": "string",
193
+ "description": "The filter to apply to extract users by groups memberships.\n\nE.g. \"displayName eq 'Backstage Users'\""
194
+ },
195
+ "search": {
196
+ "type": "string",
197
+ "description": "The search criteria to apply to extract groups.\n\nE.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'"
198
+ }
199
+ }
200
+ },
201
+ "schedule": {
202
+ "type": "object",
203
+ "properties": {
204
+ "frequency": {
205
+ "anyOf": [
206
+ {
207
+ "type": "object",
208
+ "properties": {
209
+ "cron": {
210
+ "type": "string",
211
+ "description": "A crontab style string."
212
+ }
213
+ },
214
+ "required": [
215
+ "cron"
216
+ ]
217
+ },
218
+ {
219
+ "type": "string"
220
+ },
221
+ {
222
+ "type": "object",
223
+ "properties": {
224
+ "years": {
225
+ "type": "number"
226
+ },
227
+ "months": {
228
+ "type": "number"
229
+ },
230
+ "weeks": {
231
+ "type": "number"
232
+ },
233
+ "days": {
234
+ "type": "number"
235
+ },
236
+ "hours": {
237
+ "type": "number"
238
+ },
239
+ "minutes": {
240
+ "type": "number"
241
+ },
242
+ "seconds": {
243
+ "type": "number"
244
+ },
245
+ "milliseconds": {
246
+ "type": "number"
247
+ }
248
+ },
249
+ "description": "Human friendly durations object."
250
+ },
251
+ {
252
+ "type": "object",
253
+ "properties": {
254
+ "trigger": {
255
+ "type": "string",
256
+ "const": "manual"
257
+ }
258
+ },
259
+ "required": [
260
+ "trigger"
261
+ ]
262
+ }
263
+ ],
264
+ "description": "How often you want the task to run. The system does its best to avoid overlapping invocations."
265
+ },
266
+ "timeout": {
267
+ "anyOf": [
268
+ {
269
+ "type": "string"
270
+ },
271
+ {
272
+ "type": "object",
273
+ "properties": {
274
+ "years": {
275
+ "type": "number"
276
+ },
277
+ "months": {
278
+ "type": "number"
279
+ },
280
+ "weeks": {
281
+ "type": "number"
282
+ },
283
+ "days": {
284
+ "type": "number"
285
+ },
286
+ "hours": {
287
+ "type": "number"
288
+ },
289
+ "minutes": {
290
+ "type": "number"
291
+ },
292
+ "seconds": {
293
+ "type": "number"
294
+ },
295
+ "milliseconds": {
296
+ "type": "number"
297
+ }
298
+ },
299
+ "description": "Human friendly durations object."
300
+ }
301
+ ],
302
+ "description": "The maximum amount of time that a single task invocation can take, before it's considered timed out and gets \"released\" such that a new invocation is permitted to take place (possibly, then, on a different worker)."
303
+ },
304
+ "initialDelay": {
305
+ "anyOf": [
306
+ {
307
+ "type": "string"
308
+ },
309
+ {
310
+ "type": "object",
311
+ "properties": {
312
+ "years": {
313
+ "type": "number"
314
+ },
315
+ "months": {
316
+ "type": "number"
317
+ },
318
+ "weeks": {
319
+ "type": "number"
320
+ },
321
+ "days": {
322
+ "type": "number"
323
+ },
324
+ "hours": {
325
+ "type": "number"
326
+ },
327
+ "minutes": {
328
+ "type": "number"
329
+ },
330
+ "seconds": {
331
+ "type": "number"
332
+ },
333
+ "milliseconds": {
334
+ "type": "number"
335
+ }
336
+ },
337
+ "description": "Human friendly durations object."
338
+ }
339
+ ],
340
+ "description": "The amount of time that should pass before the first invocation happens."
341
+ },
342
+ "scope": {
343
+ "type": "string",
344
+ "enum": [
345
+ "global",
346
+ "local"
347
+ ],
348
+ "description": "Sets the scope of concurrency control / locking to apply for invocations of this task."
349
+ }
350
+ },
351
+ "required": [
352
+ "frequency",
353
+ "timeout"
354
+ ],
355
+ "description": "(Optional) TaskScheduleDefinition for the refresh."
356
+ }
357
+ },
358
+ "required": [
359
+ "tenantId"
360
+ ]
361
+ },
362
+ {
363
+ "type": "object",
364
+ "additionalProperties": {
365
+ "type": "object",
366
+ "properties": {
367
+ "target": {
368
+ "type": "string",
369
+ "description": "The prefix of the target that this matches on, e.g. \"https://graph.microsoft.com/v1.0\", with no trailing slash."
370
+ },
371
+ "authority": {
372
+ "type": "string",
373
+ "description": "The auth authority used.\n\nDefault value \"https://login.microsoftonline.com\""
374
+ },
375
+ "tenantId": {
376
+ "type": "string",
377
+ "description": "The tenant whose org data we are interested in."
378
+ },
379
+ "clientId": {
380
+ "type": "string",
381
+ "description": "The OAuth client ID to use for authenticating requests."
382
+ },
383
+ "clientSecret": {
384
+ "type": "string",
385
+ "description": "The OAuth client secret to use for authenticating requests.",
386
+ "visibility": "secret"
387
+ },
388
+ "queryMode": {
389
+ "type": "string",
390
+ "description": "By default, the Microsoft Graph API only provides the basic feature set for querying. Certain features are limited to advanced query capabilities (see https://docs.microsoft.com/en-us/graph/aad-advanced-queries) and need to be enabled.\n\nSome features like `$expand` are not available for advanced queries, though."
391
+ },
392
+ "user": {
393
+ "type": "object",
394
+ "properties": {
395
+ "path": {
396
+ "type": "string",
397
+ "description": "The url path to fetch groups, defaults to `/groups`.\n\nE.g. \"groups/{id}/transitiveMembers/microsoft.graph.group/\"."
398
+ },
399
+ "expand": {
400
+ "type": "string",
401
+ "description": "The \"expand\" argument to apply to users.\n\nE.g. \"manager\"."
402
+ },
403
+ "filter": {
404
+ "type": "string",
405
+ "description": "The filter to apply to extract users. Disabled users (`accountEnabled === false`) are always filtered out client-side regardless of this setting.\n\nE.g. \"userType eq 'member'\""
406
+ },
407
+ "loadPhotos": {
408
+ "type": "boolean",
409
+ "description": "Set to false to not load user photos. This can be useful for huge organizations."
410
+ },
411
+ "select": {
412
+ "type": "array",
413
+ "items": {
414
+ "type": "string"
415
+ },
416
+ "description": "The fields to be fetched on query.\n\nE.g. [\"id\", \"displayName\", \"description\"]"
417
+ }
418
+ }
419
+ },
420
+ "group": {
421
+ "type": "object",
422
+ "properties": {
423
+ "path": {
424
+ "type": "string",
425
+ "description": "The url path to fetch groups, defaults to `/groups`.\n\nE.g. \"groups/{id}/transitiveMembers/microsoft.graph.group/\"."
426
+ },
427
+ "expand": {
428
+ "type": "string",
429
+ "description": "The \"expand\" argument to apply to groups.\n\nE.g. \"member\"."
430
+ },
431
+ "filter": {
432
+ "type": "string",
433
+ "description": "The filter to apply to extract groups.\n\nE.g. \"securityEnabled eq false and mailEnabled eq true\""
434
+ },
435
+ "search": {
436
+ "type": "string",
437
+ "description": "The search criteria to apply to extract users by groups memberships.\n\nE.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'"
438
+ },
439
+ "select": {
440
+ "type": "array",
441
+ "items": {
442
+ "type": "string"
443
+ },
444
+ "description": "The fields to be fetched on query.\n\nE.g. [\"id\", \"displayName\", \"description\"]"
445
+ },
446
+ "includeSubGroups": {
447
+ "type": "boolean",
448
+ "description": "Whether to ingest groups that are members of the found/filtered/searched groups. Default value is `false`."
449
+ }
450
+ }
451
+ },
452
+ "userGroupMember": {
453
+ "type": "object",
454
+ "properties": {
455
+ "path": {
456
+ "type": "string",
457
+ "description": "The url path to fetch groups, defaults to `/groups`.\n\nE.g. \"groups/{id}/transitiveMembers/microsoft.graph.group/\"."
458
+ },
459
+ "filter": {
460
+ "type": "string",
461
+ "description": "The filter to apply to extract users by groups memberships.\n\nE.g. \"displayName eq 'Backstage Users'\""
462
+ },
463
+ "search": {
464
+ "type": "string",
465
+ "description": "The search criteria to apply to extract groups.\n\nE.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'"
466
+ }
467
+ }
468
+ },
469
+ "schedule": {
470
+ "type": "object",
471
+ "properties": {
472
+ "frequency": {
473
+ "anyOf": [
474
+ {
475
+ "type": "object",
476
+ "properties": {
477
+ "cron": {
478
+ "type": "string",
479
+ "description": "A crontab style string."
480
+ }
481
+ },
482
+ "required": [
483
+ "cron"
484
+ ]
485
+ },
486
+ {
487
+ "type": "string"
488
+ },
489
+ {
490
+ "type": "object",
491
+ "properties": {
492
+ "years": {
493
+ "type": "number"
494
+ },
495
+ "months": {
496
+ "type": "number"
497
+ },
498
+ "weeks": {
499
+ "type": "number"
500
+ },
501
+ "days": {
502
+ "type": "number"
503
+ },
504
+ "hours": {
505
+ "type": "number"
506
+ },
507
+ "minutes": {
508
+ "type": "number"
509
+ },
510
+ "seconds": {
511
+ "type": "number"
512
+ },
513
+ "milliseconds": {
514
+ "type": "number"
515
+ }
516
+ },
517
+ "description": "Human friendly durations object."
518
+ },
519
+ {
520
+ "type": "object",
521
+ "properties": {
522
+ "trigger": {
523
+ "type": "string",
524
+ "const": "manual"
525
+ }
526
+ },
527
+ "required": [
528
+ "trigger"
529
+ ]
530
+ }
531
+ ],
532
+ "description": "How often you want the task to run. The system does its best to avoid overlapping invocations."
533
+ },
534
+ "timeout": {
535
+ "anyOf": [
536
+ {
537
+ "type": "string"
538
+ },
539
+ {
540
+ "type": "object",
541
+ "properties": {
542
+ "years": {
543
+ "type": "number"
544
+ },
545
+ "months": {
546
+ "type": "number"
547
+ },
548
+ "weeks": {
549
+ "type": "number"
550
+ },
551
+ "days": {
552
+ "type": "number"
553
+ },
554
+ "hours": {
555
+ "type": "number"
556
+ },
557
+ "minutes": {
558
+ "type": "number"
559
+ },
560
+ "seconds": {
561
+ "type": "number"
562
+ },
563
+ "milliseconds": {
564
+ "type": "number"
565
+ }
566
+ },
567
+ "description": "Human friendly durations object."
568
+ }
569
+ ],
570
+ "description": "The maximum amount of time that a single task invocation can take, before it's considered timed out and gets \"released\" such that a new invocation is permitted to take place (possibly, then, on a different worker)."
571
+ },
572
+ "initialDelay": {
573
+ "anyOf": [
574
+ {
575
+ "type": "string"
576
+ },
577
+ {
578
+ "type": "object",
579
+ "properties": {
580
+ "years": {
581
+ "type": "number"
582
+ },
583
+ "months": {
584
+ "type": "number"
585
+ },
586
+ "weeks": {
587
+ "type": "number"
588
+ },
589
+ "days": {
590
+ "type": "number"
591
+ },
592
+ "hours": {
593
+ "type": "number"
594
+ },
595
+ "minutes": {
596
+ "type": "number"
597
+ },
598
+ "seconds": {
599
+ "type": "number"
600
+ },
601
+ "milliseconds": {
602
+ "type": "number"
603
+ }
604
+ },
605
+ "description": "Human friendly durations object."
606
+ }
607
+ ],
608
+ "description": "The amount of time that should pass before the first invocation happens."
609
+ },
610
+ "scope": {
611
+ "type": "string",
612
+ "enum": [
613
+ "global",
614
+ "local"
615
+ ],
616
+ "description": "Sets the scope of concurrency control / locking to apply for invocations of this task."
617
+ }
618
+ },
619
+ "required": [
620
+ "frequency",
621
+ "timeout"
622
+ ],
623
+ "description": "(Optional) TaskScheduleDefinition for the refresh."
624
+ }
625
+ },
626
+ "required": [
627
+ "tenantId",
628
+ "clientId",
629
+ "clientSecret"
630
+ ]
631
+ }
632
+ }
633
+ ],
634
+ "description": "MicrosoftGraphOrgEntityProvider configuration."
635
+ }
636
+ }
637
+ }
638
+ }
639
+ }
640
+ }
641
+ }
@@ -133,6 +133,11 @@ function readProviderConfig(id, config) {
133
133
  `userGroupMemberSearch cannot be specified when userFilter is defined.`
134
134
  );
135
135
  }
136
+ if (userFilter && userGroupMemberPath) {
137
+ throw new Error(
138
+ `userGroupMemberPath cannot be specified when userFilter is defined.`
139
+ );
140
+ }
136
141
  if (clientId && !clientSecret) {
137
142
  throw new Error(`clientSecret must be provided when clientId is defined.`);
138
143
  }
@@ -1 +1 @@
1
- {"version":3,"file":"config.cjs.js","sources":["../../src/microsoftGraph/config.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n SchedulerServiceTaskScheduleDefinition,\n readSchedulerServiceTaskScheduleDefinitionFromConfig,\n} from '@backstage/backend-plugin-api';\nimport { Config } from '@backstage/config';\nimport { trimEnd } from 'lodash';\n\nconst DEFAULT_PROVIDER_ID = 'default';\nconst DEFAULT_TARGET = 'https://graph.microsoft.com/v1.0';\n\n/**\n * The configuration parameters for a single Microsoft Graph provider.\n *\n * @public\n */\nexport type MicrosoftGraphProviderConfig = {\n /**\n * Identifier of the provider which will be used i.e. at the location key for ingested entities.\n */\n id: string;\n\n /**\n * The prefix of the target that this matches on, e.g.\n * \"https://graph.microsoft.com/v1.0\", with no trailing slash.\n */\n target: string;\n /**\n * The auth authority used.\n *\n * E.g. \"https://login.microsoftonline.com\"\n */\n authority?: string;\n /**\n * The tenant whose org data we are interested in.\n */\n tenantId: string;\n /**\n * The OAuth client ID to use for authenticating requests.\n * If specified, ClientSecret must also be specified\n */\n clientId?: string;\n /**\n * The OAuth client secret to use for authenticating requests.\n * If specified, ClientId must also be specified\n */\n clientSecret?: string;\n /**\n * The filter to apply to extract users. Disabled users\n * (`accountEnabled === false`) are always filtered out client-side\n * regardless of this setting.\n *\n * E.g. \"userType eq 'member'\"\n */\n userFilter?: string;\n /**\n * The fields to be fetched on query.\n *\n * E.g. [\"id\", \"displayName\", \"description\"]\n */\n userSelect?: string[];\n /**\n * The \"expand\" argument to apply to users.\n *\n * E.g. \"manager\".\n */\n userExpand?: string;\n\n /**\n * The path to the users endpoint. Defaults to \"/users\".\n *\n * E.g. \"/users\"\n */\n userPath?: string;\n /**\n * The filter to apply to extract users by groups memberships.\n *\n * E.g. \"displayName eq 'Backstage Users'\"\n */\n userGroupMemberFilter?: string;\n /**\n * The search criteria to apply to extract users by groups memberships.\n *\n * E.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'\n */\n userGroupMemberSearch?: string;\n\n /**\n * The path to the groups endpoint. Defaults to \"/groups\".\n *\n * E.g. \"/groups\"\n */\n userGroupMemberPath?: string;\n\n /**\n * The \"expand\" argument to apply to groups.\n *\n * E.g. \"member\".\n */\n groupExpand?: string;\n /**\n * The filter to apply to extract groups.\n *\n * E.g. \"securityEnabled eq false and mailEnabled eq true\"\n */\n groupFilter?: string;\n /**\n * The search criteria to apply to extract groups.\n *\n * E.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'\n */\n groupSearch?: string;\n\n /**\n * The fields to be fetched on query.\n *\n * E.g. [\"id\", \"displayName\", \"description\"]\n */\n groupSelect?: string[];\n\n /**\n * The path to the groups endpoint. Defaults to \"/groups\".\n *\n * E.g. \"/groups\"\n */\n groupPath?: string;\n\n /**\n * Whether to ingest groups that are members of the found/filtered/searched groups.\n * Default value is `false`.\n */\n groupIncludeSubGroups?: boolean;\n\n /**\n * By default, the Microsoft Graph API only provides the basic feature set\n * for querying. Certain features are limited to advanced query capabilities\n * (see https://docs.microsoft.com/en-us/graph/aad-advanced-queries)\n * and need to be enabled.\n *\n * Some features like `$expand` are not available for advanced queries, though.\n */\n queryMode?: 'basic' | 'advanced';\n\n /**\n * Set to false to not load user photos.\n * This can be useful for huge organizations.\n */\n loadUserPhotos?: boolean;\n\n /**\n * Schedule configuration for refresh tasks.\n */\n schedule?: SchedulerServiceTaskScheduleDefinition;\n};\n\n/**\n * Parses configuration.\n *\n * @param config - The root of the msgraph config hierarchy\n *\n * @public\n * @deprecated Replaced by not exported `readProviderConfigs` and kept for backwards compatibility only.\n */\nexport function readMicrosoftGraphConfig(\n config: Config,\n): MicrosoftGraphProviderConfig[] {\n const providers: MicrosoftGraphProviderConfig[] = [];\n const providerConfigs = config.getOptionalConfigArray('providers') ?? [];\n\n for (const providerConfig of providerConfigs) {\n const target = trimEnd(\n providerConfig.getOptionalString('target') ?? DEFAULT_TARGET,\n '/',\n );\n const authority = providerConfig.getOptionalString('authority');\n\n const tenantId = providerConfig.getString('tenantId');\n const clientId = providerConfig.getOptionalString('clientId');\n const clientSecret = providerConfig.getOptionalString('clientSecret');\n\n const userExpand = providerConfig.getOptionalString('userExpand');\n const userFilter = providerConfig.getOptionalString('userFilter');\n const userSelect = providerConfig.getOptionalStringArray('userSelect');\n const userGroupMemberFilter = providerConfig.getOptionalString(\n 'userGroupMemberFilter',\n );\n const userGroupMemberSearch = providerConfig.getOptionalString(\n 'userGroupMemberSearch',\n );\n const groupExpand = providerConfig.getOptionalString('groupExpand');\n const groupFilter = providerConfig.getOptionalString('groupFilter');\n const groupSearch = providerConfig.getOptionalString('groupSearch');\n\n if (userFilter && userGroupMemberFilter) {\n throw new Error(\n `userFilter and userGroupMemberFilter are mutually exclusive, only one can be specified.`,\n );\n }\n if (userFilter && userGroupMemberSearch) {\n throw new Error(\n `userGroupMemberSearch cannot be specified when userFilter is defined.`,\n );\n }\n\n const groupSelect = providerConfig.getOptionalStringArray('groupSelect');\n const queryMode = providerConfig.getOptionalString('queryMode');\n if (\n queryMode !== undefined &&\n queryMode !== 'basic' &&\n queryMode !== 'advanced'\n ) {\n throw new Error(`queryMode must be one of: basic, advanced`);\n }\n\n if (clientId && !clientSecret) {\n throw new Error(\n `clientSecret must be provided when clientId is defined.`,\n );\n }\n\n if (clientSecret && !clientId) {\n throw new Error(\n `clientId must be provided when clientSecret is defined.`,\n );\n }\n\n providers.push({\n id: target,\n target,\n authority,\n tenantId,\n clientId,\n clientSecret,\n userExpand,\n userFilter,\n userSelect,\n userGroupMemberFilter,\n userGroupMemberSearch,\n groupExpand,\n groupFilter,\n groupSearch,\n groupSelect,\n queryMode,\n });\n }\n\n return providers;\n}\n\n/**\n * Parses all configured providers.\n *\n * @param config - The root of the msgraph config hierarchy\n *\n * @public\n */\nexport function readProviderConfigs(\n config: Config,\n): MicrosoftGraphProviderConfig[] {\n const providersConfig = config.getOptionalConfig(\n 'catalog.providers.microsoftGraphOrg',\n );\n if (!providersConfig) {\n return [];\n }\n\n if (providersConfig.has('clientId')) {\n // simple/single config variant\n return [readProviderConfig(DEFAULT_PROVIDER_ID, providersConfig)];\n }\n\n return providersConfig.keys().map(id => {\n const providerConfig = providersConfig.getConfig(id);\n\n return readProviderConfig(id, providerConfig);\n });\n}\n\n/**\n * Parses a single configured provider by id.\n *\n * @param id - the id of the provider to parse\n * @param config - The root of the msgraph config hierarchy\n *\n * @public\n */\nexport function readProviderConfig(\n id: string,\n config: Config,\n): MicrosoftGraphProviderConfig {\n const target = trimEnd(\n config.getOptionalString('target') ?? DEFAULT_TARGET,\n '/',\n );\n const authority = config.getOptionalString('authority');\n\n const tenantId = config.getString('tenantId');\n const clientId = config.getOptionalString('clientId');\n const clientSecret = config.getOptionalString('clientSecret');\n\n const userExpand = config.getOptionalString('user.expand');\n const userFilter = config.getOptionalString('user.filter');\n const userSelect = config.getOptionalStringArray('user.select');\n const userPath = config.getOptionalString('user.path') ?? 'users';\n const loadUserPhotos = config.getOptionalBoolean('user.loadPhotos');\n\n const groupExpand = config.getOptionalString('group.expand');\n const groupFilter = config.getOptionalString('group.filter');\n const groupSearch = config.getOptionalString('group.search');\n const groupSelect = config.getOptionalStringArray('group.select');\n const groupPath = config.getOptionalString('group.path') ?? 'groups';\n const groupIncludeSubGroups = config.getOptionalBoolean(\n 'group.includeSubGroups',\n );\n\n const queryMode = config.getOptionalString('queryMode');\n if (\n queryMode !== undefined &&\n queryMode !== 'basic' &&\n queryMode !== 'advanced'\n ) {\n throw new Error(`queryMode must be one of: basic, advanced`);\n }\n\n const userGroupMemberFilter = config.getOptionalString(\n 'userGroupMember.filter',\n );\n const userGroupMemberSearch = config.getOptionalString(\n 'userGroupMember.search',\n );\n const userGroupMemberPath = config.getOptionalString('userGroupMember.path');\n\n if (userFilter && userGroupMemberFilter) {\n throw new Error(\n `userFilter and userGroupMemberFilter are mutually exclusive, only one can be specified.`,\n );\n }\n if (userFilter && userGroupMemberSearch) {\n throw new Error(\n `userGroupMemberSearch cannot be specified when userFilter is defined.`,\n );\n }\n\n if (clientId && !clientSecret) {\n throw new Error(`clientSecret must be provided when clientId is defined.`);\n }\n\n if (clientSecret && !clientId) {\n throw new Error(`clientId must be provided when clientSecret is defined.`);\n }\n\n const schedule = config.has('schedule')\n ? readSchedulerServiceTaskScheduleDefinitionFromConfig(\n config.getConfig('schedule'),\n )\n : undefined;\n\n return {\n id,\n target,\n authority,\n clientId,\n clientSecret,\n tenantId,\n userExpand,\n userFilter,\n userSelect,\n userPath,\n loadUserPhotos,\n groupExpand,\n groupFilter,\n groupSearch,\n groupSelect,\n groupPath,\n groupIncludeSubGroups,\n queryMode,\n userGroupMemberFilter,\n userGroupMemberSearch,\n userGroupMemberPath,\n schedule,\n };\n}\n"],"names":["trimEnd","readSchedulerServiceTaskScheduleDefinitionFromConfig"],"mappings":";;;;;AAuBA,MAAM,mBAAA,GAAsB,SAAA;AAC5B,MAAM,cAAA,GAAiB,kCAAA;AA0JhB,SAAS,yBACd,MAAA,EACgC;AAChC,EAAA,MAAM,YAA4C,EAAC;AACnD,EAAA,MAAM,eAAA,GAAkB,MAAA,CAAO,sBAAA,CAAuB,WAAW,KAAK,EAAC;AAEvE,EAAA,KAAA,MAAW,kBAAkB,eAAA,EAAiB;AAC5C,IAAA,MAAM,MAAA,GAASA,cAAA;AAAA,MACb,cAAA,CAAe,iBAAA,CAAkB,QAAQ,CAAA,IAAK,cAAA;AAAA,MAC9C;AAAA,KACF;AACA,IAAA,MAAM,SAAA,GAAY,cAAA,CAAe,iBAAA,CAAkB,WAAW,CAAA;AAE9D,IAAA,MAAM,QAAA,GAAW,cAAA,CAAe,SAAA,CAAU,UAAU,C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A,IACA,qBAAA;AAAA,IACA,SAAA;AAAA,IACA,qBAAA;AAAA,IACA,qBAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;;;"}
1
+ {"version":3,"file":"config.cjs.js","sources":["../../src/microsoftGraph/config.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n SchedulerServiceTaskScheduleDefinition,\n readSchedulerServiceTaskScheduleDefinitionFromConfig,\n} from '@backstage/backend-plugin-api';\nimport { Config } from '@backstage/config';\nimport { trimEnd } from 'lodash';\n\nconst DEFAULT_PROVIDER_ID = 'default';\nconst DEFAULT_TARGET = 'https://graph.microsoft.com/v1.0';\n\n/**\n * The configuration parameters for a single Microsoft Graph provider.\n *\n * @public\n */\nexport type MicrosoftGraphProviderConfig = {\n /**\n * Identifier of the provider which will be used i.e. at the location key for ingested entities.\n */\n id: string;\n\n /**\n * The prefix of the target that this matches on, e.g.\n * \"https://graph.microsoft.com/v1.0\", with no trailing slash.\n */\n target: string;\n /**\n * The auth authority used.\n *\n * E.g. \"https://login.microsoftonline.com\"\n */\n authority?: string;\n /**\n * The tenant whose org data we are interested in.\n */\n tenantId: string;\n /**\n * The OAuth client ID to use for authenticating requests.\n * If specified, ClientSecret must also be specified\n */\n clientId?: string;\n /**\n * The OAuth client secret to use for authenticating requests.\n * If specified, ClientId must also be specified\n */\n clientSecret?: string;\n /**\n * The filter to apply to extract users. Disabled users\n * (`accountEnabled === false`) are always filtered out client-side\n * regardless of this setting.\n *\n * E.g. \"userType eq 'member'\"\n */\n userFilter?: string;\n /**\n * The fields to be fetched on query.\n *\n * E.g. [\"id\", \"displayName\", \"description\"]\n */\n userSelect?: string[];\n /**\n * The \"expand\" argument to apply to users.\n *\n * E.g. \"manager\".\n */\n userExpand?: string;\n\n /**\n * The path to the users endpoint. Defaults to \"/users\".\n *\n * E.g. \"/users\"\n */\n userPath?: string;\n /**\n * The filter to apply to extract users by groups memberships.\n *\n * E.g. \"displayName eq 'Backstage Users'\"\n */\n userGroupMemberFilter?: string;\n /**\n * The search criteria to apply to extract users by groups memberships.\n *\n * E.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'\n */\n userGroupMemberSearch?: string;\n\n /**\n * The path to the groups endpoint. Defaults to \"/groups\".\n *\n * E.g. \"/groups\"\n */\n userGroupMemberPath?: string;\n\n /**\n * The \"expand\" argument to apply to groups.\n *\n * E.g. \"member\".\n */\n groupExpand?: string;\n /**\n * The filter to apply to extract groups.\n *\n * E.g. \"securityEnabled eq false and mailEnabled eq true\"\n */\n groupFilter?: string;\n /**\n * The search criteria to apply to extract groups.\n *\n * E.g. \"\\\"displayName:-team\\\"\" would only match groups which contain '-team'\n */\n groupSearch?: string;\n\n /**\n * The fields to be fetched on query.\n *\n * E.g. [\"id\", \"displayName\", \"description\"]\n */\n groupSelect?: string[];\n\n /**\n * The path to the groups endpoint. Defaults to \"/groups\".\n *\n * E.g. \"/groups\"\n */\n groupPath?: string;\n\n /**\n * Whether to ingest groups that are members of the found/filtered/searched groups.\n * Default value is `false`.\n */\n groupIncludeSubGroups?: boolean;\n\n /**\n * By default, the Microsoft Graph API only provides the basic feature set\n * for querying. Certain features are limited to advanced query capabilities\n * (see https://docs.microsoft.com/en-us/graph/aad-advanced-queries)\n * and need to be enabled.\n *\n * Some features like `$expand` are not available for advanced queries, though.\n */\n queryMode?: 'basic' | 'advanced';\n\n /**\n * Set to false to not load user photos.\n * This can be useful for huge organizations.\n */\n loadUserPhotos?: boolean;\n\n /**\n * Schedule configuration for refresh tasks.\n */\n schedule?: SchedulerServiceTaskScheduleDefinition;\n};\n\n/**\n * Parses configuration.\n *\n * @param config - The root of the msgraph config hierarchy\n *\n * @public\n * @deprecated Replaced by not exported `readProviderConfigs` and kept for backwards compatibility only.\n */\nexport function readMicrosoftGraphConfig(\n config: Config,\n): MicrosoftGraphProviderConfig[] {\n const providers: MicrosoftGraphProviderConfig[] = [];\n const providerConfigs = config.getOptionalConfigArray('providers') ?? [];\n\n for (const providerConfig of providerConfigs) {\n const target = trimEnd(\n providerConfig.getOptionalString('target') ?? DEFAULT_TARGET,\n '/',\n );\n const authority = providerConfig.getOptionalString('authority');\n\n const tenantId = providerConfig.getString('tenantId');\n const clientId = providerConfig.getOptionalString('clientId');\n const clientSecret = providerConfig.getOptionalString('clientSecret');\n\n const userExpand = providerConfig.getOptionalString('userExpand');\n const userFilter = providerConfig.getOptionalString('userFilter');\n const userSelect = providerConfig.getOptionalStringArray('userSelect');\n const userGroupMemberFilter = providerConfig.getOptionalString(\n 'userGroupMemberFilter',\n );\n const userGroupMemberSearch = providerConfig.getOptionalString(\n 'userGroupMemberSearch',\n );\n const groupExpand = providerConfig.getOptionalString('groupExpand');\n const groupFilter = providerConfig.getOptionalString('groupFilter');\n const groupSearch = providerConfig.getOptionalString('groupSearch');\n\n if (userFilter && userGroupMemberFilter) {\n throw new Error(\n `userFilter and userGroupMemberFilter are mutually exclusive, only one can be specified.`,\n );\n }\n if (userFilter && userGroupMemberSearch) {\n throw new Error(\n `userGroupMemberSearch cannot be specified when userFilter is defined.`,\n );\n }\n\n const groupSelect = providerConfig.getOptionalStringArray('groupSelect');\n const queryMode = providerConfig.getOptionalString('queryMode');\n if (\n queryMode !== undefined &&\n queryMode !== 'basic' &&\n queryMode !== 'advanced'\n ) {\n throw new Error(`queryMode must be one of: basic, advanced`);\n }\n\n if (clientId && !clientSecret) {\n throw new Error(\n `clientSecret must be provided when clientId is defined.`,\n );\n }\n\n if (clientSecret && !clientId) {\n throw new Error(\n `clientId must be provided when clientSecret is defined.`,\n );\n }\n\n providers.push({\n id: target,\n target,\n authority,\n tenantId,\n clientId,\n clientSecret,\n userExpand,\n userFilter,\n userSelect,\n userGroupMemberFilter,\n userGroupMemberSearch,\n groupExpand,\n groupFilter,\n groupSearch,\n groupSelect,\n queryMode,\n });\n }\n\n return providers;\n}\n\n/**\n * Parses all configured providers.\n *\n * @param config - The root of the msgraph config hierarchy\n *\n * @public\n */\nexport function readProviderConfigs(\n config: Config,\n): MicrosoftGraphProviderConfig[] {\n const providersConfig = config.getOptionalConfig(\n 'catalog.providers.microsoftGraphOrg',\n );\n if (!providersConfig) {\n return [];\n }\n\n if (providersConfig.has('clientId')) {\n // simple/single config variant\n return [readProviderConfig(DEFAULT_PROVIDER_ID, providersConfig)];\n }\n\n return providersConfig.keys().map(id => {\n const providerConfig = providersConfig.getConfig(id);\n\n return readProviderConfig(id, providerConfig);\n });\n}\n\n/**\n * Parses a single configured provider by id.\n *\n * @param id - the id of the provider to parse\n * @param config - The root of the msgraph config hierarchy\n *\n * @public\n */\nexport function readProviderConfig(\n id: string,\n config: Config,\n): MicrosoftGraphProviderConfig {\n const target = trimEnd(\n config.getOptionalString('target') ?? DEFAULT_TARGET,\n '/',\n );\n const authority = config.getOptionalString('authority');\n\n const tenantId = config.getString('tenantId');\n const clientId = config.getOptionalString('clientId');\n const clientSecret = config.getOptionalString('clientSecret');\n\n const userExpand = config.getOptionalString('user.expand');\n const userFilter = config.getOptionalString('user.filter');\n const userSelect = config.getOptionalStringArray('user.select');\n const userPath = config.getOptionalString('user.path') ?? 'users';\n const loadUserPhotos = config.getOptionalBoolean('user.loadPhotos');\n\n const groupExpand = config.getOptionalString('group.expand');\n const groupFilter = config.getOptionalString('group.filter');\n const groupSearch = config.getOptionalString('group.search');\n const groupSelect = config.getOptionalStringArray('group.select');\n const groupPath = config.getOptionalString('group.path') ?? 'groups';\n const groupIncludeSubGroups = config.getOptionalBoolean(\n 'group.includeSubGroups',\n );\n\n const queryMode = config.getOptionalString('queryMode');\n if (\n queryMode !== undefined &&\n queryMode !== 'basic' &&\n queryMode !== 'advanced'\n ) {\n throw new Error(`queryMode must be one of: basic, advanced`);\n }\n\n const userGroupMemberFilter = config.getOptionalString(\n 'userGroupMember.filter',\n );\n const userGroupMemberSearch = config.getOptionalString(\n 'userGroupMember.search',\n );\n const userGroupMemberPath = config.getOptionalString('userGroupMember.path');\n\n if (userFilter && userGroupMemberFilter) {\n throw new Error(\n `userFilter and userGroupMemberFilter are mutually exclusive, only one can be specified.`,\n );\n }\n if (userFilter && userGroupMemberSearch) {\n throw new Error(\n `userGroupMemberSearch cannot be specified when userFilter is defined.`,\n );\n }\n if (userFilter && userGroupMemberPath) {\n throw new Error(\n `userGroupMemberPath cannot be specified when userFilter is defined.`,\n );\n }\n\n if (clientId && !clientSecret) {\n throw new Error(`clientSecret must be provided when clientId is defined.`);\n }\n\n if (clientSecret && !clientId) {\n throw new Error(`clientId must be provided when clientSecret is defined.`);\n }\n\n const schedule = config.has('schedule')\n ? readSchedulerServiceTaskScheduleDefinitionFromConfig(\n config.getConfig('schedule'),\n )\n : undefined;\n\n return {\n id,\n target,\n authority,\n clientId,\n clientSecret,\n tenantId,\n userExpand,\n userFilter,\n userSelect,\n userPath,\n loadUserPhotos,\n groupExpand,\n groupFilter,\n groupSearch,\n groupSelect,\n groupPath,\n groupIncludeSubGroups,\n queryMode,\n userGroupMemberFilter,\n userGroupMemberSearch,\n userGroupMemberPath,\n schedule,\n };\n}\n"],"names":["trimEnd","readSchedulerServiceTaskScheduleDefinitionFromConfig"],"mappings":";;;;;AAuBA,MAAM,mBAAA,GAAsB,SAAA;AAC5B,MAAM,cAAA,GAAiB,kCAAA;AA0JhB,SAAS,yBACd,MAAA,EACgC;AAChC,EAAA,MAAM,YAA4C,EAAC;AACnD,EAAA,MAAM,eAAA,GAAkB,MAAA,CAAO,sBAAA,CAAuB,WAAW,KAAK,EAAC;AAEvE,EAAA,KAAA,MAAW,kBAAkB,eAAA,EAAiB;AAC5C,IAAA,MAAM,MAAA,GA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AAA,CAAO,UAAU,UAAU;AAAA,GAC7B,GACA,MAAA;AAEJ,EAAA,OAAO;AAAA,IACL,EAAA;AAAA,IACA,MAAA;AAAA,IACA,SAAA;AAAA,IACA,QAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,WAAA;AAAA,IACA,SAAA;AAAA,IACA,qBAAA;AAAA,IACA,SAAA;AAAA,IACA,qBAAA;AAAA,IACA,qBAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AACF;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend-module-msgraph",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "A Backstage catalog backend module that helps integrate towards Microsoft Graph",
5
5
  "backstage": {
6
6
  "role": "backend-plugin-module",
@@ -52,7 +52,7 @@
52
52
  }
53
53
  },
54
54
  "files": [
55
- "config.d.ts",
55
+ "config.schema.json",
56
56
  "dist"
57
57
  ],
58
58
  "scripts": {
@@ -66,21 +66,21 @@
66
66
  },
67
67
  "dependencies": {
68
68
  "@azure/identity": "^4.0.0",
69
- "@backstage/backend-plugin-api": "^1.9.2",
69
+ "@backstage/backend-plugin-api": "^1.9.3",
70
70
  "@backstage/catalog-model": "^1.9.0",
71
71
  "@backstage/config": "^1.3.8",
72
72
  "@backstage/plugin-catalog-common": "^1.1.10",
73
- "@backstage/plugin-catalog-node": "^2.2.2",
73
+ "@backstage/plugin-catalog-node": "^2.2.3",
74
74
  "@microsoft/microsoft-graph-types": "^2.6.0",
75
75
  "lodash": "^4.17.21",
76
76
  "p-limit": "^3.0.2",
77
77
  "qs": "^6.15.2"
78
78
  },
79
79
  "devDependencies": {
80
- "@backstage/backend-test-utils": "^1.11.4",
81
- "@backstage/cli": "^0.36.3",
80
+ "@backstage/backend-test-utils": "^1.11.5",
81
+ "@backstage/cli": "^0.36.4",
82
82
  "@types/lodash": "^4.14.151",
83
- "msw": "^1.0.0"
83
+ "msw": "^2.0.0"
84
84
  },
85
- "configSchema": "config.d.ts"
85
+ "configSchema": "config.schema.json"
86
86
  }
package/config.d.ts DELETED
@@ -1,388 +0,0 @@
1
- /*
2
- * Copyright 2020 The Backstage Authors
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
-
17
- import { SchedulerServiceTaskScheduleDefinitionConfig } from '@backstage/backend-plugin-api';
18
-
19
- export interface Config {
20
- catalog?: {
21
- processors?: {
22
- /**
23
- * MicrosoftGraphOrgReaderProcessor configuration
24
- * @deprecated Use `catalog.providers.microsoftGraphOrg` instead.
25
- */
26
- microsoftGraphOrg?: {
27
- /**
28
- * The configuration parameters for each single Microsoft Graph provider.
29
- */
30
- providers: Array<{
31
- /**
32
- * The prefix of the target that this matches on, e.g.
33
- * "https://graph.microsoft.com/v1.0", with no trailing slash.
34
- */
35
- target: string;
36
- /**
37
- * The auth authority used.
38
- *
39
- * Default value "https://login.microsoftonline.com"
40
- */
41
- authority?: string;
42
- /**
43
- * The tenant whose org data we are interested in.
44
- */
45
- tenantId: string;
46
- /**
47
- * The OAuth client ID to use for authenticating requests.
48
- */
49
- clientId?: string;
50
- /**
51
- * The OAuth client secret to use for authenticating requests.
52
- *
53
- * @visibility secret
54
- */
55
- clientSecret?: string;
56
-
57
- // TODO: Consider not making these config options and pass them in the
58
- // constructor instead. They are probably not environment specific, so
59
- // they could also be configured "in code".
60
-
61
- /**
62
- * The filter to apply to extract users. Disabled users
63
- * (`accountEnabled === false`) are always filtered out
64
- * client-side regardless of this setting.
65
- *
66
- * E.g. "userType eq 'member'"
67
- */
68
- userFilter?: string;
69
- /**
70
- * The filter to apply to extract groups.
71
- *
72
- * E.g. "securityEnabled eq false and mailEnabled eq true"
73
- */
74
- groupFilter?: string;
75
- /**
76
- * The fields to be fetched on query.
77
- *
78
- * E.g. ["id", "displayName", "description"]
79
- */
80
- userSelect?: string[];
81
- /**
82
- * The search criteria to apply to extract users by groups memberships.
83
- *
84
- * E.g. "\"displayName:-team\"" would only match groups which contain '-team'
85
- */
86
- groupSearch?: string;
87
-
88
- /**
89
- * The fields to be fetched on query.
90
- *
91
- * E.g. ["id", "displayName", "description"]
92
- */
93
- groupSelect?: string[];
94
-
95
- /**
96
- * The filter to apply to extract users by groups memberships.
97
- *
98
- * E.g. "displayName eq 'Backstage Users'"
99
- */
100
- userGroupMemberFilter?: string;
101
- /**
102
- * The search criteria to apply to extract groups.
103
- *
104
- * E.g. "\"displayName:-team\"" would only match groups which contain '-team'
105
- */
106
- userGroupMemberSearch?: string;
107
- }>;
108
- };
109
- };
110
-
111
- providers?: {
112
- /**
113
- * MicrosoftGraphOrgEntityProvider configuration.
114
- */
115
- microsoftGraphOrg?:
116
- | {
117
- /**
118
- * The prefix of the target that this matches on, e.g.
119
- * "https://graph.microsoft.com/v1.0", with no trailing slash.
120
- */
121
- target?: string;
122
- /**
123
- * The auth authority used.
124
- *
125
- * Default value "https://login.microsoftonline.com"
126
- */
127
- authority?: string;
128
- /**
129
- * The tenant whose org data we are interested in.
130
- */
131
- tenantId: string;
132
- /**
133
- * The OAuth client ID to use for authenticating requests.
134
- */
135
- clientId?: string;
136
- /**
137
- * The OAuth client secret to use for authenticating requests.
138
- *
139
- * @visibility secret
140
- */
141
- clientSecret?: string;
142
-
143
- /**
144
- * By default, the Microsoft Graph API only provides the basic feature set
145
- * for querying. Certain features are limited to advanced query capabilities
146
- * (see https://docs.microsoft.com/en-us/graph/aad-advanced-queries)
147
- * and need to be enabled.
148
- *
149
- * Some features like `$expand` are not available for advanced queries, though.
150
- */
151
- queryMode?: string;
152
- user?: {
153
- /**
154
- * The url path to fetch groups, defaults to `/users`.
155
- *
156
- * E.g. "groups/{id}/transitiveMembers/microsoft.graph.user/".
157
- */
158
- path?: string;
159
- /**
160
- * The "expand" argument to apply to users.
161
- *
162
- * E.g. "manager".
163
- */
164
- expand?: string;
165
- /**
166
- * The filter to apply to extract users.
167
- * Disabled users (`accountEnabled === false`) are always
168
- * filtered out client-side regardless of this setting.
169
- *
170
- * E.g. "userType eq 'member'"
171
- */
172
- filter?: string;
173
- /**
174
- * Set to false to not load user photos.
175
- * This can be useful for huge organizations.
176
- */
177
- loadPhotos?: boolean;
178
- /**
179
- * The fields to be fetched on query.
180
- *
181
- * E.g. ["id", "displayName", "description"]
182
- */
183
- select?: string[];
184
- };
185
-
186
- group?: {
187
- /**
188
- * The url path to fetch groups, defaults to `/groups`.
189
- *
190
- * E.g. "groups/{id}/transitiveMembers/microsoft.graph.group/".
191
- */
192
- path?: string;
193
- /**
194
- * The "expand" argument to apply to groups.
195
- *
196
- * E.g. "member".
197
- */
198
- expand?: string;
199
- /**
200
- * The filter to apply to extract groups.
201
- *
202
- * E.g. "securityEnabled eq false and mailEnabled eq true"
203
- */
204
- filter?: string;
205
- /**
206
- * The search criteria to apply to extract users by groups memberships.
207
- *
208
- * E.g. "\"displayName:-team\"" would only match groups which contain '-team'
209
- */
210
- search?: string;
211
- /**
212
- * The fields to be fetched on query.
213
- *
214
- * E.g. ["id", "displayName", "description"]
215
- */
216
- select?: string[];
217
- /**
218
- * Whether to ingest groups that are members of the found/filtered/searched groups.
219
- * Default value is `false`.
220
- */
221
- includeSubGroups?: boolean;
222
- };
223
-
224
- userGroupMember?: {
225
- /**
226
- * The url path to fetch groups, defaults to `/groups`.
227
- *
228
- * E.g. "groups/{id}/transitiveMembers/microsoft.graph.group/".
229
- */
230
- path?: string;
231
- /**
232
- * The filter to apply to extract users by groups memberships.
233
- *
234
- * E.g. "displayName eq 'Backstage Users'"
235
- */
236
- filter?: string;
237
- /**
238
- * The search criteria to apply to extract groups.
239
- *
240
- * E.g. "\"displayName:-team\"" would only match groups which contain '-team'
241
- */
242
- search?: string;
243
- };
244
-
245
- /**
246
- * (Optional) TaskScheduleDefinition for the refresh.
247
- */
248
- schedule?: SchedulerServiceTaskScheduleDefinitionConfig;
249
- }
250
- | {
251
- [name: string]: {
252
- /**
253
- * The prefix of the target that this matches on, e.g.
254
- * "https://graph.microsoft.com/v1.0", with no trailing slash.
255
- */
256
- target?: string;
257
- /**
258
- * The auth authority used.
259
- *
260
- * Default value "https://login.microsoftonline.com"
261
- */
262
- authority?: string;
263
- /**
264
- * The tenant whose org data we are interested in.
265
- */
266
- tenantId: string;
267
- /**
268
- * The OAuth client ID to use for authenticating requests.
269
- */
270
- clientId: string;
271
- /**
272
- * The OAuth client secret to use for authenticating requests.
273
- *
274
- * @visibility secret
275
- */
276
- clientSecret: string;
277
-
278
- /**
279
- * By default, the Microsoft Graph API only provides the basic feature set
280
- * for querying. Certain features are limited to advanced query capabilities
281
- * (see https://docs.microsoft.com/en-us/graph/aad-advanced-queries)
282
- * and need to be enabled.
283
- *
284
- * Some features like `$expand` are not available for advanced queries, though.
285
- */
286
- queryMode?: string;
287
- user?: {
288
- /**
289
- * The url path to fetch groups, defaults to `/groups`.
290
- *
291
- * E.g. "groups/{id}/transitiveMembers/microsoft.graph.group/".
292
- */
293
- path?: string;
294
- /**
295
- * The "expand" argument to apply to users.
296
- *
297
- * E.g. "manager".
298
- */
299
- expand?: string;
300
- /**
301
- * The filter to apply to extract users.
302
- * Disabled users (`accountEnabled === false`) are always
303
- * filtered out client-side regardless of this setting.
304
- *
305
- * E.g. "userType eq 'member'"
306
- */
307
- filter?: string;
308
- /**
309
- * Set to false to not load user photos.
310
- * This can be useful for huge organizations.
311
- */
312
- loadPhotos?: boolean;
313
- /**
314
- * The fields to be fetched on query.
315
- *
316
- * E.g. ["id", "displayName", "description"]
317
- */
318
- select?: string[];
319
- };
320
-
321
- group?: {
322
- /**
323
- * The url path to fetch groups, defaults to `/groups`.
324
- *
325
- * E.g. "groups/{id}/transitiveMembers/microsoft.graph.group/".
326
- */
327
- path?: string;
328
- /**
329
- * The "expand" argument to apply to groups.
330
- *
331
- * E.g. "member".
332
- */
333
- expand?: string;
334
- /**
335
- * The filter to apply to extract groups.
336
- *
337
- * E.g. "securityEnabled eq false and mailEnabled eq true"
338
- */
339
- filter?: string;
340
- /**
341
- * The search criteria to apply to extract users by groups memberships.
342
- *
343
- * E.g. "\"displayName:-team\"" would only match groups which contain '-team'
344
- */
345
- search?: string;
346
- /**
347
- * The fields to be fetched on query.
348
- *
349
- * E.g. ["id", "displayName", "description"]
350
- */
351
- select?: string[];
352
- /**
353
- * Whether to ingest groups that are members of the found/filtered/searched groups.
354
- * Default value is `false`.
355
- */
356
- includeSubGroups?: boolean;
357
- };
358
-
359
- userGroupMember?: {
360
- /**
361
- * The url path to fetch groups, defaults to `/groups`.
362
- *
363
- * E.g. "groups/{id}/transitiveMembers/microsoft.graph.group/".
364
- */
365
- path?: string;
366
- /**
367
- * The filter to apply to extract users by groups memberships.
368
- *
369
- * E.g. "displayName eq 'Backstage Users'"
370
- */
371
- filter?: string;
372
- /**
373
- * The search criteria to apply to extract groups.
374
- *
375
- * E.g. "\"displayName:-team\"" would only match groups which contain '-team'
376
- */
377
- search?: string;
378
- };
379
-
380
- /**
381
- * (Optional) TaskScheduleDefinition for the refresh.
382
- */
383
- schedule?: SchedulerServiceTaskScheduleDefinitionConfig;
384
- };
385
- };
386
- };
387
- };
388
- }