diff --git a/.changeset/rotten-hairs-attack.md b/.changeset/rotten-hairs-attack.md index 7754441f78..aa6dabc78c 100644 --- a/.changeset/rotten-hairs-attack.md +++ b/.changeset/rotten-hairs-attack.md @@ -2,7 +2,7 @@ '@backstage/plugin-catalog-backend': minor --- -Add support for specifying an entity `spec.type` in `catalog.rules.allow` rules within the catalog configuration. +Add support for specifying an entity `spec.type` in `catalog.rules` and `catalog.locations.rules` within the catalog configuration. For example, this enables allowing all `Template` entities with the type `website`: diff --git a/plugins/catalog-backend/config.d.ts b/plugins/catalog-backend/config.d.ts index 4b349405cc..a506476dbf 100644 --- a/plugins/catalog-backend/config.d.ts +++ b/plugins/catalog-backend/config.d.ts @@ -39,8 +39,8 @@ export interface Config { * * E.g. ["Component", "API", "Template", "Location"] * - * You can also specify the type of the entity by using an object with `kind` and optional `type` properties. - * E.g. [{ kind: "Component", type: "service" }] + * You can also specify the type of the entity by using an object with `kind` and optional `spec.type` properties. + * E.g. [{ kind: "Component", 'spec.type': "service" }] */ allow: Array; /** diff --git a/plugins/catalog-backend/src/ingestion/CatalogRules.ts b/plugins/catalog-backend/src/ingestion/CatalogRules.ts index b348f5b752..ea4e520177 100644 --- a/plugins/catalog-backend/src/ingestion/CatalogRules.ts +++ b/plugins/catalog-backend/src/ingestion/CatalogRules.ts @@ -83,7 +83,7 @@ export class DefaultCatalogRulesEnforcer implements CatalogRulesEnforcer { * - allow: [Component, API] * - allow: * - kind: Resource - * type: database + * 'spec.type': database * - allow: [Template] * locations: * - type: url