Closed c4rth closed 6 months ago
why didn't you add permission.ts plugin to plugins folder? as per new backend migration docs legacy plugins should be added like this:
import { legacyPlugin } from '@backstage/backend-common';
backend.add(legacyPlugin('todo', import('./plugins/todo')));
anyway it doesn't work for me...
@MarkPorohnja
Because there is already a createPlugin
in https://github.com/janus-idp/backstage-plugins/blob/main/plugins/rbac-backend/src/plugin.ts
So this should be sufficient
backend.add(import('@janus-idp/backstage-plugin-rbac-backend'));
Thanks for the fix !
Hi Mark,
It works fine for me. You receive the error because in the index.ts, you add 2 permission plugins: plugin-permission-backend and backstage-plugin-rbac-backend. Comment the 1st one should do the trick.
// permission plugin // @./plugin-permission-backend/alpha')); // backend.add( // @./plugin-permission-backend-module-allow-all-policy'), // ); @.***/backstage-plugin-rbac-backend')); Best Regards,
Thierry
On Tue, 7 May 2024 at 14:06, Mark Porohnja @.***> wrote:
@c4rth https://github.com/c4rth could you please verify that recent plugin update works for you? I am using version 2.7.1 of backstage-plugin-rbac-backend and it gives following error:
Error: Plugin 'permission' is already registered at BackendInitializer.doStart_fn @./backend-app-api/dist/index.cjs.js:1739:17) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async BackendInitializer.start @./backend-app-api/dist/index.cjs.js:1626:5) at async BackstageBackend.start @.***/backend-app-api/dist/index.cjs.js:1894:5)
my index.ts
import { createBackend } from @./backend-defaults'; const backend = createBackend(); @*.**@*.**@*.**@*./plugin-techdocs-backend/alpha')); // auth @*.**@*./plugin-auth-backend-module-microsoft-provider'));// See https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin // catalog @./plugin-catalog-backend/alpha'));backend.add( @.**@./plugin-catalog-backend-module-msgraph/alpha')); // permission @./plugin-permission-backend/alpha'));// backend.add(// @./plugin-permission-backend-module-allow-all-policy'),// @./backstage-plugin-rbac-backend')); // search @*.**@*.**@./plugin-search-backend-module-techdocs/alpha')); backend.start();
— Reply to this email directly, view it on GitHub https://github.com/janus-idp/backstage-plugins/issues/1538#issuecomment-2098250952, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACA4SGMUQKF3OE4RRMJDR4TZBC7S7AVCNFSM6AAAAABGVGZZFSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJYGI2TAOJVGI . You are receiving this because you were mentioned.Message ID: @.***>
yep, figured it out already. Everything works. Thanks guys <3
Describe the bug
I'm using Backstage 1.26.0 with the new backend system. The authentication is done with '@backstage/plugin-auth-backend-module-microsoft-provider' The organization data ingestion is done with '@backstage/plugin-catalog-backend-module-msgraph/alpha' So far no problem, I can log in, the users/groups are present and access to everything. I enabled the '@backstage/plugin-permission-backend/alpha' and added a simple policy without problem. For convenience and because it offers great features, I installed the janus-idp rbac plugins in the front end and the back end as mentioned in the documentation. I can still log in, but I cannot access to anything (e.g. the catalog), even if my user is defined as admin. I think I have everything configured correctly (front, backend, service-to-service secret keys, rbac, ...) By accessing the catalog, I get an error 'Error: Could not fetch catalog entities.' 'ResponseError: Request failed with 403 Forbidden' In logging, some 403 errors with 'POST /api/permission/authorize'
Expected Behavior
The logged use can access the catalog
What are the steps to reproduce this bug?
Repository available : https://github.com/c4rth/backstage-playground rem: some values are in app-config.local.yaml and therefore not pushed.
Versions of software used and environment
Backstage 1.26.0
packages/app/package.json - dependencies
packages/backend/package.json - dependencies
configuration: app-config.yaml
organization: name: Acme
backend: baseUrl: http://localhost:7007 auth: externalAccess:
client: better-sqlite3
connection: ":memory:"
permission: enabled: true rbac: pluginsWithPermission: