@spotify/backstage-plugin-rbac-common 0.5.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @spotify/backstage-plugin-rbac-common
2
2
 
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Upgraded to Backstage `v1.14.0`
8
+
9
+ ## 0.5.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Upgraded Backstage to `v1.13.0`.
14
+
3
15
  ## 0.5.0
4
16
 
5
17
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ declare const PolicyDefaultName = "Untitled policy";
8
8
  /** @public */
9
9
  declare const BackstageUserPlaceholder = ":backstageUser";
10
10
  /** @public */
11
- declare type RBACPermissionCondition = Omit<PermissionCondition, 'resourceType'>;
11
+ type RBACPermissionCondition = Omit<PermissionCondition, 'resourceType'>;
12
12
  /** @public */
13
13
  declare const PermissionConditionParser: z.ZodSchema<RBACPermissionCondition>;
14
14
  /** @public */
@@ -471,8 +471,8 @@ declare const RoleParser: z.ZodObject<{
471
471
  }[]>;
472
472
  }, "strip", z.ZodTypeAny, {
473
473
  id: string;
474
- members: (string[] | "*") & (string[] | "*" | undefined);
475
474
  name: string;
475
+ members: (string[] | "*") & (string[] | "*" | undefined);
476
476
  permissions: {
477
477
  id: string;
478
478
  match: ("*" | {
@@ -495,8 +495,8 @@ declare const RoleParser: z.ZodObject<{
495
495
  } | "deny" | undefined);
496
496
  }[];
497
497
  }, {
498
- members: (string[] | "*") & (string[] | "*" | undefined);
499
498
  name: string;
499
+ members: (string[] | "*") & (string[] | "*" | undefined);
500
500
  permissions: {
501
501
  match: ("*" | {
502
502
  name?: string | undefined;
@@ -676,8 +676,8 @@ declare const RolesParser: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
676
676
  }[]>;
677
677
  }, "strip", z.ZodTypeAny, {
678
678
  id: string;
679
- members: (string[] | "*") & (string[] | "*" | undefined);
680
679
  name: string;
680
+ members: (string[] | "*") & (string[] | "*" | undefined);
681
681
  permissions: {
682
682
  id: string;
683
683
  match: ("*" | {
@@ -700,8 +700,8 @@ declare const RolesParser: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
700
700
  } | "deny" | undefined);
701
701
  }[];
702
702
  }, {
703
- members: (string[] | "*") & (string[] | "*" | undefined);
704
703
  name: string;
704
+ members: (string[] | "*") & (string[] | "*" | undefined);
705
705
  permissions: {
706
706
  match: ("*" | {
707
707
  name?: string | undefined;
@@ -726,8 +726,8 @@ declare const RolesParser: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
726
726
  id?: string | undefined;
727
727
  }>, "many">>, {
728
728
  id: string;
729
- members: (string[] | "*") & (string[] | "*" | undefined);
730
729
  name: string;
730
+ members: (string[] | "*") & (string[] | "*" | undefined);
731
731
  permissions: {
732
732
  id: string;
733
733
  match: ("*" | {
@@ -750,8 +750,8 @@ declare const RolesParser: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
750
750
  } | "deny" | undefined);
751
751
  }[];
752
752
  }[], {
753
- members: (string[] | "*") & (string[] | "*" | undefined);
754
753
  name: string;
754
+ members: (string[] | "*") & (string[] | "*" | undefined);
755
755
  permissions: {
756
756
  match: ("*" | {
757
757
  name?: string | undefined;
@@ -952,8 +952,8 @@ declare const PolicyConfigParser: z.ZodObject<{
952
952
  }[]>;
953
953
  }, "strip", z.ZodTypeAny, {
954
954
  id: string;
955
- members: (string[] | "*") & (string[] | "*" | undefined);
956
955
  name: string;
956
+ members: (string[] | "*") & (string[] | "*" | undefined);
957
957
  permissions: {
958
958
  id: string;
959
959
  match: ("*" | {
@@ -976,8 +976,8 @@ declare const PolicyConfigParser: z.ZodObject<{
976
976
  } | "deny" | undefined);
977
977
  }[];
978
978
  }, {
979
- members: (string[] | "*") & (string[] | "*" | undefined);
980
979
  name: string;
980
+ members: (string[] | "*") & (string[] | "*" | undefined);
981
981
  permissions: {
982
982
  match: ("*" | {
983
983
  name?: string | undefined;
@@ -1002,8 +1002,8 @@ declare const PolicyConfigParser: z.ZodObject<{
1002
1002
  id?: string | undefined;
1003
1003
  }>, "many">>, {
1004
1004
  id: string;
1005
- members: (string[] | "*") & (string[] | "*" | undefined);
1006
1005
  name: string;
1006
+ members: (string[] | "*") & (string[] | "*" | undefined);
1007
1007
  permissions: {
1008
1008
  id: string;
1009
1009
  match: ("*" | {
@@ -1026,8 +1026,8 @@ declare const PolicyConfigParser: z.ZodObject<{
1026
1026
  } | "deny" | undefined);
1027
1027
  }[];
1028
1028
  }[], {
1029
- members: (string[] | "*") & (string[] | "*" | undefined);
1030
1029
  name: string;
1030
+ members: (string[] | "*") & (string[] | "*" | undefined);
1031
1031
  permissions: {
1032
1032
  match: ("*" | {
1033
1033
  name?: string | undefined;
@@ -1058,8 +1058,8 @@ declare const PolicyConfigParser: z.ZodObject<{
1058
1058
  };
1059
1059
  roles: {
1060
1060
  id: string;
1061
- members: (string[] | "*") & (string[] | "*" | undefined);
1062
1061
  name: string;
1062
+ members: (string[] | "*") & (string[] | "*" | undefined);
1063
1063
  permissions: {
1064
1064
  id: string;
1065
1065
  match: ("*" | {
@@ -1088,8 +1088,8 @@ declare const PolicyConfigParser: z.ZodObject<{
1088
1088
  resolutionStrategy: "first-match" | "any-allow";
1089
1089
  } | undefined;
1090
1090
  roles?: {
1091
- members: (string[] | "*") & (string[] | "*" | undefined);
1092
1091
  name: string;
1092
+ members: (string[] | "*") & (string[] | "*" | undefined);
1093
1093
  permissions: {
1094
1094
  match: ("*" | {
1095
1095
  name?: string | undefined;
@@ -1279,8 +1279,8 @@ declare const DefaultingPolicyConfigParser: z.ZodDefault<z.ZodObject<{
1279
1279
  }[]>;
1280
1280
  }, "strip", z.ZodTypeAny, {
1281
1281
  id: string;
1282
- members: (string[] | "*") & (string[] | "*" | undefined);
1283
1282
  name: string;
1283
+ members: (string[] | "*") & (string[] | "*" | undefined);
1284
1284
  permissions: {
1285
1285
  id: string;
1286
1286
  match: ("*" | {
@@ -1303,8 +1303,8 @@ declare const DefaultingPolicyConfigParser: z.ZodDefault<z.ZodObject<{
1303
1303
  } | "deny" | undefined);
1304
1304
  }[];
1305
1305
  }, {
1306
- members: (string[] | "*") & (string[] | "*" | undefined);
1307
1306
  name: string;
1307
+ members: (string[] | "*") & (string[] | "*" | undefined);
1308
1308
  permissions: {
1309
1309
  match: ("*" | {
1310
1310
  name?: string | undefined;
@@ -1329,8 +1329,8 @@ declare const DefaultingPolicyConfigParser: z.ZodDefault<z.ZodObject<{
1329
1329
  id?: string | undefined;
1330
1330
  }>, "many">>, {
1331
1331
  id: string;
1332
- members: (string[] | "*") & (string[] | "*" | undefined);
1333
1332
  name: string;
1333
+ members: (string[] | "*") & (string[] | "*" | undefined);
1334
1334
  permissions: {
1335
1335
  id: string;
1336
1336
  match: ("*" | {
@@ -1353,8 +1353,8 @@ declare const DefaultingPolicyConfigParser: z.ZodDefault<z.ZodObject<{
1353
1353
  } | "deny" | undefined);
1354
1354
  }[];
1355
1355
  }[], {
1356
- members: (string[] | "*") & (string[] | "*" | undefined);
1357
1356
  name: string;
1357
+ members: (string[] | "*") & (string[] | "*" | undefined);
1358
1358
  permissions: {
1359
1359
  match: ("*" | {
1360
1360
  name?: string | undefined;
@@ -1385,8 +1385,8 @@ declare const DefaultingPolicyConfigParser: z.ZodDefault<z.ZodObject<{
1385
1385
  };
1386
1386
  roles: {
1387
1387
  id: string;
1388
- members: (string[] | "*") & (string[] | "*" | undefined);
1389
1388
  name: string;
1389
+ members: (string[] | "*") & (string[] | "*" | undefined);
1390
1390
  permissions: {
1391
1391
  id: string;
1392
1392
  match: ("*" | {
@@ -1415,8 +1415,8 @@ declare const DefaultingPolicyConfigParser: z.ZodDefault<z.ZodObject<{
1415
1415
  resolutionStrategy: "first-match" | "any-allow";
1416
1416
  } | undefined;
1417
1417
  roles?: {
1418
- members: (string[] | "*") & (string[] | "*" | undefined);
1419
1418
  name: string;
1419
+ members: (string[] | "*") & (string[] | "*" | undefined);
1420
1420
  permissions: {
1421
1421
  match: ("*" | {
1422
1422
  name?: string | undefined;
@@ -1450,32 +1450,32 @@ declare function isAnyOfPermissionCriteria(conditions: PermissionCriteria<RBACPe
1450
1450
  /** @public */
1451
1451
  declare function isNotPermissionCriteria(conditions: PermissionCriteria<RBACPermissionCondition>): conditions is NotCriteria<RBACPermissionCondition>;
1452
1452
  /** @public */
1453
- declare type ConditionalDecision = z.infer<typeof ConditionalDecisionParser>;
1453
+ type ConditionalDecision = z.infer<typeof ConditionalDecisionParser>;
1454
1454
  /** @public */
1455
- declare type LiteralDecision = z.infer<typeof LiteralDecisionParser>;
1455
+ type LiteralDecision = z.infer<typeof LiteralDecisionParser>;
1456
1456
  /** @public */
1457
- declare type PermissionDecision = z.infer<typeof PermissionDecisionParser>;
1457
+ type PermissionDecision = z.infer<typeof PermissionDecisionParser>;
1458
1458
  /** @public */
1459
- declare type PermissionMatch = z.infer<typeof PermissionMatchParser>;
1459
+ type PermissionMatch = z.infer<typeof PermissionMatchParser>;
1460
1460
  /** @public */
1461
- declare type RolePermission = z.infer<typeof RolePermissionParser>;
1461
+ type RolePermission = z.infer<typeof RolePermissionParser>;
1462
1462
  /** @public */
1463
- declare type RolePermissions = z.infer<typeof RolePermissionsParser>;
1463
+ type RolePermissions = z.infer<typeof RolePermissionsParser>;
1464
1464
  /** @public */
1465
- declare type RawRole = z.input<typeof RoleParser>;
1465
+ type RawRole = z.input<typeof RoleParser>;
1466
1466
  /** @public */
1467
- declare type Role = z.infer<typeof RoleParser>;
1467
+ type Role = z.infer<typeof RoleParser>;
1468
1468
  /** @public */
1469
- declare type RawPolicyConfig = z.input<typeof PolicyConfigParser>;
1469
+ type RawPolicyConfig = z.input<typeof PolicyConfigParser>;
1470
1470
  /** @public */
1471
- declare type PolicyConfig = z.infer<typeof PolicyConfigParser>;
1471
+ type PolicyConfig = z.infer<typeof PolicyConfigParser>;
1472
1472
  /** @public */
1473
- declare type PolicyRoleResolutionStrategy = z.infer<typeof PolicyRoleResolutionStrategyParser>;
1473
+ type PolicyRoleResolutionStrategy = z.infer<typeof PolicyRoleResolutionStrategyParser>;
1474
1474
  /** @public */
1475
- declare type PolicyConfigOptions = z.infer<typeof PolicyConfigOptionsParser>;
1475
+ type PolicyConfigOptions = z.infer<typeof PolicyConfigOptionsParser>;
1476
1476
 
1477
1477
  /** @public */
1478
- declare type Policy = PolicyConfig & {
1478
+ type Policy = PolicyConfig & {
1479
1479
  /**
1480
1480
  * Internal ID for lookups/references.
1481
1481
  */
@@ -1679,8 +1679,8 @@ declare const CreateDraftRequestParser: z.ZodObject<{
1679
1679
  }[]>;
1680
1680
  }, "strip", z.ZodTypeAny, {
1681
1681
  id: string;
1682
- members: (string[] | "*") & (string[] | "*" | undefined);
1683
1682
  name: string;
1683
+ members: (string[] | "*") & (string[] | "*" | undefined);
1684
1684
  permissions: {
1685
1685
  id: string;
1686
1686
  match: ("*" | {
@@ -1703,8 +1703,8 @@ declare const CreateDraftRequestParser: z.ZodObject<{
1703
1703
  } | "deny" | undefined);
1704
1704
  }[];
1705
1705
  }, {
1706
- members: (string[] | "*") & (string[] | "*" | undefined);
1707
1706
  name: string;
1707
+ members: (string[] | "*") & (string[] | "*" | undefined);
1708
1708
  permissions: {
1709
1709
  match: ("*" | {
1710
1710
  name?: string | undefined;
@@ -1729,8 +1729,8 @@ declare const CreateDraftRequestParser: z.ZodObject<{
1729
1729
  id?: string | undefined;
1730
1730
  }>, "many">>, {
1731
1731
  id: string;
1732
- members: (string[] | "*") & (string[] | "*" | undefined);
1733
1732
  name: string;
1733
+ members: (string[] | "*") & (string[] | "*" | undefined);
1734
1734
  permissions: {
1735
1735
  id: string;
1736
1736
  match: ("*" | {
@@ -1753,8 +1753,8 @@ declare const CreateDraftRequestParser: z.ZodObject<{
1753
1753
  } | "deny" | undefined);
1754
1754
  }[];
1755
1755
  }[], {
1756
- members: (string[] | "*") & (string[] | "*" | undefined);
1757
1756
  name: string;
1757
+ members: (string[] | "*") & (string[] | "*" | undefined);
1758
1758
  permissions: {
1759
1759
  match: ("*" | {
1760
1760
  name?: string | undefined;
@@ -1785,8 +1785,8 @@ declare const CreateDraftRequestParser: z.ZodObject<{
1785
1785
  };
1786
1786
  roles: {
1787
1787
  id: string;
1788
- members: (string[] | "*") & (string[] | "*" | undefined);
1789
1788
  name: string;
1789
+ members: (string[] | "*") & (string[] | "*" | undefined);
1790
1790
  permissions: {
1791
1791
  id: string;
1792
1792
  match: ("*" | {
@@ -1815,8 +1815,8 @@ declare const CreateDraftRequestParser: z.ZodObject<{
1815
1815
  resolutionStrategy: "first-match" | "any-allow";
1816
1816
  } | undefined;
1817
1817
  roles?: {
1818
- members: (string[] | "*") & (string[] | "*" | undefined);
1819
1818
  name: string;
1819
+ members: (string[] | "*") & (string[] | "*" | undefined);
1820
1820
  permissions: {
1821
1821
  match: ("*" | {
1822
1822
  name?: string | undefined;
@@ -2006,8 +2006,8 @@ declare const UpdateDraftRequestParser: z.ZodObject<{
2006
2006
  }[]>;
2007
2007
  }, "strip", z.ZodTypeAny, {
2008
2008
  id: string;
2009
- members: (string[] | "*") & (string[] | "*" | undefined);
2010
2009
  name: string;
2010
+ members: (string[] | "*") & (string[] | "*" | undefined);
2011
2011
  permissions: {
2012
2012
  id: string;
2013
2013
  match: ("*" | {
@@ -2030,8 +2030,8 @@ declare const UpdateDraftRequestParser: z.ZodObject<{
2030
2030
  } | "deny" | undefined);
2031
2031
  }[];
2032
2032
  }, {
2033
- members: (string[] | "*") & (string[] | "*" | undefined);
2034
2033
  name: string;
2034
+ members: (string[] | "*") & (string[] | "*" | undefined);
2035
2035
  permissions: {
2036
2036
  match: ("*" | {
2037
2037
  name?: string | undefined;
@@ -2056,8 +2056,8 @@ declare const UpdateDraftRequestParser: z.ZodObject<{
2056
2056
  id?: string | undefined;
2057
2057
  }>, "many">>, {
2058
2058
  id: string;
2059
- members: (string[] | "*") & (string[] | "*" | undefined);
2060
2059
  name: string;
2060
+ members: (string[] | "*") & (string[] | "*" | undefined);
2061
2061
  permissions: {
2062
2062
  id: string;
2063
2063
  match: ("*" | {
@@ -2080,8 +2080,8 @@ declare const UpdateDraftRequestParser: z.ZodObject<{
2080
2080
  } | "deny" | undefined);
2081
2081
  }[];
2082
2082
  }[], {
2083
- members: (string[] | "*") & (string[] | "*" | undefined);
2084
2083
  name: string;
2084
+ members: (string[] | "*") & (string[] | "*" | undefined);
2085
2085
  permissions: {
2086
2086
  match: ("*" | {
2087
2087
  name?: string | undefined;
@@ -2112,8 +2112,8 @@ declare const UpdateDraftRequestParser: z.ZodObject<{
2112
2112
  } | undefined;
2113
2113
  roles?: {
2114
2114
  id: string;
2115
- members: (string[] | "*") & (string[] | "*" | undefined);
2116
2115
  name: string;
2116
+ members: (string[] | "*") & (string[] | "*" | undefined);
2117
2117
  permissions: {
2118
2118
  id: string;
2119
2119
  match: ("*" | {
@@ -2142,8 +2142,8 @@ declare const UpdateDraftRequestParser: z.ZodObject<{
2142
2142
  resolutionStrategy: "first-match" | "any-allow";
2143
2143
  } | undefined;
2144
2144
  roles?: {
2145
- members: (string[] | "*") & (string[] | "*" | undefined);
2146
2145
  name: string;
2146
+ members: (string[] | "*") & (string[] | "*" | undefined);
2147
2147
  permissions: {
2148
2148
  match: ("*" | {
2149
2149
  name?: string | undefined;
@@ -2177,43 +2177,43 @@ declare const PublishVersionRequestParser: z.ZodObject<{
2177
2177
  description?: string | undefined;
2178
2178
  }>;
2179
2179
  /** @public */
2180
- declare type CreateDraftRequest = z.input<typeof CreateDraftRequestParser>;
2180
+ type CreateDraftRequest = z.input<typeof CreateDraftRequestParser>;
2181
2181
  /** @public */
2182
- declare type UpdateDraftRequest = z.input<typeof UpdateDraftRequestParser>;
2182
+ type UpdateDraftRequest = z.input<typeof UpdateDraftRequestParser>;
2183
2183
  /** @public */
2184
- declare type PublishVersionRequest = z.infer<typeof PublishVersionRequestParser>;
2184
+ type PublishVersionRequest = z.infer<typeof PublishVersionRequestParser>;
2185
2185
  /** @public */
2186
- declare type SearchMembersRequest = {
2186
+ type SearchMembersRequest = {
2187
2187
  query: string;
2188
2188
  };
2189
2189
  /** @public */
2190
- declare type AuthorizeResponse = {
2190
+ type AuthorizeResponse = {
2191
2191
  authorized: boolean;
2192
2192
  };
2193
2193
  /** @public */
2194
- declare type MemberResponse = {
2194
+ type MemberResponse = {
2195
2195
  name?: string;
2196
2196
  type: 'user' | 'group' | 'all' | 'unknown';
2197
2197
  entityRef: string;
2198
2198
  };
2199
2199
  /** @public */
2200
- declare type PolicyMember = {
2200
+ type PolicyMember = {
2201
2201
  policyId: string;
2202
2202
  members: MemberResponse[];
2203
2203
  };
2204
2204
  /** @public */
2205
- declare type SearchMembersResponse = {
2205
+ type SearchMembersResponse = {
2206
2206
  members: MemberResponse[];
2207
2207
  };
2208
2208
  /** @public */
2209
- declare type PaginatedResponse<T> = {
2209
+ type PaginatedResponse<T> = {
2210
2210
  items: T[];
2211
2211
  nextCursor?: string;
2212
2212
  prevCursor?: string;
2213
2213
  totalItems: number;
2214
2214
  };
2215
2215
  /** @public */
2216
- declare type PoliciesResponse = PaginatedResponse<Policy>;
2216
+ type PoliciesResponse = PaginatedResponse<Policy>;
2217
2217
 
2218
2218
  /** @public */
2219
2219
  declare const isMatchingPermission: (permission: Permission, match: PermissionMatch) => boolean;
@@ -2228,7 +2228,7 @@ declare const isMatchingPermission: (permission: Permission, match: PermissionMa
2228
2228
  declare const matchesEntityRef: (userClaim: CompoundEntityRef, policyMember: CompoundEntityRef) => boolean;
2229
2229
 
2230
2230
  /** @public */
2231
- declare type MapParamsCallback = (param: PermissionRuleParam) => PermissionRuleParam;
2231
+ type MapParamsCallback = (param: PermissionRuleParam) => PermissionRuleParam;
2232
2232
  /** @public */
2233
2233
  declare function mapParams(params: PermissionRuleParams, cb: MapParamsCallback): PermissionRuleParams;
2234
2234
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotify/backstage-plugin-rbac-common",
3
3
  "description": "Control access to actions and data in Backstage with ease.",
4
- "version": "0.5.0",
4
+ "version": "0.5.2",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "homepage": "https://backstage.spotify.com/",
7
7
  "main": "dist/index.cjs.js",
@@ -23,14 +23,14 @@
23
23
  "postpack": "backstage-cli package postpack"
24
24
  },
25
25
  "dependencies": {
26
- "@backstage/catalog-model": "^1.2.1",
27
- "@backstage/plugin-permission-common": "^0.7.4",
26
+ "@backstage/catalog-model": "^1.3.0",
27
+ "@backstage/plugin-permission-common": "^0.7.5",
28
28
  "@backstage/types": "^1.0.2",
29
29
  "uuid": "^9.0.0",
30
30
  "zod": "^3.20.0"
31
31
  },
32
32
  "devDependencies": {
33
- "@backstage/cli": "^0.22.4"
33
+ "@backstage/cli": "^0.22.7"
34
34
  },
35
35
  "files": [
36
36
  "dist",