chore: Address PR comments
Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# @backstage/plugin-permission-backend-module-policy-allow-all
|
||||
# @backstage/plugin-permission-backend-module-allow-all-policy
|
||||
|
||||
The allow all policy backend module for the permission plugin.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
## API Report File for "@backstage/plugin-permission-backend-module-policy-allow-all"
|
||||
## API Report File for "@backstage/plugin-permission-backend-module-allow-all-policy"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@backstage/plugin-permission-backend-module-policy-allow-all",
|
||||
"name": "@backstage/plugin-permission-backend-module-allow-all-policy",
|
||||
"description": "Allow all policy backend module for the permission plugin.",
|
||||
"version": "0.0.0",
|
||||
"main": "src/index.ts",
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
import { BackstageIdentityResponse } from '@backstage/plugin-auth-node';
|
||||
import {
|
||||
AuthorizeResult,
|
||||
PolicyDecision,
|
||||
} from '@backstage/plugin-permission-common';
|
||||
import {
|
||||
PermissionPolicy,
|
||||
PolicyQuery,
|
||||
} from '@backstage/plugin-permission-node';
|
||||
|
||||
/*
|
||||
* Copyright 2023 The Backstage Authors
|
||||
*
|
||||
@@ -23,6 +13,17 @@ import {
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { BackstageIdentityResponse } from '@backstage/plugin-auth-node';
|
||||
import {
|
||||
AuthorizeResult,
|
||||
PolicyDecision,
|
||||
} from '@backstage/plugin-permission-common';
|
||||
import {
|
||||
PermissionPolicy,
|
||||
PolicyQuery,
|
||||
} from '@backstage/plugin-permission-node';
|
||||
|
||||
export class AllowAllPermissionPolicy implements PermissionPolicy {
|
||||
async handle(
|
||||
_request: PolicyQuery,
|
||||
|
||||
@@ -61,7 +61,7 @@ export const permissionPlugin = createBackendPlugin({
|
||||
const winstonLogger = loggerToWinstonLogger(logger);
|
||||
if (!policies.policy) {
|
||||
throw new Error(
|
||||
'No policy module installed! Please install a policy module. If you want to allow all requests, use @backstage/plugin-permission-backend-module-policy-allow-all permissionModuleAllowAllPolicy',
|
||||
'No policy module installed! Please install a policy module. If you want to allow all requests, use @backstage/plugin-permission-backend-module-allow-all-policy permissionModuleAllowAllPolicy',
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user