Add permission integration router which allows us to list permissions available to the plugin

Signed-off-by: Ruben Vallejo <rvallejo@vmware.com>
This commit is contained in:
Ruben Vallejo
2023-02-09 15:22:18 -05:00
parent a711ad54da
commit e2ff409a3b
7 changed files with 55 additions and 15 deletions
+5 -5
View File
@@ -207,9 +207,6 @@ export interface JobsFetchResponse {
type: 'jobs';
}
// @alpha
export const kubernetesClusterPermissions: BasicPermission[];
// @public (undocumented)
export type KubernetesErrorTypes =
| 'BAD_REQUEST'
@@ -222,10 +219,10 @@ export type KubernetesErrorTypes =
export type KubernetesFetchError = StatusError | RawFetchError;
// @alpha
export const kubernetesProxyCreatePermission: BasicPermission;
export const kubernetesPermissions: BasicPermission[];
// @alpha
export const kubernetesProxyReadPermission: BasicPermission;
export const kubernetesProxyPermission: BasicPermission;
// @public (undocumented)
export interface KubernetesRequestAuth {
@@ -291,6 +288,9 @@ export interface ReplicaSetsFetchResponse {
type: 'replicasets';
}
// @alpha
export const RESOURCE_TYPE_KUBERNETES_RESOURCE = 'kubernetes-resource';
// @public (undocumented)
export interface ServiceFetchResponse {
// (undocumented)
+2 -1
View File
@@ -23,6 +23,7 @@
export * from './types';
export * from './catalog-entity-constants';
export {
RESOURCE_TYPE_KUBERNETES_RESOURCE,
kubernetesProxyPermission,
kubernetesClusterPermissions,
kubernetesPermissions,
} from './permissions';
+8 -2
View File
@@ -16,6 +16,12 @@
import { createPermission } from '@backstage/plugin-permission-common';
/**
* Permission resource type which corresponds to cluster entities.
* @alpha
*/
export const RESOURCE_TYPE_KUBERNETES_RESOURCE = 'kubernetes-resource';
/** This permission is used to check access to the proxy endpoint
* @alpha
*/
@@ -25,7 +31,7 @@ export const kubernetesProxyPermission = createPermission({
});
/**
* List of all cluster permissions.
* List of all Kubernetes permissions.
* @alpha
*/
export const kubernetesClusterPermissions = [kubernetesProxyPermission];
export const kubernetesPermissions = [kubernetesProxyPermission];