@backstage-community/plugin-rbac-common 1.16.1 → 1.18.0
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 +16 -0
- package/dist/index.d.ts +8 -1
- package/dist/types.cjs.js.map +1 -1
- package/dist/types.esm.js.map +1 -1
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
## @backstage-community/plugin-rbac-common [1.8.2](https://github.com/janus-idp/backstage-plugins/compare/@backstage-community/plugin-rbac-common@1.8.1...@backstage-community/plugin-rbac-common@1.8.2) (2024-08-06)
|
|
2
2
|
|
|
3
|
+
## 1.18.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4b58a1d: Backstage version bump to v1.39.0
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 6a59fcf: remove support and lifecycle keywords in package.json
|
|
12
|
+
|
|
13
|
+
## 1.17.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- a42945e: Introduce a type that defines an additional list of plugin IDs.
|
|
18
|
+
|
|
3
19
|
## 1.16.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -143,6 +143,13 @@ declare const CONDITION_ALIAS_SIGN = "$";
|
|
|
143
143
|
declare class UnauthorizedError extends NotAllowedError {
|
|
144
144
|
constructor();
|
|
145
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* @public
|
|
148
|
+
* List of plugins that are supports Backstage permission framework.
|
|
149
|
+
*/
|
|
150
|
+
type PermissionDependentPluginList = {
|
|
151
|
+
ids: string[];
|
|
152
|
+
};
|
|
146
153
|
|
|
147
154
|
/**
|
|
148
155
|
* @public
|
|
@@ -181,4 +188,4 @@ declare const policyEntityUpdatePermission: ResourcePermission<"policy-entity">;
|
|
|
181
188
|
*/
|
|
182
189
|
declare const policyEntityPermissions: (ResourcePermission<"policy-entity"> | _backstage_plugin_permission_common.BasicPermission)[];
|
|
183
190
|
|
|
184
|
-
export { CONDITION_ALIAS_SIGN, ConditionalAliases, type NamedPolicy, type NonEmptyArray, type PermissionAction, PermissionActionValues, type PermissionInfo, type PermissionPolicyMetadata, type PluginPermissionMetaData, type Policy, type PolicyDetails, type PolicyEntityPermission, RESOURCE_TYPE_POLICY_ENTITY, type ResourcedPolicy, type Role, type RoleBasedPolicy, type RoleConditionalPolicyDecision, type RoleMetadata, type Source, UnauthorizedError, type UpdatePolicy, isResourcedPolicy, isValidPermissionAction, policyEntityCreatePermission, policyEntityDeletePermission, policyEntityPermissions, policyEntityReadPermission, policyEntityUpdatePermission, toPermissionAction };
|
|
191
|
+
export { CONDITION_ALIAS_SIGN, ConditionalAliases, type NamedPolicy, type NonEmptyArray, type PermissionAction, PermissionActionValues, type PermissionDependentPluginList, type PermissionInfo, type PermissionPolicyMetadata, type PluginPermissionMetaData, type Policy, type PolicyDetails, type PolicyEntityPermission, RESOURCE_TYPE_POLICY_ENTITY, type ResourcedPolicy, type Role, type RoleBasedPolicy, type RoleConditionalPolicyDecision, type RoleMetadata, type Source, UnauthorizedError, type UpdatePolicy, isResourcedPolicy, isValidPermissionAction, policyEntityCreatePermission, policyEntityDeletePermission, policyEntityPermissions, policyEntityReadPermission, policyEntityUpdatePermission, toPermissionAction };
|
package/dist/types.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.cjs.js","sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { NotAllowedError } from '@backstage/errors';\nimport {\n ConditionalPolicyDecision,\n PermissionAttributes,\n} from '@backstage/plugin-permission-common';\n\n/**\n * @public\n * 'rest' created via REST API\n * 'csv-file' created via policies-csv-file with defined path in the application configuration\n * 'configuration' created from application configuration\n * 'legacy'; preexisting policies\n */\nexport type Source = string;\n\n/**\n * @public\n */\nexport type PermissionPolicyMetadata = {\n source: Source;\n};\n\n/**\n * @public\n */\nexport type RoleMetadata = {\n description?: string;\n source?: Source;\n modifiedBy?: string;\n author?: string;\n lastModified?: string;\n createdAt?: string;\n owner?: string;\n};\n\n/**\n * @public\n */\nexport type Policy = {\n permission?: string;\n policy?: string;\n};\n\n/**\n * @public\n */\nexport type RoleBasedPolicy = Policy & {\n entityReference?: string;\n effect?: string;\n metadata?: PermissionPolicyMetadata;\n};\n\n/**\n * @public\n */\nexport type Role = {\n memberReferences: string[];\n name: string;\n metadata?: RoleMetadata;\n};\n\n/**\n * @public\n */\nexport type UpdatePolicy = {\n oldPolicy: Policy;\n newPolicy: Policy;\n};\n\n/**\n * @public\n */\nexport type NamedPolicy = {\n name: string;\n\n policy: string;\n};\n\n/**\n * @public\n */\nexport type ResourcedPolicy = NamedPolicy & {\n resourceType: string;\n};\n\n/**\n * @public\n */\nexport type PolicyDetails = NamedPolicy | ResourcedPolicy;\n\n/**\n * @public\n */\nexport function isResourcedPolicy(\n policy: PolicyDetails,\n): policy is ResourcedPolicy {\n return 'resourceType' in policy;\n}\n\n/**\n * @public\n */\nexport type PluginPermissionMetaData = {\n pluginId: string;\n policies: PolicyDetails[];\n};\n\n/**\n * @public\n */\nexport type NonEmptyArray<T> = [T, ...T[]];\n\n/**\n * @public\n * Permission framework attributes action has values: 'create' | 'read' | 'update' | 'delete' | undefined.\n * But we are introducing an action named \"use\" when action does not exist('undefined') to avoid\n * a more complicated model with multiple policy and request shapes.\n */\nexport const PermissionActionValues = [\n 'create',\n 'read',\n 'update',\n 'delete',\n 'use',\n] as const;\n\n/**\n * @public\n */\nexport type PermissionAction = (typeof PermissionActionValues)[number];\n\n/**\n * @public\n */\nexport const toPermissionAction = (\n attr: PermissionAttributes,\n): PermissionAction => attr.action ?? 'use';\n\n/**\n * @public\n */\nexport function isValidPermissionAction(\n action: string,\n): action is PermissionAction {\n return (PermissionActionValues as readonly string[]).includes(action);\n}\n\n/**\n * @public\n */\nexport type PermissionInfo = {\n name: string;\n action: PermissionAction;\n};\n\n/**\n * @public\n * Frontend should use RoleConditionalPolicyDecision<PermissionAction>\n */\nexport type RoleConditionalPolicyDecision<\n T extends PermissionAction | PermissionInfo,\n> = ConditionalPolicyDecision & {\n id: number;\n roleEntityRef: string;\n\n permissionMapping: T[];\n};\n\n/**\n * @public\n */\nexport const ConditionalAliases = {\n CURRENT_USER: 'currentUser',\n OWNER_REFS: 'ownerRefs',\n} as const;\n\n/**\n * @public\n */\nexport const CONDITION_ALIAS_SIGN = '$';\n\n/**\n * @public\n * UnauthorizedError should be uniformely used for authorization errors.\n */\nexport class UnauthorizedError extends NotAllowedError {\n constructor() {\n super('Unauthorized');\n }\n}\n"],"names":["NotAllowedError"],"mappings":";;;;AA4GO,SAAS,kBACd,MAC2B,EAAA;AAC3B,EAAA,OAAO,cAAkB,IAAA,MAAA;AAC3B;AAqBO,MAAM,sBAAyB,GAAA;AAAA,EACpC,QAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAUO,MAAM,kBAAqB,GAAA,CAChC,IACqB,KAAA,IAAA,CAAK,MAAU,IAAA;AAK/B,SAAS,wBACd,MAC4B,EAAA;AAC5B,EAAQ,OAAA,sBAAA,CAA6C,SAAS,MAAM,CAAA;AACtE;AA0BO,MAAM,kBAAqB,GAAA;AAAA,EAChC,YAAc,EAAA,aAAA;AAAA,EACd,UAAY,EAAA;AACd;AAKO,MAAM,oBAAuB,GAAA;AAM7B,MAAM,0BAA0BA,sBAAgB,CAAA;AAAA,EACrD,WAAc,GAAA;AACZ,IAAA,KAAA,CAAM,cAAc,CAAA;AAAA;AAExB;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"types.cjs.js","sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { NotAllowedError } from '@backstage/errors';\nimport {\n ConditionalPolicyDecision,\n PermissionAttributes,\n} from '@backstage/plugin-permission-common';\n\n/**\n * @public\n * 'rest' created via REST API\n * 'csv-file' created via policies-csv-file with defined path in the application configuration\n * 'configuration' created from application configuration\n * 'legacy'; preexisting policies\n */\nexport type Source = string;\n\n/**\n * @public\n */\nexport type PermissionPolicyMetadata = {\n source: Source;\n};\n\n/**\n * @public\n */\nexport type RoleMetadata = {\n description?: string;\n source?: Source;\n modifiedBy?: string;\n author?: string;\n lastModified?: string;\n createdAt?: string;\n owner?: string;\n};\n\n/**\n * @public\n */\nexport type Policy = {\n permission?: string;\n policy?: string;\n};\n\n/**\n * @public\n */\nexport type RoleBasedPolicy = Policy & {\n entityReference?: string;\n effect?: string;\n metadata?: PermissionPolicyMetadata;\n};\n\n/**\n * @public\n */\nexport type Role = {\n memberReferences: string[];\n name: string;\n metadata?: RoleMetadata;\n};\n\n/**\n * @public\n */\nexport type UpdatePolicy = {\n oldPolicy: Policy;\n newPolicy: Policy;\n};\n\n/**\n * @public\n */\nexport type NamedPolicy = {\n name: string;\n\n policy: string;\n};\n\n/**\n * @public\n */\nexport type ResourcedPolicy = NamedPolicy & {\n resourceType: string;\n};\n\n/**\n * @public\n */\nexport type PolicyDetails = NamedPolicy | ResourcedPolicy;\n\n/**\n * @public\n */\nexport function isResourcedPolicy(\n policy: PolicyDetails,\n): policy is ResourcedPolicy {\n return 'resourceType' in policy;\n}\n\n/**\n * @public\n */\nexport type PluginPermissionMetaData = {\n pluginId: string;\n policies: PolicyDetails[];\n};\n\n/**\n * @public\n */\nexport type NonEmptyArray<T> = [T, ...T[]];\n\n/**\n * @public\n * Permission framework attributes action has values: 'create' | 'read' | 'update' | 'delete' | undefined.\n * But we are introducing an action named \"use\" when action does not exist('undefined') to avoid\n * a more complicated model with multiple policy and request shapes.\n */\nexport const PermissionActionValues = [\n 'create',\n 'read',\n 'update',\n 'delete',\n 'use',\n] as const;\n\n/**\n * @public\n */\nexport type PermissionAction = (typeof PermissionActionValues)[number];\n\n/**\n * @public\n */\nexport const toPermissionAction = (\n attr: PermissionAttributes,\n): PermissionAction => attr.action ?? 'use';\n\n/**\n * @public\n */\nexport function isValidPermissionAction(\n action: string,\n): action is PermissionAction {\n return (PermissionActionValues as readonly string[]).includes(action);\n}\n\n/**\n * @public\n */\nexport type PermissionInfo = {\n name: string;\n action: PermissionAction;\n};\n\n/**\n * @public\n * Frontend should use RoleConditionalPolicyDecision<PermissionAction>\n */\nexport type RoleConditionalPolicyDecision<\n T extends PermissionAction | PermissionInfo,\n> = ConditionalPolicyDecision & {\n id: number;\n roleEntityRef: string;\n\n permissionMapping: T[];\n};\n\n/**\n * @public\n */\nexport const ConditionalAliases = {\n CURRENT_USER: 'currentUser',\n OWNER_REFS: 'ownerRefs',\n} as const;\n\n/**\n * @public\n */\nexport const CONDITION_ALIAS_SIGN = '$';\n\n/**\n * @public\n * UnauthorizedError should be uniformely used for authorization errors.\n */\nexport class UnauthorizedError extends NotAllowedError {\n constructor() {\n super('Unauthorized');\n }\n}\n\n/**\n * @public\n * List of plugins that are supports Backstage permission framework.\n */\nexport type PermissionDependentPluginList = {\n ids: string[];\n};\n"],"names":["NotAllowedError"],"mappings":";;;;AA4GO,SAAS,kBACd,MAC2B,EAAA;AAC3B,EAAA,OAAO,cAAkB,IAAA,MAAA;AAC3B;AAqBO,MAAM,sBAAyB,GAAA;AAAA,EACpC,QAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAUO,MAAM,kBAAqB,GAAA,CAChC,IACqB,KAAA,IAAA,CAAK,MAAU,IAAA;AAK/B,SAAS,wBACd,MAC4B,EAAA;AAC5B,EAAQ,OAAA,sBAAA,CAA6C,SAAS,MAAM,CAAA;AACtE;AA0BO,MAAM,kBAAqB,GAAA;AAAA,EAChC,YAAc,EAAA,aAAA;AAAA,EACd,UAAY,EAAA;AACd;AAKO,MAAM,oBAAuB,GAAA;AAM7B,MAAM,0BAA0BA,sBAAgB,CAAA;AAAA,EACrD,WAAc,GAAA;AACZ,IAAA,KAAA,CAAM,cAAc,CAAA;AAAA;AAExB;;;;;;;;;;"}
|
package/dist/types.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.esm.js","sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { NotAllowedError } from '@backstage/errors';\nimport {\n ConditionalPolicyDecision,\n PermissionAttributes,\n} from '@backstage/plugin-permission-common';\n\n/**\n * @public\n * 'rest' created via REST API\n * 'csv-file' created via policies-csv-file with defined path in the application configuration\n * 'configuration' created from application configuration\n * 'legacy'; preexisting policies\n */\nexport type Source = string;\n\n/**\n * @public\n */\nexport type PermissionPolicyMetadata = {\n source: Source;\n};\n\n/**\n * @public\n */\nexport type RoleMetadata = {\n description?: string;\n source?: Source;\n modifiedBy?: string;\n author?: string;\n lastModified?: string;\n createdAt?: string;\n owner?: string;\n};\n\n/**\n * @public\n */\nexport type Policy = {\n permission?: string;\n policy?: string;\n};\n\n/**\n * @public\n */\nexport type RoleBasedPolicy = Policy & {\n entityReference?: string;\n effect?: string;\n metadata?: PermissionPolicyMetadata;\n};\n\n/**\n * @public\n */\nexport type Role = {\n memberReferences: string[];\n name: string;\n metadata?: RoleMetadata;\n};\n\n/**\n * @public\n */\nexport type UpdatePolicy = {\n oldPolicy: Policy;\n newPolicy: Policy;\n};\n\n/**\n * @public\n */\nexport type NamedPolicy = {\n name: string;\n\n policy: string;\n};\n\n/**\n * @public\n */\nexport type ResourcedPolicy = NamedPolicy & {\n resourceType: string;\n};\n\n/**\n * @public\n */\nexport type PolicyDetails = NamedPolicy | ResourcedPolicy;\n\n/**\n * @public\n */\nexport function isResourcedPolicy(\n policy: PolicyDetails,\n): policy is ResourcedPolicy {\n return 'resourceType' in policy;\n}\n\n/**\n * @public\n */\nexport type PluginPermissionMetaData = {\n pluginId: string;\n policies: PolicyDetails[];\n};\n\n/**\n * @public\n */\nexport type NonEmptyArray<T> = [T, ...T[]];\n\n/**\n * @public\n * Permission framework attributes action has values: 'create' | 'read' | 'update' | 'delete' | undefined.\n * But we are introducing an action named \"use\" when action does not exist('undefined') to avoid\n * a more complicated model with multiple policy and request shapes.\n */\nexport const PermissionActionValues = [\n 'create',\n 'read',\n 'update',\n 'delete',\n 'use',\n] as const;\n\n/**\n * @public\n */\nexport type PermissionAction = (typeof PermissionActionValues)[number];\n\n/**\n * @public\n */\nexport const toPermissionAction = (\n attr: PermissionAttributes,\n): PermissionAction => attr.action ?? 'use';\n\n/**\n * @public\n */\nexport function isValidPermissionAction(\n action: string,\n): action is PermissionAction {\n return (PermissionActionValues as readonly string[]).includes(action);\n}\n\n/**\n * @public\n */\nexport type PermissionInfo = {\n name: string;\n action: PermissionAction;\n};\n\n/**\n * @public\n * Frontend should use RoleConditionalPolicyDecision<PermissionAction>\n */\nexport type RoleConditionalPolicyDecision<\n T extends PermissionAction | PermissionInfo,\n> = ConditionalPolicyDecision & {\n id: number;\n roleEntityRef: string;\n\n permissionMapping: T[];\n};\n\n/**\n * @public\n */\nexport const ConditionalAliases = {\n CURRENT_USER: 'currentUser',\n OWNER_REFS: 'ownerRefs',\n} as const;\n\n/**\n * @public\n */\nexport const CONDITION_ALIAS_SIGN = '$';\n\n/**\n * @public\n * UnauthorizedError should be uniformely used for authorization errors.\n */\nexport class UnauthorizedError extends NotAllowedError {\n constructor() {\n super('Unauthorized');\n }\n}\n"],"names":[],"mappings":";;AA4GO,SAAS,kBACd,MAC2B,EAAA;AAC3B,EAAA,OAAO,cAAkB,IAAA,MAAA;AAC3B;AAqBO,MAAM,sBAAyB,GAAA;AAAA,EACpC,QAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAUO,MAAM,kBAAqB,GAAA,CAChC,IACqB,KAAA,IAAA,CAAK,MAAU,IAAA;AAK/B,SAAS,wBACd,MAC4B,EAAA;AAC5B,EAAQ,OAAA,sBAAA,CAA6C,SAAS,MAAM,CAAA;AACtE;AA0BO,MAAM,kBAAqB,GAAA;AAAA,EAChC,YAAc,EAAA,aAAA;AAAA,EACd,UAAY,EAAA;AACd;AAKO,MAAM,oBAAuB,GAAA;AAM7B,MAAM,0BAA0B,eAAgB,CAAA;AAAA,EACrD,WAAc,GAAA;AACZ,IAAA,KAAA,CAAM,cAAc,CAAA;AAAA;AAExB;;;;"}
|
|
1
|
+
{"version":3,"file":"types.esm.js","sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright 2024 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 */\nimport { NotAllowedError } from '@backstage/errors';\nimport {\n ConditionalPolicyDecision,\n PermissionAttributes,\n} from '@backstage/plugin-permission-common';\n\n/**\n * @public\n * 'rest' created via REST API\n * 'csv-file' created via policies-csv-file with defined path in the application configuration\n * 'configuration' created from application configuration\n * 'legacy'; preexisting policies\n */\nexport type Source = string;\n\n/**\n * @public\n */\nexport type PermissionPolicyMetadata = {\n source: Source;\n};\n\n/**\n * @public\n */\nexport type RoleMetadata = {\n description?: string;\n source?: Source;\n modifiedBy?: string;\n author?: string;\n lastModified?: string;\n createdAt?: string;\n owner?: string;\n};\n\n/**\n * @public\n */\nexport type Policy = {\n permission?: string;\n policy?: string;\n};\n\n/**\n * @public\n */\nexport type RoleBasedPolicy = Policy & {\n entityReference?: string;\n effect?: string;\n metadata?: PermissionPolicyMetadata;\n};\n\n/**\n * @public\n */\nexport type Role = {\n memberReferences: string[];\n name: string;\n metadata?: RoleMetadata;\n};\n\n/**\n * @public\n */\nexport type UpdatePolicy = {\n oldPolicy: Policy;\n newPolicy: Policy;\n};\n\n/**\n * @public\n */\nexport type NamedPolicy = {\n name: string;\n\n policy: string;\n};\n\n/**\n * @public\n */\nexport type ResourcedPolicy = NamedPolicy & {\n resourceType: string;\n};\n\n/**\n * @public\n */\nexport type PolicyDetails = NamedPolicy | ResourcedPolicy;\n\n/**\n * @public\n */\nexport function isResourcedPolicy(\n policy: PolicyDetails,\n): policy is ResourcedPolicy {\n return 'resourceType' in policy;\n}\n\n/**\n * @public\n */\nexport type PluginPermissionMetaData = {\n pluginId: string;\n policies: PolicyDetails[];\n};\n\n/**\n * @public\n */\nexport type NonEmptyArray<T> = [T, ...T[]];\n\n/**\n * @public\n * Permission framework attributes action has values: 'create' | 'read' | 'update' | 'delete' | undefined.\n * But we are introducing an action named \"use\" when action does not exist('undefined') to avoid\n * a more complicated model with multiple policy and request shapes.\n */\nexport const PermissionActionValues = [\n 'create',\n 'read',\n 'update',\n 'delete',\n 'use',\n] as const;\n\n/**\n * @public\n */\nexport type PermissionAction = (typeof PermissionActionValues)[number];\n\n/**\n * @public\n */\nexport const toPermissionAction = (\n attr: PermissionAttributes,\n): PermissionAction => attr.action ?? 'use';\n\n/**\n * @public\n */\nexport function isValidPermissionAction(\n action: string,\n): action is PermissionAction {\n return (PermissionActionValues as readonly string[]).includes(action);\n}\n\n/**\n * @public\n */\nexport type PermissionInfo = {\n name: string;\n action: PermissionAction;\n};\n\n/**\n * @public\n * Frontend should use RoleConditionalPolicyDecision<PermissionAction>\n */\nexport type RoleConditionalPolicyDecision<\n T extends PermissionAction | PermissionInfo,\n> = ConditionalPolicyDecision & {\n id: number;\n roleEntityRef: string;\n\n permissionMapping: T[];\n};\n\n/**\n * @public\n */\nexport const ConditionalAliases = {\n CURRENT_USER: 'currentUser',\n OWNER_REFS: 'ownerRefs',\n} as const;\n\n/**\n * @public\n */\nexport const CONDITION_ALIAS_SIGN = '$';\n\n/**\n * @public\n * UnauthorizedError should be uniformely used for authorization errors.\n */\nexport class UnauthorizedError extends NotAllowedError {\n constructor() {\n super('Unauthorized');\n }\n}\n\n/**\n * @public\n * List of plugins that are supports Backstage permission framework.\n */\nexport type PermissionDependentPluginList = {\n ids: string[];\n};\n"],"names":[],"mappings":";;AA4GO,SAAS,kBACd,MAC2B,EAAA;AAC3B,EAAA,OAAO,cAAkB,IAAA,MAAA;AAC3B;AAqBO,MAAM,sBAAyB,GAAA;AAAA,EACpC,QAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA;AAAA,EACA;AACF;AAUO,MAAM,kBAAqB,GAAA,CAChC,IACqB,KAAA,IAAA,CAAK,MAAU,IAAA;AAK/B,SAAS,wBACd,MAC4B,EAAA;AAC5B,EAAQ,OAAA,sBAAA,CAA6C,SAAS,MAAM,CAAA;AACtE;AA0BO,MAAM,kBAAqB,GAAA;AAAA,EAChC,YAAc,EAAA,aAAA;AAAA,EACd,UAAY,EAAA;AACd;AAKO,MAAM,oBAAuB,GAAA;AAM7B,MAAM,0BAA0B,eAAgB,CAAA;AAAA,EACrD,WAAc,GAAA;AACZ,IAAA,KAAA,CAAM,cAAc,CAAA;AAAA;AAExB;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage-community/plugin-rbac-common",
|
|
3
3
|
"description": "Common functionalities for the rbac-common plugin",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.18.0",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
},
|
|
14
14
|
"backstage": {
|
|
15
15
|
"role": "common-library",
|
|
16
|
-
"supported-versions": "^1.28.4",
|
|
17
16
|
"pluginId": "rbac",
|
|
18
17
|
"pluginPackages": [
|
|
19
18
|
"@backstage-community/plugin-rbac",
|
|
@@ -37,12 +36,12 @@
|
|
|
37
36
|
},
|
|
38
37
|
"peerDependencies": {
|
|
39
38
|
"@backstage/errors": "^1.2.7",
|
|
40
|
-
"@backstage/plugin-permission-common": "^0.
|
|
39
|
+
"@backstage/plugin-permission-common": "^0.9.0"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
43
|
-
"@backstage/cli": "^0.32.
|
|
42
|
+
"@backstage/cli": "^0.32.1",
|
|
44
43
|
"@backstage/errors": "^1.2.7",
|
|
45
|
-
"@backstage/plugin-permission-common": "^0.
|
|
44
|
+
"@backstage/plugin-permission-common": "^0.9.0",
|
|
46
45
|
"prettier": "^3.3.3"
|
|
47
46
|
},
|
|
48
47
|
"files": [
|
|
@@ -54,8 +53,6 @@
|
|
|
54
53
|
"directory": "workspaces/rbac/plugins/rbac-common"
|
|
55
54
|
},
|
|
56
55
|
"keywords": [
|
|
57
|
-
"support:production",
|
|
58
|
-
"lifecycle:active",
|
|
59
56
|
"backstage",
|
|
60
57
|
"plugin"
|
|
61
58
|
],
|