diff --git a/.changeset/tidy-cooks-mix.md b/.changeset/tidy-cooks-mix.md index 97e95331f2..873de64a45 100644 --- a/.changeset/tidy-cooks-mix.md +++ b/.changeset/tidy-cooks-mix.md @@ -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 diff --git a/.changeset/tidy-cooks-mixed.md b/.changeset/tidy-cooks-mixed.md new file mode 100644 index 0000000000..a72f1ee0df --- /dev/null +++ b/.changeset/tidy-cooks-mixed.md @@ -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 { ++ const catalogClient = new CatalogClient({ ++ discoveryApi: env.discovery, ++ }); + + return await createRouter({ + logger: env.logger, + azureSitesApi: AzureSitesApi.fromConfig(env.config), ++ catalogApi: catalogClient, ++ permissionsApi: env.permissions, + }); + } +```