From 3c3466dd51cecba1b650f33f2610a9fe8fe2032f Mon Sep 17 00:00:00 2001 From: Vincenzo Scamporlino Date: Thu, 11 Sep 2025 20:33:46 +0200 Subject: [PATCH] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fredrik Adelöw Signed-off-by: Vincenzo Scamporlino --- .changeset/rotten-hairs-attack.md | 2 +- plugins/catalog-backend/config.d.ts | 4 ++-- plugins/catalog-backend/src/ingestion/CatalogRules.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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