chore: fixing changesets and fixing up release

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2024-01-24 10:48:35 +01:00
parent 848c06e108
commit 28610f4aee
2 changed files with 36 additions and 5 deletions
+5 -5
View File
@@ -1,12 +1,12 @@
---
'@backstage/plugin-azure-sites-backend': minor
'@backstage/plugin-azure-sites-common': minor
'@backstage/plugin-azure-sites': minor
'@backstage/plugin-azure-sites-backend': patch
'@backstage/plugin-azure-sites-common': patch
'@backstage/plugin-azure-sites': patch
---
`Azure Site` Start and Stop action is now protected with `Permission framework`. Also `catalogApi` is required in `createRouter` when adding this plugin.
Azure Sites `start` and `stop` action is now protected with the Permissions framework.
The below example illustrate that the action is forbids anyone but the owner of the catalog entity to trigger actions towards a site tied to an entity.
The below example describes an action that forbids anyone but the owner of the catalog entity to trigger actions towards a site tied to an entity.
```typescript
// packages/backend/src/plugins/permission.ts
+31
View File
@@ -0,0 +1,31 @@
---
'@backstage/plugin-azure-sites-backend': minor
---
**BREAKING**: `catalogApi` and `permissionsApi` are now a requirement to be passed through to the `createRouter` function.
You can fix the typescript issues by passing through the required dependencies like the below `diff` shows:
```diff
import {
createRouter,
AzureSitesApi,
} from '@backstage/plugin-azure-sites-backend';
import { Router } from 'express';
import { PluginEnvironment } from '../types';
export default async function createPlugin(
env: PluginEnvironment,
): Promise<Router> {
+ const catalogClient = new CatalogClient({
+ discoveryApi: env.discovery,
+ });
return await createRouter({
logger: env.logger,
azureSitesApi: AzureSitesApi.fromConfig(env.config),
+ catalogApi: catalogClient,
+ permissionsApi: env.permissions,
});
}
```