forked from janus-idp/backstage-showcase
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a dynamic-plugin-aware
PluginIDProvider
(janus-idp#705)
* Add a dynamic-plugin-aware `PluginIDProvider` Signed-off-by: David Festal <dfestal@redhat.com> * Add changeset Signed-off-by: David Festal <dfestal@redhat.com> --------- Signed-off-by: David Festal <dfestal@redhat.com>
- Loading branch information
1 parent
58ed7c0
commit 6a28d78
Showing
3 changed files
with
57 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'backend': patch | ||
--- | ||
|
||
Add RBAC permission policy retrieval for backend dynamic plugins. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
import type { Router } from 'express'; | ||
import type { PluginEnvironment } from '../types'; | ||
import { PolicyBuilder } from '@janus-idp/backstage-plugin-rbac-backend'; | ||
import { | ||
PolicyBuilder, | ||
PluginIdProvider, | ||
} from '@janus-idp/backstage-plugin-rbac-backend'; | ||
|
||
export default async function createPlugin( | ||
env: PluginEnvironment, | ||
pluginIdProvider?: PluginIdProvider | undefined, | ||
): Promise<Router> { | ||
return await PolicyBuilder.build({ | ||
config: env.config, | ||
logger: env.logger, | ||
discovery: env.discovery, | ||
identity: env.identity, | ||
permissions: env.permissions, | ||
tokenManager: env.tokenManager, | ||
}); | ||
return await PolicyBuilder.build( | ||
{ | ||
config: env.config, | ||
logger: env.logger, | ||
discovery: env.discovery, | ||
identity: env.identity, | ||
permissions: env.permissions, | ||
tokenManager: env.tokenManager, | ||
}, | ||
pluginIdProvider, | ||
); | ||
} |