@infosys_ltd/openfga-plugin-backstage
Version:
This plugin wraps around the Backstage Permission Framework and uses the OPENFGA client to evaluate policies.
31 lines (28 loc) • 952 B
JavaScript
import { createPlugin, createApiFactory, configApiRef, discoveryApiRef, createRoutableExtension } from '@backstage/core-plugin-api';
import { rootRouteRef } from './routes.esm.js';
import { openFgaApiRef, OpenFgaClient } from '@infosys_ltd/backstage-plugin-openfga-common';
const openfgaPlugin = createPlugin({
id: "openfga",
apis: [
createApiFactory({
api: openFgaApiRef,
deps: {
configApi: configApiRef,
discoveryApi: discoveryApiRef
},
factory: ({ configApi, discoveryApi }) => OpenFgaClient.fromConfig(configApi, discoveryApi)
})
],
routes: {
root: rootRouteRef
}
});
const OpenfgaPage = openfgaPlugin.provide(
createRoutableExtension({
name: "OpenfgaPage",
component: () => import('./components/HeaderComponent/index.esm.js').then((m) => m.HeaderComponent),
mountPoint: rootRouteRef
})
);
export { OpenfgaPage, openfgaPlugin };
//# sourceMappingURL=plugin.esm.js.map