@spotify/backstage-plugin-rbac-common 0.2.1

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.
@@ -0,0 +1,1735 @@
1
+ import * as _backstage_plugin_permission_common from '@backstage/plugin-permission-common';
2
+ import { PermissionCondition, PermissionCriteria, AllOfCriteria, AnyOfCriteria, NotCriteria, Permission, PermissionRuleParam, PermissionRuleParams } from '@backstage/plugin-permission-common';
3
+ import { z } from 'zod';
4
+
5
+ /** @public */
6
+ declare const PolicyDefaultName = "Untitled policy";
7
+ /** @public */
8
+ declare const BackstageUserPlaceholder = ":backstageUser";
9
+ /** @public */
10
+ declare type RBACPermissionCondition = Omit<PermissionCondition, 'resourceType'>;
11
+ /** @public */
12
+ declare const PermissionConditionParser: z.ZodSchema<RBACPermissionCondition>;
13
+ /** @public */
14
+ declare const ConditionalDecisionParser: z.ZodObject<{
15
+ pluginId: z.ZodString;
16
+ resourceType: z.ZodString;
17
+ conditions: z.ZodType<PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, PermissionCriteria<RBACPermissionCondition>>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ pluginId: string;
20
+ resourceType: string;
21
+ conditions: PermissionCriteria<RBACPermissionCondition>;
22
+ }, {
23
+ pluginId: string;
24
+ resourceType: string;
25
+ conditions: PermissionCriteria<RBACPermissionCondition>;
26
+ }>;
27
+ /** @public */
28
+ declare const LiteralDecisionParser: z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>;
29
+ /** @public */
30
+ declare const PermissionDecisionParser: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
31
+ pluginId: z.ZodString;
32
+ resourceType: z.ZodString;
33
+ conditions: z.ZodType<PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, PermissionCriteria<RBACPermissionCondition>>;
34
+ }, "strip", z.ZodTypeAny, {
35
+ pluginId: string;
36
+ resourceType: string;
37
+ conditions: PermissionCriteria<RBACPermissionCondition>;
38
+ }, {
39
+ pluginId: string;
40
+ resourceType: string;
41
+ conditions: PermissionCriteria<RBACPermissionCondition>;
42
+ }>]>;
43
+ /** @public */
44
+ declare const PermissionMatchParser: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
45
+ name: z.ZodOptional<z.ZodString>;
46
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
47
+ resourceType: z.ZodOptional<z.ZodString>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ name?: string | undefined;
50
+ actions?: string[] | undefined;
51
+ resourceType?: string | undefined;
52
+ }, {
53
+ name?: string | undefined;
54
+ actions?: string[] | undefined;
55
+ resourceType?: string | undefined;
56
+ }>]>;
57
+ /** @public */
58
+ declare const RolePermissionParser: z.ZodEffects<z.ZodObject<{
59
+ id: z.ZodDefault<z.ZodString>;
60
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
61
+ name: z.ZodOptional<z.ZodString>;
62
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
63
+ resourceType: z.ZodOptional<z.ZodString>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ name?: string | undefined;
66
+ actions?: string[] | undefined;
67
+ resourceType?: string | undefined;
68
+ }, {
69
+ name?: string | undefined;
70
+ actions?: string[] | undefined;
71
+ resourceType?: string | undefined;
72
+ }>]>;
73
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
74
+ pluginId: z.ZodString;
75
+ resourceType: z.ZodString;
76
+ conditions: z.ZodType<PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, PermissionCriteria<RBACPermissionCondition>>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ pluginId: string;
79
+ resourceType: string;
80
+ conditions: PermissionCriteria<RBACPermissionCondition>;
81
+ }, {
82
+ pluginId: string;
83
+ resourceType: string;
84
+ conditions: PermissionCriteria<RBACPermissionCondition>;
85
+ }>]>;
86
+ }, "strip", z.ZodTypeAny, {
87
+ match: "*" | {
88
+ name?: string | undefined;
89
+ actions?: string[] | undefined;
90
+ resourceType?: string | undefined;
91
+ };
92
+ id: string;
93
+ decision: "allow" | "deny" | {
94
+ pluginId: string;
95
+ resourceType: string;
96
+ conditions: PermissionCriteria<RBACPermissionCondition>;
97
+ };
98
+ }, {
99
+ id?: string | undefined;
100
+ match: "*" | {
101
+ name?: string | undefined;
102
+ actions?: string[] | undefined;
103
+ resourceType?: string | undefined;
104
+ };
105
+ decision: "allow" | "deny" | {
106
+ pluginId: string;
107
+ resourceType: string;
108
+ conditions: PermissionCriteria<RBACPermissionCondition>;
109
+ };
110
+ }>, {
111
+ match: "*" | {
112
+ name?: string | undefined;
113
+ actions?: string[] | undefined;
114
+ resourceType?: string | undefined;
115
+ };
116
+ id: string;
117
+ decision: "allow" | "deny" | {
118
+ pluginId: string;
119
+ resourceType: string;
120
+ conditions: PermissionCriteria<RBACPermissionCondition>;
121
+ };
122
+ }, {
123
+ id?: string | undefined;
124
+ match: "*" | {
125
+ name?: string | undefined;
126
+ actions?: string[] | undefined;
127
+ resourceType?: string | undefined;
128
+ };
129
+ decision: "allow" | "deny" | {
130
+ pluginId: string;
131
+ resourceType: string;
132
+ conditions: PermissionCriteria<RBACPermissionCondition>;
133
+ };
134
+ }>;
135
+ /** @public */
136
+ declare const RolePermissionsParser: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
137
+ id: z.ZodDefault<z.ZodString>;
138
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
139
+ name: z.ZodOptional<z.ZodString>;
140
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
141
+ resourceType: z.ZodOptional<z.ZodString>;
142
+ }, "strip", z.ZodTypeAny, {
143
+ name?: string | undefined;
144
+ actions?: string[] | undefined;
145
+ resourceType?: string | undefined;
146
+ }, {
147
+ name?: string | undefined;
148
+ actions?: string[] | undefined;
149
+ resourceType?: string | undefined;
150
+ }>]>;
151
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
152
+ pluginId: z.ZodString;
153
+ resourceType: z.ZodString;
154
+ conditions: z.ZodType<PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, PermissionCriteria<RBACPermissionCondition>>;
155
+ }, "strip", z.ZodTypeAny, {
156
+ pluginId: string;
157
+ resourceType: string;
158
+ conditions: PermissionCriteria<RBACPermissionCondition>;
159
+ }, {
160
+ pluginId: string;
161
+ resourceType: string;
162
+ conditions: PermissionCriteria<RBACPermissionCondition>;
163
+ }>]>;
164
+ }, "strip", z.ZodTypeAny, {
165
+ match: "*" | {
166
+ name?: string | undefined;
167
+ actions?: string[] | undefined;
168
+ resourceType?: string | undefined;
169
+ };
170
+ id: string;
171
+ decision: "allow" | "deny" | {
172
+ pluginId: string;
173
+ resourceType: string;
174
+ conditions: PermissionCriteria<RBACPermissionCondition>;
175
+ };
176
+ }, {
177
+ id?: string | undefined;
178
+ match: "*" | {
179
+ name?: string | undefined;
180
+ actions?: string[] | undefined;
181
+ resourceType?: string | undefined;
182
+ };
183
+ decision: "allow" | "deny" | {
184
+ pluginId: string;
185
+ resourceType: string;
186
+ conditions: PermissionCriteria<RBACPermissionCondition>;
187
+ };
188
+ }>, {
189
+ match: "*" | {
190
+ name?: string | undefined;
191
+ actions?: string[] | undefined;
192
+ resourceType?: string | undefined;
193
+ };
194
+ id: string;
195
+ decision: "allow" | "deny" | {
196
+ pluginId: string;
197
+ resourceType: string;
198
+ conditions: PermissionCriteria<RBACPermissionCondition>;
199
+ };
200
+ }, {
201
+ id?: string | undefined;
202
+ match: "*" | {
203
+ name?: string | undefined;
204
+ actions?: string[] | undefined;
205
+ resourceType?: string | undefined;
206
+ };
207
+ decision: "allow" | "deny" | {
208
+ pluginId: string;
209
+ resourceType: string;
210
+ conditions: PermissionCriteria<RBACPermissionCondition>;
211
+ };
212
+ }>, "many">, {
213
+ match: "*" | {
214
+ name?: string | undefined;
215
+ actions?: string[] | undefined;
216
+ resourceType?: string | undefined;
217
+ };
218
+ id: string;
219
+ decision: "allow" | "deny" | {
220
+ pluginId: string;
221
+ resourceType: string;
222
+ conditions: PermissionCriteria<RBACPermissionCondition>;
223
+ };
224
+ }[], {
225
+ id?: string | undefined;
226
+ match: "*" | {
227
+ name?: string | undefined;
228
+ actions?: string[] | undefined;
229
+ resourceType?: string | undefined;
230
+ };
231
+ decision: "allow" | "deny" | {
232
+ pluginId: string;
233
+ resourceType: string;
234
+ conditions: PermissionCriteria<RBACPermissionCondition>;
235
+ };
236
+ }[]>;
237
+ /** @public */
238
+ declare const RoleParser: z.ZodObject<{
239
+ name: z.ZodString;
240
+ id: z.ZodDefault<z.ZodString>;
241
+ members: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">]>;
242
+ permissions: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
243
+ id: z.ZodDefault<z.ZodString>;
244
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
245
+ name: z.ZodOptional<z.ZodString>;
246
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
247
+ resourceType: z.ZodOptional<z.ZodString>;
248
+ }, "strip", z.ZodTypeAny, {
249
+ name?: string | undefined;
250
+ actions?: string[] | undefined;
251
+ resourceType?: string | undefined;
252
+ }, {
253
+ name?: string | undefined;
254
+ actions?: string[] | undefined;
255
+ resourceType?: string | undefined;
256
+ }>]>;
257
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
258
+ pluginId: z.ZodString;
259
+ resourceType: z.ZodString;
260
+ conditions: z.ZodType<PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, PermissionCriteria<RBACPermissionCondition>>;
261
+ }, "strip", z.ZodTypeAny, {
262
+ pluginId: string;
263
+ resourceType: string;
264
+ conditions: PermissionCriteria<RBACPermissionCondition>;
265
+ }, {
266
+ pluginId: string;
267
+ resourceType: string;
268
+ conditions: PermissionCriteria<RBACPermissionCondition>;
269
+ }>]>;
270
+ }, "strip", z.ZodTypeAny, {
271
+ match: "*" | {
272
+ name?: string | undefined;
273
+ actions?: string[] | undefined;
274
+ resourceType?: string | undefined;
275
+ };
276
+ id: string;
277
+ decision: "allow" | "deny" | {
278
+ pluginId: string;
279
+ resourceType: string;
280
+ conditions: PermissionCriteria<RBACPermissionCondition>;
281
+ };
282
+ }, {
283
+ id?: string | undefined;
284
+ match: "*" | {
285
+ name?: string | undefined;
286
+ actions?: string[] | undefined;
287
+ resourceType?: string | undefined;
288
+ };
289
+ decision: "allow" | "deny" | {
290
+ pluginId: string;
291
+ resourceType: string;
292
+ conditions: PermissionCriteria<RBACPermissionCondition>;
293
+ };
294
+ }>, {
295
+ match: "*" | {
296
+ name?: string | undefined;
297
+ actions?: string[] | undefined;
298
+ resourceType?: string | undefined;
299
+ };
300
+ id: string;
301
+ decision: "allow" | "deny" | {
302
+ pluginId: string;
303
+ resourceType: string;
304
+ conditions: PermissionCriteria<RBACPermissionCondition>;
305
+ };
306
+ }, {
307
+ id?: string | undefined;
308
+ match: "*" | {
309
+ name?: string | undefined;
310
+ actions?: string[] | undefined;
311
+ resourceType?: string | undefined;
312
+ };
313
+ decision: "allow" | "deny" | {
314
+ pluginId: string;
315
+ resourceType: string;
316
+ conditions: PermissionCriteria<RBACPermissionCondition>;
317
+ };
318
+ }>, "many">, {
319
+ match: "*" | {
320
+ name?: string | undefined;
321
+ actions?: string[] | undefined;
322
+ resourceType?: string | undefined;
323
+ };
324
+ id: string;
325
+ decision: "allow" | "deny" | {
326
+ pluginId: string;
327
+ resourceType: string;
328
+ conditions: PermissionCriteria<RBACPermissionCondition>;
329
+ };
330
+ }[], {
331
+ id?: string | undefined;
332
+ match: "*" | {
333
+ name?: string | undefined;
334
+ actions?: string[] | undefined;
335
+ resourceType?: string | undefined;
336
+ };
337
+ decision: "allow" | "deny" | {
338
+ pluginId: string;
339
+ resourceType: string;
340
+ conditions: PermissionCriteria<RBACPermissionCondition>;
341
+ };
342
+ }[]>;
343
+ }, "strip", z.ZodTypeAny, {
344
+ id: string;
345
+ name: string;
346
+ members: string[] | "*";
347
+ permissions: {
348
+ match: "*" | {
349
+ name?: string | undefined;
350
+ actions?: string[] | undefined;
351
+ resourceType?: string | undefined;
352
+ };
353
+ id: string;
354
+ decision: "allow" | "deny" | {
355
+ pluginId: string;
356
+ resourceType: string;
357
+ conditions: PermissionCriteria<RBACPermissionCondition>;
358
+ };
359
+ }[];
360
+ }, {
361
+ id?: string | undefined;
362
+ name: string;
363
+ members: string[] | "*";
364
+ permissions: {
365
+ id?: string | undefined;
366
+ match: "*" | {
367
+ name?: string | undefined;
368
+ actions?: string[] | undefined;
369
+ resourceType?: string | undefined;
370
+ };
371
+ decision: "allow" | "deny" | {
372
+ pluginId: string;
373
+ resourceType: string;
374
+ conditions: PermissionCriteria<RBACPermissionCondition>;
375
+ };
376
+ }[];
377
+ }>;
378
+ /** @public */
379
+ declare const RolesParser: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
380
+ name: z.ZodString;
381
+ id: z.ZodDefault<z.ZodString>;
382
+ members: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">]>;
383
+ permissions: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
384
+ id: z.ZodDefault<z.ZodString>;
385
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
386
+ name: z.ZodOptional<z.ZodString>;
387
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
388
+ resourceType: z.ZodOptional<z.ZodString>;
389
+ }, "strip", z.ZodTypeAny, {
390
+ name?: string | undefined;
391
+ actions?: string[] | undefined;
392
+ resourceType?: string | undefined;
393
+ }, {
394
+ name?: string | undefined;
395
+ actions?: string[] | undefined;
396
+ resourceType?: string | undefined;
397
+ }>]>;
398
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
399
+ pluginId: z.ZodString;
400
+ resourceType: z.ZodString;
401
+ conditions: z.ZodType<PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, PermissionCriteria<RBACPermissionCondition>>;
402
+ }, "strip", z.ZodTypeAny, {
403
+ pluginId: string;
404
+ resourceType: string;
405
+ conditions: PermissionCriteria<RBACPermissionCondition>;
406
+ }, {
407
+ pluginId: string;
408
+ resourceType: string;
409
+ conditions: PermissionCriteria<RBACPermissionCondition>;
410
+ }>]>;
411
+ }, "strip", z.ZodTypeAny, {
412
+ match: "*" | {
413
+ name?: string | undefined;
414
+ actions?: string[] | undefined;
415
+ resourceType?: string | undefined;
416
+ };
417
+ id: string;
418
+ decision: "allow" | "deny" | {
419
+ pluginId: string;
420
+ resourceType: string;
421
+ conditions: PermissionCriteria<RBACPermissionCondition>;
422
+ };
423
+ }, {
424
+ id?: string | undefined;
425
+ match: "*" | {
426
+ name?: string | undefined;
427
+ actions?: string[] | undefined;
428
+ resourceType?: string | undefined;
429
+ };
430
+ decision: "allow" | "deny" | {
431
+ pluginId: string;
432
+ resourceType: string;
433
+ conditions: PermissionCriteria<RBACPermissionCondition>;
434
+ };
435
+ }>, {
436
+ match: "*" | {
437
+ name?: string | undefined;
438
+ actions?: string[] | undefined;
439
+ resourceType?: string | undefined;
440
+ };
441
+ id: string;
442
+ decision: "allow" | "deny" | {
443
+ pluginId: string;
444
+ resourceType: string;
445
+ conditions: PermissionCriteria<RBACPermissionCondition>;
446
+ };
447
+ }, {
448
+ id?: string | undefined;
449
+ match: "*" | {
450
+ name?: string | undefined;
451
+ actions?: string[] | undefined;
452
+ resourceType?: string | undefined;
453
+ };
454
+ decision: "allow" | "deny" | {
455
+ pluginId: string;
456
+ resourceType: string;
457
+ conditions: PermissionCriteria<RBACPermissionCondition>;
458
+ };
459
+ }>, "many">, {
460
+ match: "*" | {
461
+ name?: string | undefined;
462
+ actions?: string[] | undefined;
463
+ resourceType?: string | undefined;
464
+ };
465
+ id: string;
466
+ decision: "allow" | "deny" | {
467
+ pluginId: string;
468
+ resourceType: string;
469
+ conditions: PermissionCriteria<RBACPermissionCondition>;
470
+ };
471
+ }[], {
472
+ id?: string | undefined;
473
+ match: "*" | {
474
+ name?: string | undefined;
475
+ actions?: string[] | undefined;
476
+ resourceType?: string | undefined;
477
+ };
478
+ decision: "allow" | "deny" | {
479
+ pluginId: string;
480
+ resourceType: string;
481
+ conditions: PermissionCriteria<RBACPermissionCondition>;
482
+ };
483
+ }[]>;
484
+ }, "strip", z.ZodTypeAny, {
485
+ id: string;
486
+ name: string;
487
+ members: string[] | "*";
488
+ permissions: {
489
+ match: "*" | {
490
+ name?: string | undefined;
491
+ actions?: string[] | undefined;
492
+ resourceType?: string | undefined;
493
+ };
494
+ id: string;
495
+ decision: "allow" | "deny" | {
496
+ pluginId: string;
497
+ resourceType: string;
498
+ conditions: PermissionCriteria<RBACPermissionCondition>;
499
+ };
500
+ }[];
501
+ }, {
502
+ id?: string | undefined;
503
+ name: string;
504
+ members: string[] | "*";
505
+ permissions: {
506
+ id?: string | undefined;
507
+ match: "*" | {
508
+ name?: string | undefined;
509
+ actions?: string[] | undefined;
510
+ resourceType?: string | undefined;
511
+ };
512
+ decision: "allow" | "deny" | {
513
+ pluginId: string;
514
+ resourceType: string;
515
+ conditions: PermissionCriteria<RBACPermissionCondition>;
516
+ };
517
+ }[];
518
+ }>, "many">>, {
519
+ id: string;
520
+ name: string;
521
+ members: string[] | "*";
522
+ permissions: {
523
+ match: "*" | {
524
+ name?: string | undefined;
525
+ actions?: string[] | undefined;
526
+ resourceType?: string | undefined;
527
+ };
528
+ id: string;
529
+ decision: "allow" | "deny" | {
530
+ pluginId: string;
531
+ resourceType: string;
532
+ conditions: PermissionCriteria<RBACPermissionCondition>;
533
+ };
534
+ }[];
535
+ }[], {
536
+ id?: string | undefined;
537
+ name: string;
538
+ members: string[] | "*";
539
+ permissions: {
540
+ id?: string | undefined;
541
+ match: "*" | {
542
+ name?: string | undefined;
543
+ actions?: string[] | undefined;
544
+ resourceType?: string | undefined;
545
+ };
546
+ decision: "allow" | "deny" | {
547
+ pluginId: string;
548
+ resourceType: string;
549
+ conditions: PermissionCriteria<RBACPermissionCondition>;
550
+ };
551
+ }[];
552
+ }[] | undefined>;
553
+ /** @public */
554
+ declare const PolicyTitleParser: z.ZodDefault<z.ZodString>;
555
+ /** @public */
556
+ declare const PolicyConfigParser: z.ZodObject<{
557
+ name: z.ZodDefault<z.ZodString>;
558
+ roles: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
559
+ name: z.ZodString;
560
+ id: z.ZodDefault<z.ZodString>;
561
+ members: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">]>;
562
+ permissions: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
563
+ id: z.ZodDefault<z.ZodString>;
564
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
565
+ name: z.ZodOptional<z.ZodString>;
566
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
567
+ resourceType: z.ZodOptional<z.ZodString>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ name?: string | undefined;
570
+ actions?: string[] | undefined;
571
+ resourceType?: string | undefined;
572
+ }, {
573
+ name?: string | undefined;
574
+ actions?: string[] | undefined;
575
+ resourceType?: string | undefined;
576
+ }>]>;
577
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
578
+ pluginId: z.ZodString;
579
+ resourceType: z.ZodString;
580
+ conditions: z.ZodType<PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, PermissionCriteria<RBACPermissionCondition>>;
581
+ }, "strip", z.ZodTypeAny, {
582
+ pluginId: string;
583
+ resourceType: string;
584
+ conditions: PermissionCriteria<RBACPermissionCondition>;
585
+ }, {
586
+ pluginId: string;
587
+ resourceType: string;
588
+ conditions: PermissionCriteria<RBACPermissionCondition>;
589
+ }>]>;
590
+ }, "strip", z.ZodTypeAny, {
591
+ match: "*" | {
592
+ name?: string | undefined;
593
+ actions?: string[] | undefined;
594
+ resourceType?: string | undefined;
595
+ };
596
+ id: string;
597
+ decision: "allow" | "deny" | {
598
+ pluginId: string;
599
+ resourceType: string;
600
+ conditions: PermissionCriteria<RBACPermissionCondition>;
601
+ };
602
+ }, {
603
+ id?: string | undefined;
604
+ match: "*" | {
605
+ name?: string | undefined;
606
+ actions?: string[] | undefined;
607
+ resourceType?: string | undefined;
608
+ };
609
+ decision: "allow" | "deny" | {
610
+ pluginId: string;
611
+ resourceType: string;
612
+ conditions: PermissionCriteria<RBACPermissionCondition>;
613
+ };
614
+ }>, {
615
+ match: "*" | {
616
+ name?: string | undefined;
617
+ actions?: string[] | undefined;
618
+ resourceType?: string | undefined;
619
+ };
620
+ id: string;
621
+ decision: "allow" | "deny" | {
622
+ pluginId: string;
623
+ resourceType: string;
624
+ conditions: PermissionCriteria<RBACPermissionCondition>;
625
+ };
626
+ }, {
627
+ id?: string | undefined;
628
+ match: "*" | {
629
+ name?: string | undefined;
630
+ actions?: string[] | undefined;
631
+ resourceType?: string | undefined;
632
+ };
633
+ decision: "allow" | "deny" | {
634
+ pluginId: string;
635
+ resourceType: string;
636
+ conditions: PermissionCriteria<RBACPermissionCondition>;
637
+ };
638
+ }>, "many">, {
639
+ match: "*" | {
640
+ name?: string | undefined;
641
+ actions?: string[] | undefined;
642
+ resourceType?: string | undefined;
643
+ };
644
+ id: string;
645
+ decision: "allow" | "deny" | {
646
+ pluginId: string;
647
+ resourceType: string;
648
+ conditions: PermissionCriteria<RBACPermissionCondition>;
649
+ };
650
+ }[], {
651
+ id?: string | undefined;
652
+ match: "*" | {
653
+ name?: string | undefined;
654
+ actions?: string[] | undefined;
655
+ resourceType?: string | undefined;
656
+ };
657
+ decision: "allow" | "deny" | {
658
+ pluginId: string;
659
+ resourceType: string;
660
+ conditions: PermissionCriteria<RBACPermissionCondition>;
661
+ };
662
+ }[]>;
663
+ }, "strip", z.ZodTypeAny, {
664
+ id: string;
665
+ name: string;
666
+ members: string[] | "*";
667
+ permissions: {
668
+ match: "*" | {
669
+ name?: string | undefined;
670
+ actions?: string[] | undefined;
671
+ resourceType?: string | undefined;
672
+ };
673
+ id: string;
674
+ decision: "allow" | "deny" | {
675
+ pluginId: string;
676
+ resourceType: string;
677
+ conditions: PermissionCriteria<RBACPermissionCondition>;
678
+ };
679
+ }[];
680
+ }, {
681
+ id?: string | undefined;
682
+ name: string;
683
+ members: string[] | "*";
684
+ permissions: {
685
+ id?: string | undefined;
686
+ match: "*" | {
687
+ name?: string | undefined;
688
+ actions?: string[] | undefined;
689
+ resourceType?: string | undefined;
690
+ };
691
+ decision: "allow" | "deny" | {
692
+ pluginId: string;
693
+ resourceType: string;
694
+ conditions: PermissionCriteria<RBACPermissionCondition>;
695
+ };
696
+ }[];
697
+ }>, "many">>, {
698
+ id: string;
699
+ name: string;
700
+ members: string[] | "*";
701
+ permissions: {
702
+ match: "*" | {
703
+ name?: string | undefined;
704
+ actions?: string[] | undefined;
705
+ resourceType?: string | undefined;
706
+ };
707
+ id: string;
708
+ decision: "allow" | "deny" | {
709
+ pluginId: string;
710
+ resourceType: string;
711
+ conditions: PermissionCriteria<RBACPermissionCondition>;
712
+ };
713
+ }[];
714
+ }[], {
715
+ id?: string | undefined;
716
+ name: string;
717
+ members: string[] | "*";
718
+ permissions: {
719
+ id?: string | undefined;
720
+ match: "*" | {
721
+ name?: string | undefined;
722
+ actions?: string[] | undefined;
723
+ resourceType?: string | undefined;
724
+ };
725
+ decision: "allow" | "deny" | {
726
+ pluginId: string;
727
+ resourceType: string;
728
+ conditions: PermissionCriteria<RBACPermissionCondition>;
729
+ };
730
+ }[];
731
+ }[] | undefined>;
732
+ }, "strip", z.ZodTypeAny, {
733
+ name: string;
734
+ roles: {
735
+ id: string;
736
+ name: string;
737
+ members: string[] | "*";
738
+ permissions: {
739
+ match: "*" | {
740
+ name?: string | undefined;
741
+ actions?: string[] | undefined;
742
+ resourceType?: string | undefined;
743
+ };
744
+ id: string;
745
+ decision: "allow" | "deny" | {
746
+ pluginId: string;
747
+ resourceType: string;
748
+ conditions: PermissionCriteria<RBACPermissionCondition>;
749
+ };
750
+ }[];
751
+ }[];
752
+ }, {
753
+ name?: string | undefined;
754
+ roles?: {
755
+ id?: string | undefined;
756
+ name: string;
757
+ members: string[] | "*";
758
+ permissions: {
759
+ id?: string | undefined;
760
+ match: "*" | {
761
+ name?: string | undefined;
762
+ actions?: string[] | undefined;
763
+ resourceType?: string | undefined;
764
+ };
765
+ decision: "allow" | "deny" | {
766
+ pluginId: string;
767
+ resourceType: string;
768
+ conditions: PermissionCriteria<RBACPermissionCondition>;
769
+ };
770
+ }[];
771
+ }[] | undefined;
772
+ }>;
773
+ /** @public */
774
+ declare const DefaultingPolicyConfigParser: z.ZodDefault<z.ZodObject<{
775
+ name: z.ZodDefault<z.ZodString>;
776
+ roles: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
777
+ name: z.ZodString;
778
+ id: z.ZodDefault<z.ZodString>;
779
+ members: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">]>;
780
+ permissions: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
781
+ id: z.ZodDefault<z.ZodString>;
782
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
783
+ name: z.ZodOptional<z.ZodString>;
784
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
785
+ resourceType: z.ZodOptional<z.ZodString>;
786
+ }, "strip", z.ZodTypeAny, {
787
+ name?: string | undefined;
788
+ actions?: string[] | undefined;
789
+ resourceType?: string | undefined;
790
+ }, {
791
+ name?: string | undefined;
792
+ actions?: string[] | undefined;
793
+ resourceType?: string | undefined;
794
+ }>]>;
795
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
796
+ pluginId: z.ZodString;
797
+ resourceType: z.ZodString;
798
+ conditions: z.ZodType<PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, PermissionCriteria<RBACPermissionCondition>>;
799
+ }, "strip", z.ZodTypeAny, {
800
+ pluginId: string;
801
+ resourceType: string;
802
+ conditions: PermissionCriteria<RBACPermissionCondition>;
803
+ }, {
804
+ pluginId: string;
805
+ resourceType: string;
806
+ conditions: PermissionCriteria<RBACPermissionCondition>;
807
+ }>]>;
808
+ }, "strip", z.ZodTypeAny, {
809
+ match: "*" | {
810
+ name?: string | undefined;
811
+ actions?: string[] | undefined;
812
+ resourceType?: string | undefined;
813
+ };
814
+ id: string;
815
+ decision: "allow" | "deny" | {
816
+ pluginId: string;
817
+ resourceType: string;
818
+ conditions: PermissionCriteria<RBACPermissionCondition>;
819
+ };
820
+ }, {
821
+ id?: string | undefined;
822
+ match: "*" | {
823
+ name?: string | undefined;
824
+ actions?: string[] | undefined;
825
+ resourceType?: string | undefined;
826
+ };
827
+ decision: "allow" | "deny" | {
828
+ pluginId: string;
829
+ resourceType: string;
830
+ conditions: PermissionCriteria<RBACPermissionCondition>;
831
+ };
832
+ }>, {
833
+ match: "*" | {
834
+ name?: string | undefined;
835
+ actions?: string[] | undefined;
836
+ resourceType?: string | undefined;
837
+ };
838
+ id: string;
839
+ decision: "allow" | "deny" | {
840
+ pluginId: string;
841
+ resourceType: string;
842
+ conditions: PermissionCriteria<RBACPermissionCondition>;
843
+ };
844
+ }, {
845
+ id?: string | undefined;
846
+ match: "*" | {
847
+ name?: string | undefined;
848
+ actions?: string[] | undefined;
849
+ resourceType?: string | undefined;
850
+ };
851
+ decision: "allow" | "deny" | {
852
+ pluginId: string;
853
+ resourceType: string;
854
+ conditions: PermissionCriteria<RBACPermissionCondition>;
855
+ };
856
+ }>, "many">, {
857
+ match: "*" | {
858
+ name?: string | undefined;
859
+ actions?: string[] | undefined;
860
+ resourceType?: string | undefined;
861
+ };
862
+ id: string;
863
+ decision: "allow" | "deny" | {
864
+ pluginId: string;
865
+ resourceType: string;
866
+ conditions: PermissionCriteria<RBACPermissionCondition>;
867
+ };
868
+ }[], {
869
+ id?: string | undefined;
870
+ match: "*" | {
871
+ name?: string | undefined;
872
+ actions?: string[] | undefined;
873
+ resourceType?: string | undefined;
874
+ };
875
+ decision: "allow" | "deny" | {
876
+ pluginId: string;
877
+ resourceType: string;
878
+ conditions: PermissionCriteria<RBACPermissionCondition>;
879
+ };
880
+ }[]>;
881
+ }, "strip", z.ZodTypeAny, {
882
+ id: string;
883
+ name: string;
884
+ members: string[] | "*";
885
+ permissions: {
886
+ match: "*" | {
887
+ name?: string | undefined;
888
+ actions?: string[] | undefined;
889
+ resourceType?: string | undefined;
890
+ };
891
+ id: string;
892
+ decision: "allow" | "deny" | {
893
+ pluginId: string;
894
+ resourceType: string;
895
+ conditions: PermissionCriteria<RBACPermissionCondition>;
896
+ };
897
+ }[];
898
+ }, {
899
+ id?: string | undefined;
900
+ name: string;
901
+ members: string[] | "*";
902
+ permissions: {
903
+ id?: string | undefined;
904
+ match: "*" | {
905
+ name?: string | undefined;
906
+ actions?: string[] | undefined;
907
+ resourceType?: string | undefined;
908
+ };
909
+ decision: "allow" | "deny" | {
910
+ pluginId: string;
911
+ resourceType: string;
912
+ conditions: PermissionCriteria<RBACPermissionCondition>;
913
+ };
914
+ }[];
915
+ }>, "many">>, {
916
+ id: string;
917
+ name: string;
918
+ members: string[] | "*";
919
+ permissions: {
920
+ match: "*" | {
921
+ name?: string | undefined;
922
+ actions?: string[] | undefined;
923
+ resourceType?: string | undefined;
924
+ };
925
+ id: string;
926
+ decision: "allow" | "deny" | {
927
+ pluginId: string;
928
+ resourceType: string;
929
+ conditions: PermissionCriteria<RBACPermissionCondition>;
930
+ };
931
+ }[];
932
+ }[], {
933
+ id?: string | undefined;
934
+ name: string;
935
+ members: string[] | "*";
936
+ permissions: {
937
+ id?: string | undefined;
938
+ match: "*" | {
939
+ name?: string | undefined;
940
+ actions?: string[] | undefined;
941
+ resourceType?: string | undefined;
942
+ };
943
+ decision: "allow" | "deny" | {
944
+ pluginId: string;
945
+ resourceType: string;
946
+ conditions: PermissionCriteria<RBACPermissionCondition>;
947
+ };
948
+ }[];
949
+ }[] | undefined>;
950
+ }, "strip", z.ZodTypeAny, {
951
+ name: string;
952
+ roles: {
953
+ id: string;
954
+ name: string;
955
+ members: string[] | "*";
956
+ permissions: {
957
+ match: "*" | {
958
+ name?: string | undefined;
959
+ actions?: string[] | undefined;
960
+ resourceType?: string | undefined;
961
+ };
962
+ id: string;
963
+ decision: "allow" | "deny" | {
964
+ pluginId: string;
965
+ resourceType: string;
966
+ conditions: PermissionCriteria<RBACPermissionCondition>;
967
+ };
968
+ }[];
969
+ }[];
970
+ }, {
971
+ name?: string | undefined;
972
+ roles?: {
973
+ id?: string | undefined;
974
+ name: string;
975
+ members: string[] | "*";
976
+ permissions: {
977
+ id?: string | undefined;
978
+ match: "*" | {
979
+ name?: string | undefined;
980
+ actions?: string[] | undefined;
981
+ resourceType?: string | undefined;
982
+ };
983
+ decision: "allow" | "deny" | {
984
+ pluginId: string;
985
+ resourceType: string;
986
+ conditions: PermissionCriteria<RBACPermissionCondition>;
987
+ };
988
+ }[];
989
+ }[] | undefined;
990
+ }>>;
991
+ /** @public */
992
+ declare function isConditionalDecision(decision: PermissionDecision): decision is ConditionalDecision;
993
+ /** @public */
994
+ declare function isAllOfPermissionCriteria(conditions: PermissionCriteria<RBACPermissionCondition>): conditions is AllOfCriteria<RBACPermissionCondition>;
995
+ /** @public */
996
+ declare function isAnyOfPermissionCriteria(conditions: PermissionCriteria<RBACPermissionCondition>): conditions is AnyOfCriteria<RBACPermissionCondition>;
997
+ /** @public */
998
+ declare function isNotPermissionCriteria(conditions: PermissionCriteria<RBACPermissionCondition>): conditions is NotCriteria<RBACPermissionCondition>;
999
+ /** @public */
1000
+ declare type ConditionalDecision = z.infer<typeof ConditionalDecisionParser>;
1001
+ /** @public */
1002
+ declare type LiteralDecision = z.infer<typeof LiteralDecisionParser>;
1003
+ /** @public */
1004
+ declare type PermissionDecision = z.infer<typeof PermissionDecisionParser>;
1005
+ /** @public */
1006
+ declare type PermissionMatch = z.infer<typeof PermissionMatchParser>;
1007
+ /** @public */
1008
+ declare type RolePermission = z.infer<typeof RolePermissionParser>;
1009
+ /** @public */
1010
+ declare type RolePermissions = z.infer<typeof RolePermissionsParser>;
1011
+ /** @public */
1012
+ declare type RawRole = z.input<typeof RoleParser>;
1013
+ /** @public */
1014
+ declare type Role = z.infer<typeof RoleParser>;
1015
+ /** @public */
1016
+ declare type RawPolicyConfig = z.input<typeof PolicyConfigParser>;
1017
+ /** @public */
1018
+ declare type PolicyConfig = z.infer<typeof PolicyConfigParser>;
1019
+
1020
+ /** @public */
1021
+ declare type Policy = {
1022
+ /**
1023
+ * Internal ID for lookups/references.
1024
+ */
1025
+ id: string;
1026
+ /**
1027
+ * Display name for the version.
1028
+ */
1029
+ name: string;
1030
+ /**
1031
+ * Date that the version was created in ISO-8601 format.
1032
+ */
1033
+ createdAt: string;
1034
+ /**
1035
+ * Entity ref of the user that created the version.
1036
+ */
1037
+ createdBy: string;
1038
+ /**
1039
+ * Latest date on which the version was updated in ISO-8601 format.
1040
+ */
1041
+ updatedAt: string;
1042
+ /**
1043
+ * Entity ref of the latest user that updated the version.
1044
+ */
1045
+ updatedBy: string;
1046
+ /**
1047
+ * Description of the changes introduced with the version.
1048
+ */
1049
+ description?: string;
1050
+ /**
1051
+ * Latest date on which the version was published in ISO-8601 format.
1052
+ */
1053
+ lastPublishedAt?: string;
1054
+ /**
1055
+ * Entity ref of the latest user that published the version.
1056
+ */
1057
+ lastPublishedBy?: string;
1058
+ /**
1059
+ * List of role configurations for policy evaluation.
1060
+ */
1061
+ roles: Role[];
1062
+ /**
1063
+ * Current status of the policy.
1064
+ */
1065
+ status: 'draft' | 'active' | 'inactive';
1066
+ };
1067
+
1068
+ /** @public */
1069
+ declare const CreateDraftRequestParser: z.ZodObject<{
1070
+ name: z.ZodDefault<z.ZodString>;
1071
+ roles: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
1072
+ name: z.ZodString;
1073
+ id: z.ZodDefault<z.ZodString>;
1074
+ members: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">]>;
1075
+ permissions: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
1076
+ id: z.ZodDefault<z.ZodString>;
1077
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
1078
+ name: z.ZodOptional<z.ZodString>;
1079
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1080
+ resourceType: z.ZodOptional<z.ZodString>;
1081
+ }, "strip", z.ZodTypeAny, {
1082
+ name?: string | undefined;
1083
+ actions?: string[] | undefined;
1084
+ resourceType?: string | undefined;
1085
+ }, {
1086
+ name?: string | undefined;
1087
+ actions?: string[] | undefined;
1088
+ resourceType?: string | undefined;
1089
+ }>]>;
1090
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
1091
+ pluginId: z.ZodString;
1092
+ resourceType: z.ZodString;
1093
+ conditions: z.ZodType<_backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>>;
1094
+ }, "strip", z.ZodTypeAny, {
1095
+ pluginId: string;
1096
+ resourceType: string;
1097
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1098
+ }, {
1099
+ pluginId: string;
1100
+ resourceType: string;
1101
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1102
+ }>]>;
1103
+ }, "strip", z.ZodTypeAny, {
1104
+ match: "*" | {
1105
+ name?: string | undefined;
1106
+ actions?: string[] | undefined;
1107
+ resourceType?: string | undefined;
1108
+ };
1109
+ id: string;
1110
+ decision: "allow" | "deny" | {
1111
+ pluginId: string;
1112
+ resourceType: string;
1113
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1114
+ };
1115
+ }, {
1116
+ id?: string | undefined;
1117
+ match: "*" | {
1118
+ name?: string | undefined;
1119
+ actions?: string[] | undefined;
1120
+ resourceType?: string | undefined;
1121
+ };
1122
+ decision: "allow" | "deny" | {
1123
+ pluginId: string;
1124
+ resourceType: string;
1125
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1126
+ };
1127
+ }>, {
1128
+ match: "*" | {
1129
+ name?: string | undefined;
1130
+ actions?: string[] | undefined;
1131
+ resourceType?: string | undefined;
1132
+ };
1133
+ id: string;
1134
+ decision: "allow" | "deny" | {
1135
+ pluginId: string;
1136
+ resourceType: string;
1137
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1138
+ };
1139
+ }, {
1140
+ id?: string | undefined;
1141
+ match: "*" | {
1142
+ name?: string | undefined;
1143
+ actions?: string[] | undefined;
1144
+ resourceType?: string | undefined;
1145
+ };
1146
+ decision: "allow" | "deny" | {
1147
+ pluginId: string;
1148
+ resourceType: string;
1149
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1150
+ };
1151
+ }>, "many">, {
1152
+ match: "*" | {
1153
+ name?: string | undefined;
1154
+ actions?: string[] | undefined;
1155
+ resourceType?: string | undefined;
1156
+ };
1157
+ id: string;
1158
+ decision: "allow" | "deny" | {
1159
+ pluginId: string;
1160
+ resourceType: string;
1161
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1162
+ };
1163
+ }[], {
1164
+ id?: string | undefined;
1165
+ match: "*" | {
1166
+ name?: string | undefined;
1167
+ actions?: string[] | undefined;
1168
+ resourceType?: string | undefined;
1169
+ };
1170
+ decision: "allow" | "deny" | {
1171
+ pluginId: string;
1172
+ resourceType: string;
1173
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1174
+ };
1175
+ }[]>;
1176
+ }, "strip", z.ZodTypeAny, {
1177
+ id: string;
1178
+ name: string;
1179
+ members: string[] | "*";
1180
+ permissions: {
1181
+ match: "*" | {
1182
+ name?: string | undefined;
1183
+ actions?: string[] | undefined;
1184
+ resourceType?: string | undefined;
1185
+ };
1186
+ id: string;
1187
+ decision: "allow" | "deny" | {
1188
+ pluginId: string;
1189
+ resourceType: string;
1190
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1191
+ };
1192
+ }[];
1193
+ }, {
1194
+ id?: string | undefined;
1195
+ name: string;
1196
+ members: string[] | "*";
1197
+ permissions: {
1198
+ id?: string | undefined;
1199
+ match: "*" | {
1200
+ name?: string | undefined;
1201
+ actions?: string[] | undefined;
1202
+ resourceType?: string | undefined;
1203
+ };
1204
+ decision: "allow" | "deny" | {
1205
+ pluginId: string;
1206
+ resourceType: string;
1207
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1208
+ };
1209
+ }[];
1210
+ }>, "many">>, {
1211
+ id: string;
1212
+ name: string;
1213
+ members: string[] | "*";
1214
+ permissions: {
1215
+ match: "*" | {
1216
+ name?: string | undefined;
1217
+ actions?: string[] | undefined;
1218
+ resourceType?: string | undefined;
1219
+ };
1220
+ id: string;
1221
+ decision: "allow" | "deny" | {
1222
+ pluginId: string;
1223
+ resourceType: string;
1224
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1225
+ };
1226
+ }[];
1227
+ }[], {
1228
+ id?: string | undefined;
1229
+ name: string;
1230
+ members: string[] | "*";
1231
+ permissions: {
1232
+ id?: string | undefined;
1233
+ match: "*" | {
1234
+ name?: string | undefined;
1235
+ actions?: string[] | undefined;
1236
+ resourceType?: string | undefined;
1237
+ };
1238
+ decision: "allow" | "deny" | {
1239
+ pluginId: string;
1240
+ resourceType: string;
1241
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1242
+ };
1243
+ }[];
1244
+ }[] | undefined>;
1245
+ }, "strip", z.ZodTypeAny, {
1246
+ name: string;
1247
+ roles: {
1248
+ id: string;
1249
+ name: string;
1250
+ members: string[] | "*";
1251
+ permissions: {
1252
+ match: "*" | {
1253
+ name?: string | undefined;
1254
+ actions?: string[] | undefined;
1255
+ resourceType?: string | undefined;
1256
+ };
1257
+ id: string;
1258
+ decision: "allow" | "deny" | {
1259
+ pluginId: string;
1260
+ resourceType: string;
1261
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1262
+ };
1263
+ }[];
1264
+ }[];
1265
+ }, {
1266
+ name?: string | undefined;
1267
+ roles?: {
1268
+ id?: string | undefined;
1269
+ name: string;
1270
+ members: string[] | "*";
1271
+ permissions: {
1272
+ id?: string | undefined;
1273
+ match: "*" | {
1274
+ name?: string | undefined;
1275
+ actions?: string[] | undefined;
1276
+ resourceType?: string | undefined;
1277
+ };
1278
+ decision: "allow" | "deny" | {
1279
+ pluginId: string;
1280
+ resourceType: string;
1281
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1282
+ };
1283
+ }[];
1284
+ }[] | undefined;
1285
+ }>;
1286
+ /** @public */
1287
+ declare const UpdateDraftRequestParser: z.ZodObject<z.extendShape<{
1288
+ name: z.ZodDefault<z.ZodString>;
1289
+ roles: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
1290
+ name: z.ZodString;
1291
+ id: z.ZodDefault<z.ZodString>;
1292
+ members: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">]>;
1293
+ permissions: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
1294
+ id: z.ZodDefault<z.ZodString>;
1295
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
1296
+ name: z.ZodOptional<z.ZodString>;
1297
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1298
+ resourceType: z.ZodOptional<z.ZodString>;
1299
+ }, "strip", z.ZodTypeAny, {
1300
+ name?: string | undefined;
1301
+ actions?: string[] | undefined;
1302
+ resourceType?: string | undefined;
1303
+ }, {
1304
+ name?: string | undefined;
1305
+ actions?: string[] | undefined;
1306
+ resourceType?: string | undefined;
1307
+ }>]>;
1308
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
1309
+ pluginId: z.ZodString;
1310
+ resourceType: z.ZodString;
1311
+ conditions: z.ZodType<_backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>>;
1312
+ }, "strip", z.ZodTypeAny, {
1313
+ pluginId: string;
1314
+ resourceType: string;
1315
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1316
+ }, {
1317
+ pluginId: string;
1318
+ resourceType: string;
1319
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1320
+ }>]>;
1321
+ }, "strip", z.ZodTypeAny, {
1322
+ match: "*" | {
1323
+ name?: string | undefined;
1324
+ actions?: string[] | undefined;
1325
+ resourceType?: string | undefined;
1326
+ };
1327
+ id: string;
1328
+ decision: "allow" | "deny" | {
1329
+ pluginId: string;
1330
+ resourceType: string;
1331
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1332
+ };
1333
+ }, {
1334
+ id?: string | undefined;
1335
+ match: "*" | {
1336
+ name?: string | undefined;
1337
+ actions?: string[] | undefined;
1338
+ resourceType?: string | undefined;
1339
+ };
1340
+ decision: "allow" | "deny" | {
1341
+ pluginId: string;
1342
+ resourceType: string;
1343
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1344
+ };
1345
+ }>, {
1346
+ match: "*" | {
1347
+ name?: string | undefined;
1348
+ actions?: string[] | undefined;
1349
+ resourceType?: string | undefined;
1350
+ };
1351
+ id: string;
1352
+ decision: "allow" | "deny" | {
1353
+ pluginId: string;
1354
+ resourceType: string;
1355
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1356
+ };
1357
+ }, {
1358
+ id?: string | undefined;
1359
+ match: "*" | {
1360
+ name?: string | undefined;
1361
+ actions?: string[] | undefined;
1362
+ resourceType?: string | undefined;
1363
+ };
1364
+ decision: "allow" | "deny" | {
1365
+ pluginId: string;
1366
+ resourceType: string;
1367
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1368
+ };
1369
+ }>, "many">, {
1370
+ match: "*" | {
1371
+ name?: string | undefined;
1372
+ actions?: string[] | undefined;
1373
+ resourceType?: string | undefined;
1374
+ };
1375
+ id: string;
1376
+ decision: "allow" | "deny" | {
1377
+ pluginId: string;
1378
+ resourceType: string;
1379
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1380
+ };
1381
+ }[], {
1382
+ id?: string | undefined;
1383
+ match: "*" | {
1384
+ name?: string | undefined;
1385
+ actions?: string[] | undefined;
1386
+ resourceType?: string | undefined;
1387
+ };
1388
+ decision: "allow" | "deny" | {
1389
+ pluginId: string;
1390
+ resourceType: string;
1391
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1392
+ };
1393
+ }[]>;
1394
+ }, "strip", z.ZodTypeAny, {
1395
+ id: string;
1396
+ name: string;
1397
+ members: string[] | "*";
1398
+ permissions: {
1399
+ match: "*" | {
1400
+ name?: string | undefined;
1401
+ actions?: string[] | undefined;
1402
+ resourceType?: string | undefined;
1403
+ };
1404
+ id: string;
1405
+ decision: "allow" | "deny" | {
1406
+ pluginId: string;
1407
+ resourceType: string;
1408
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1409
+ };
1410
+ }[];
1411
+ }, {
1412
+ id?: string | undefined;
1413
+ name: string;
1414
+ members: string[] | "*";
1415
+ permissions: {
1416
+ id?: string | undefined;
1417
+ match: "*" | {
1418
+ name?: string | undefined;
1419
+ actions?: string[] | undefined;
1420
+ resourceType?: string | undefined;
1421
+ };
1422
+ decision: "allow" | "deny" | {
1423
+ pluginId: string;
1424
+ resourceType: string;
1425
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1426
+ };
1427
+ }[];
1428
+ }>, "many">>, {
1429
+ id: string;
1430
+ name: string;
1431
+ members: string[] | "*";
1432
+ permissions: {
1433
+ match: "*" | {
1434
+ name?: string | undefined;
1435
+ actions?: string[] | undefined;
1436
+ resourceType?: string | undefined;
1437
+ };
1438
+ id: string;
1439
+ decision: "allow" | "deny" | {
1440
+ pluginId: string;
1441
+ resourceType: string;
1442
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1443
+ };
1444
+ }[];
1445
+ }[], {
1446
+ id?: string | undefined;
1447
+ name: string;
1448
+ members: string[] | "*";
1449
+ permissions: {
1450
+ id?: string | undefined;
1451
+ match: "*" | {
1452
+ name?: string | undefined;
1453
+ actions?: string[] | undefined;
1454
+ resourceType?: string | undefined;
1455
+ };
1456
+ decision: "allow" | "deny" | {
1457
+ pluginId: string;
1458
+ resourceType: string;
1459
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1460
+ };
1461
+ }[];
1462
+ }[] | undefined>;
1463
+ }, {
1464
+ name: z.ZodOptional<z.ZodDefault<z.ZodString>>;
1465
+ roles: z.ZodOptional<z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
1466
+ name: z.ZodString;
1467
+ id: z.ZodDefault<z.ZodString>;
1468
+ members: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">]>;
1469
+ permissions: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
1470
+ id: z.ZodDefault<z.ZodString>;
1471
+ match: z.ZodUnion<[z.ZodLiteral<"*">, z.ZodObject<{
1472
+ name: z.ZodOptional<z.ZodString>;
1473
+ actions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1474
+ resourceType: z.ZodOptional<z.ZodString>;
1475
+ }, "strip", z.ZodTypeAny, {
1476
+ name?: string | undefined;
1477
+ actions?: string[] | undefined;
1478
+ resourceType?: string | undefined;
1479
+ }, {
1480
+ name?: string | undefined;
1481
+ actions?: string[] | undefined;
1482
+ resourceType?: string | undefined;
1483
+ }>]>;
1484
+ decision: z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"allow">, z.ZodLiteral<"deny">]>, z.ZodObject<{
1485
+ pluginId: z.ZodString;
1486
+ resourceType: z.ZodString;
1487
+ conditions: z.ZodType<_backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>, z.ZodTypeDef, _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>>;
1488
+ }, "strip", z.ZodTypeAny, {
1489
+ pluginId: string;
1490
+ resourceType: string;
1491
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1492
+ }, {
1493
+ pluginId: string;
1494
+ resourceType: string;
1495
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1496
+ }>]>;
1497
+ }, "strip", z.ZodTypeAny, {
1498
+ match: "*" | {
1499
+ name?: string | undefined;
1500
+ actions?: string[] | undefined;
1501
+ resourceType?: string | undefined;
1502
+ };
1503
+ id: string;
1504
+ decision: "allow" | "deny" | {
1505
+ pluginId: string;
1506
+ resourceType: string;
1507
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1508
+ };
1509
+ }, {
1510
+ id?: string | undefined;
1511
+ match: "*" | {
1512
+ name?: string | undefined;
1513
+ actions?: string[] | undefined;
1514
+ resourceType?: string | undefined;
1515
+ };
1516
+ decision: "allow" | "deny" | {
1517
+ pluginId: string;
1518
+ resourceType: string;
1519
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1520
+ };
1521
+ }>, {
1522
+ match: "*" | {
1523
+ name?: string | undefined;
1524
+ actions?: string[] | undefined;
1525
+ resourceType?: string | undefined;
1526
+ };
1527
+ id: string;
1528
+ decision: "allow" | "deny" | {
1529
+ pluginId: string;
1530
+ resourceType: string;
1531
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1532
+ };
1533
+ }, {
1534
+ id?: string | undefined;
1535
+ match: "*" | {
1536
+ name?: string | undefined;
1537
+ actions?: string[] | undefined;
1538
+ resourceType?: string | undefined;
1539
+ };
1540
+ decision: "allow" | "deny" | {
1541
+ pluginId: string;
1542
+ resourceType: string;
1543
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1544
+ };
1545
+ }>, "many">, {
1546
+ match: "*" | {
1547
+ name?: string | undefined;
1548
+ actions?: string[] | undefined;
1549
+ resourceType?: string | undefined;
1550
+ };
1551
+ id: string;
1552
+ decision: "allow" | "deny" | {
1553
+ pluginId: string;
1554
+ resourceType: string;
1555
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1556
+ };
1557
+ }[], {
1558
+ id?: string | undefined;
1559
+ match: "*" | {
1560
+ name?: string | undefined;
1561
+ actions?: string[] | undefined;
1562
+ resourceType?: string | undefined;
1563
+ };
1564
+ decision: "allow" | "deny" | {
1565
+ pluginId: string;
1566
+ resourceType: string;
1567
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1568
+ };
1569
+ }[]>;
1570
+ }, "strip", z.ZodTypeAny, {
1571
+ id: string;
1572
+ name: string;
1573
+ members: string[] | "*";
1574
+ permissions: {
1575
+ match: "*" | {
1576
+ name?: string | undefined;
1577
+ actions?: string[] | undefined;
1578
+ resourceType?: string | undefined;
1579
+ };
1580
+ id: string;
1581
+ decision: "allow" | "deny" | {
1582
+ pluginId: string;
1583
+ resourceType: string;
1584
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1585
+ };
1586
+ }[];
1587
+ }, {
1588
+ id?: string | undefined;
1589
+ name: string;
1590
+ members: string[] | "*";
1591
+ permissions: {
1592
+ id?: string | undefined;
1593
+ match: "*" | {
1594
+ name?: string | undefined;
1595
+ actions?: string[] | undefined;
1596
+ resourceType?: string | undefined;
1597
+ };
1598
+ decision: "allow" | "deny" | {
1599
+ pluginId: string;
1600
+ resourceType: string;
1601
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1602
+ };
1603
+ }[];
1604
+ }>, "many">>, {
1605
+ id: string;
1606
+ name: string;
1607
+ members: string[] | "*";
1608
+ permissions: {
1609
+ match: "*" | {
1610
+ name?: string | undefined;
1611
+ actions?: string[] | undefined;
1612
+ resourceType?: string | undefined;
1613
+ };
1614
+ id: string;
1615
+ decision: "allow" | "deny" | {
1616
+ pluginId: string;
1617
+ resourceType: string;
1618
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1619
+ };
1620
+ }[];
1621
+ }[], {
1622
+ id?: string | undefined;
1623
+ name: string;
1624
+ members: string[] | "*";
1625
+ permissions: {
1626
+ id?: string | undefined;
1627
+ match: "*" | {
1628
+ name?: string | undefined;
1629
+ actions?: string[] | undefined;
1630
+ resourceType?: string | undefined;
1631
+ };
1632
+ decision: "allow" | "deny" | {
1633
+ pluginId: string;
1634
+ resourceType: string;
1635
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1636
+ };
1637
+ }[];
1638
+ }[] | undefined>>;
1639
+ }>, "strip", z.ZodTypeAny, {
1640
+ name?: string | undefined;
1641
+ roles?: {
1642
+ id: string;
1643
+ name: string;
1644
+ members: string[] | "*";
1645
+ permissions: {
1646
+ match: "*" | {
1647
+ name?: string | undefined;
1648
+ actions?: string[] | undefined;
1649
+ resourceType?: string | undefined;
1650
+ };
1651
+ id: string;
1652
+ decision: "allow" | "deny" | {
1653
+ pluginId: string;
1654
+ resourceType: string;
1655
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1656
+ };
1657
+ }[];
1658
+ }[] | undefined;
1659
+ }, {
1660
+ name?: string | undefined;
1661
+ roles?: {
1662
+ id?: string | undefined;
1663
+ name: string;
1664
+ members: string[] | "*";
1665
+ permissions: {
1666
+ id?: string | undefined;
1667
+ match: "*" | {
1668
+ name?: string | undefined;
1669
+ actions?: string[] | undefined;
1670
+ resourceType?: string | undefined;
1671
+ };
1672
+ decision: "allow" | "deny" | {
1673
+ pluginId: string;
1674
+ resourceType: string;
1675
+ conditions: _backstage_plugin_permission_common.PermissionCriteria<RBACPermissionCondition>;
1676
+ };
1677
+ }[];
1678
+ }[] | undefined;
1679
+ }>;
1680
+ /** @public */
1681
+ declare const PublishVersionRequestParser: z.ZodObject<{
1682
+ description: z.ZodOptional<z.ZodString>;
1683
+ }, "strip", z.ZodTypeAny, {
1684
+ description?: string | undefined;
1685
+ }, {
1686
+ description?: string | undefined;
1687
+ }>;
1688
+ /** @public */
1689
+ declare type CreateDraftRequest = z.input<typeof CreateDraftRequestParser>;
1690
+ /** @public */
1691
+ declare type UpdateDraftRequest = z.input<typeof UpdateDraftRequestParser>;
1692
+ /** @public */
1693
+ declare type PublishVersionRequest = z.infer<typeof PublishVersionRequestParser>;
1694
+ /** @public */
1695
+ declare type SearchMembersRequest = {
1696
+ query: string;
1697
+ };
1698
+ /** @public */
1699
+ declare type AuthorizeResponse = {
1700
+ authorized: boolean;
1701
+ };
1702
+ /** @public */
1703
+ declare type MemberResponse = {
1704
+ name?: string;
1705
+ type: 'user' | 'group' | 'all' | 'unknown';
1706
+ entityRef: string;
1707
+ };
1708
+ /** @public */
1709
+ declare type PolicyMember = {
1710
+ policyId: string;
1711
+ members: MemberResponse[];
1712
+ };
1713
+ /** @public */
1714
+ declare type SearchMembersResponse = {
1715
+ members: MemberResponse[];
1716
+ };
1717
+ /** @public */
1718
+ declare type PaginatedResponse<T> = {
1719
+ items: T[];
1720
+ nextCursor?: string;
1721
+ prevCursor?: string;
1722
+ totalItems: number;
1723
+ };
1724
+ /** @public */
1725
+ declare type PoliciesResponse = PaginatedResponse<Policy>;
1726
+
1727
+ /** @public */
1728
+ declare const isMatchingPermission: (permission: Permission, match: PermissionMatch) => boolean;
1729
+
1730
+ /** @public */
1731
+ declare type MapParamsCallback = (param: PermissionRuleParam) => PermissionRuleParam;
1732
+ /** @public */
1733
+ declare function mapParams(params: PermissionRuleParams, cb: MapParamsCallback): PermissionRuleParams;
1734
+
1735
+ export { AuthorizeResponse, BackstageUserPlaceholder, ConditionalDecision, ConditionalDecisionParser, CreateDraftRequest, CreateDraftRequestParser, DefaultingPolicyConfigParser, LiteralDecision, LiteralDecisionParser, MapParamsCallback, MemberResponse, PaginatedResponse, PermissionConditionParser, PermissionDecision, PermissionDecisionParser, PermissionMatch, PermissionMatchParser, PoliciesResponse, Policy, PolicyConfig, PolicyConfigParser, PolicyDefaultName, PolicyMember, PolicyTitleParser, PublishVersionRequest, PublishVersionRequestParser, RBACPermissionCondition, RawPolicyConfig, RawRole, Role, RoleParser, RolePermission, RolePermissionParser, RolePermissions, RolePermissionsParser, RolesParser, SearchMembersRequest, SearchMembersResponse, UpdateDraftRequest, UpdateDraftRequestParser, isAllOfPermissionCriteria, isAnyOfPermissionCriteria, isConditionalDecision, isMatchingPermission, isNotPermissionCriteria, mapParams };