From 419ca637c075ae4765a8e9674080642a96521c08 Mon Sep 17 00:00:00 2001 From: MT Lewis Date: Mon, 20 Dec 2021 15:14:38 +0000 Subject: [PATCH] permissions: add changeset for optimizations Signed-off-by: MT Lewis --- .changeset/shiny-bugs-beam.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changeset/shiny-bugs-beam.md diff --git a/.changeset/shiny-bugs-beam.md b/.changeset/shiny-bugs-beam.md new file mode 100644 index 0000000000..bc50486526 --- /dev/null +++ b/.changeset/shiny-bugs-beam.md @@ -0,0 +1,11 @@ +--- +'@backstage/plugin-permission-backend': minor +'@backstage/plugin-permission-node': minor +--- + +Optimizations to the integration between the permission backend and plugin-backends using createPermissionIntegrationRouter: + +- The permission backend already supported batched requests to authorize, but would make calls to plugin backend to apply conditions serially. Now, after applying the policy for each authorization request, the permission backend makes a single batched /apply-conditions request to each plugin backend referenced in policy decisions. +- The `getResource` method accepted by `createPermissionIntegrationRouter` has been replaced with `getResources`, to allow consumers to make batch requests to upstream data stores. When /apply-conditions is called with a batch of requests, all required resources are requested in a single invocation of `getResources`. + +Plugin owners consuming `createPermissionIntegrationRouter` should replace the `getResource` method in the options with a `getResources` method, accepting an array of resourceRefs, and returning a record object mapping those resourceRefs to resources (if present).