Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bright-bats-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pagerduty/backstage-plugin-backend': minor
---

Disables unauthenticated access to plugin routes by default
16 changes: 11 additions & 5 deletions plugins/backstage-plugin-backend/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CatalogFetchApi {
constructor(
private readonly logger: LoggerService,
private readonly auth: AuthService,
) {}
) { }

async fetch(
input: unknown,
Expand Down Expand Up @@ -62,10 +62,16 @@ export const pagerDutyPlugin = createBackendPlugin({
}),
}),
);
httpRouter.addAuthPolicy({
path: '/',
allow: 'unauthenticated',
});
// The default Backstage behaviour is to require authentication on routes.
// https://backstage.io/docs/backend-system/core-services/http-router/#using-the-service
// Setting enableUnauthenticatedAccess to true will allow unauthenticated access to the PagerDuty plugin routes.
const enableUnauthenticatedAccess: boolean = config.getOptionalBoolean('pagerDuty.enableUnauthenticatedAccess') ?? false;
if (enableUnauthenticatedAccess === true) {
httpRouter.addAuthPolicy({
path: '/',
allow: 'unauthenticated',
});
}
},
});
},
Expand Down
6 changes: 6 additions & 0 deletions plugins/backstage-plugin/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @backstage/plugin-pagerduty

## 0.16.2

### Patch Changes

- 5d9c0e7: Remove Backstage UI CSS imports from frontend plugin

## 0.16.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion plugins/backstage-plugin/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@pagerduty/backstage-plugin",
"description": "A Backstage plugin that integrates towards PagerDuty",
"version": "0.16.1",
"version": "0.16.2",
"main": "dist/index.esm.js",
"types": "dist/index.d.ts",
"license": "Apache-2.0",
Expand Down