@backstage/plugin-catalog-backend 3.0.2-next.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,59 @@
1
1
  # @backstage/plugin-catalog-backend
2
2
 
3
+ ## 3.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 9b40a55: Add support for specifying an entity `spec.type` in `catalog.rules` and `catalog.locations.rules` within the catalog configuration.
8
+
9
+ For example, this enables allowing all `Template` entities with the type `website`:
10
+
11
+ ```diff
12
+ catalog:
13
+ rules:
14
+ - allow:
15
+ - Component
16
+ - API
17
+ - Resource
18
+ - System
19
+ - Domain
20
+ - Location
21
+ + - allow:
22
+ + - kind: Template
23
+ + spec.type: website
24
+ locations:
25
+ - type: url
26
+ pattern: https://github.com/org/*\/blob/master/*.yaml
27
+ ```
28
+
29
+ ### Patch Changes
30
+
31
+ - 37b4eaf: The 'get-catalog-entity' action now throws a ConflictError instead of generic Error if multiple entities are found, so MCP call doesn't fail with 500.
32
+ - 2bbd24f: Order catalog processors by priority.
33
+
34
+ This change enables the ordering of catalog processors by their priority,
35
+ allowing for more control over the catalog processing sequence.
36
+ The default priority is set to 20, and processors can be assigned a custom
37
+ priority to influence their execution order. Lower number indicates higher priority.
38
+ The priority can be set by implementing the `getPriority` method in the processor class
39
+ or by adding a `catalog.processors.<processorName>.priority` configuration
40
+ in the `app-config.yaml` file. The configuration takes precedence over the method.
41
+
42
+ - e934a27: Updating `catalog:get-catalog-entity` action to be `readOnly` and non destructive
43
+ - 0efcc97: Updated generated schemas
44
+ - 2204f5b: Prevent deadlock in catalog deferred stitching
45
+ - 58874c4: Add support to disable catalog providers and processors via configuration
46
+ - a4c82ad: Only run provider orphan cleanup if the engine is started in the first place
47
+ - Updated dependencies
48
+ - @backstage/plugin-catalog-node@1.19.0
49
+ - @backstage/catalog-client@1.12.0
50
+ - @backstage/plugin-events-node@0.4.15
51
+ - @backstage/integration@1.18.0
52
+ - @backstage/types@1.2.2
53
+ - @backstage/backend-openapi-utils@0.6.1
54
+ - @backstage/backend-plugin-api@1.4.3
55
+ - @backstage/plugin-permission-node@0.10.4
56
+
3
57
  ## 3.0.2-next.1
4
58
 
5
59
  ### Patch Changes
package/config.d.ts CHANGED
@@ -38,8 +38,11 @@ export interface Config {
38
38
  * Allow entities of these particular kinds.
39
39
  *
40
40
  * E.g. ["Component", "API", "Template", "Location"]
41
+ *
42
+ * You can also specify the type of the entity by using an object with `kind` and optional `spec.type` properties.
43
+ * E.g. [{ kind: "Component", 'spec.type': "service" }]
41
44
  */
42
- allow: Array<string>;
45
+ allow: Array<string | { kind: string; 'spec.type'?: string }>;
43
46
  /**
44
47
  * Limit this rule to a specific location
45
48
  *
@@ -218,5 +221,43 @@ export interface Config {
218
221
  * housing catalog-info files.
219
222
  */
220
223
  processingInterval?: HumanDuration | false;
224
+
225
+ /**
226
+ * Catalog provide specific configuration.
227
+ * Additional configuration for providers are specified in the catalog
228
+ * modules.
229
+ */
230
+ providers?: {
231
+ /**
232
+ * Name is the provider ID, e.g. "bitbucketServer"
233
+ */
234
+ [name: string]: {
235
+ /**
236
+ * Whether the provider is enabled or not. Defaults to true.
237
+ */
238
+ enabled?: boolean;
239
+ };
240
+ };
241
+ /**
242
+ * Configuration for entity processors. Additional configuration for
243
+ * processors are specified in the catalog modules.
244
+ */
245
+ processors?: {
246
+ /**
247
+ * Name is the processor ID, e.g. "catalog-processor"
248
+ */
249
+ [name: string]: {
250
+ /**
251
+ * Whether the processor is enabled or not. Defaults to true.
252
+ */
253
+ enabled?: boolean;
254
+ /**
255
+ * The priority of the processor, which is used to determine the order in which
256
+ * processors are run. The default priority is 20, and lower value means
257
+ * that the processor runs earlier.
258
+ */
259
+ priority?: number;
260
+ };
261
+ };
221
262
  };
222
263
  }
@@ -10,6 +10,11 @@ const createGetCatalogEntityAction = ({
10
10
  actionsRegistry.register({
11
11
  name: "get-catalog-entity",
12
12
  title: "Get Catalog Entity",
13
+ attributes: {
14
+ destructive: false,
15
+ readOnly: true,
16
+ idempotent: true
17
+ },
13
18
  description: `
14
19
  This allows you to get a single entity from the software catalog.
15
20
  Each entity in the software catalog has a unique name, kind, and namespace. The default namespace is "default".
@@ -1 +1 @@
1
- {"version":3,"file":"createGetCatalogEntityAction.cjs.js","sources":["../../src/actions/createGetCatalogEntityAction.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ActionsRegistryService } from '@backstage/backend-plugin-api/alpha';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { ConflictError, InputError } from '@backstage/errors';\nimport { CatalogService } from '@backstage/plugin-catalog-node';\n\nexport const createGetCatalogEntityAction = ({\n catalog,\n actionsRegistry,\n}: {\n catalog: CatalogService;\n actionsRegistry: ActionsRegistryService;\n}) => {\n actionsRegistry.register({\n name: 'get-catalog-entity',\n title: 'Get Catalog Entity',\n description: `\nThis allows you to get a single entity from the software catalog.\nEach entity in the software catalog has a unique name, kind, and namespace. The default namespace is \"default\".\nEach entity is identified by a unique entity reference, which is a string of the form \"kind:namespace/name\".\n `,\n schema: {\n input: z =>\n z.object({\n kind: z\n .string()\n .describe(\n 'The kind of the entity to query. If the kind is unknown it can be omitted.',\n )\n .optional(),\n namespace: z\n .string()\n .describe(\n 'The namespace of the entity to query. If the namespace is unknown it can be omitted.',\n )\n .optional(),\n name: z.string().describe('The name of the entity to query'),\n }),\n // TODO: is there a better way to do this?\n output: z => z.object({}).passthrough(),\n },\n action: async ({ input, credentials }) => {\n const filter: Record<string, string> = { 'metadata.name': input.name };\n\n if (input.kind) {\n filter.kind = input.kind;\n }\n\n if (input.namespace) {\n filter['metadata.namespace'] = input.namespace;\n }\n\n const { items } = await catalog.queryEntities(\n { filter },\n {\n credentials,\n },\n );\n\n if (items.length === 0) {\n throw new InputError(`No entity found with name \"${input.name}\"`);\n }\n\n if (items.length > 1) {\n throw new ConflictError(\n `Multiple entities found with name \"${\n input.name\n }\", please provide more specific filters. Entities found: ${items\n .map(item => `\"${stringifyEntityRef(item)}\"`)\n .join(', ')}`,\n );\n }\n\n const [entity] = items;\n\n return {\n output: entity,\n };\n },\n });\n};\n"],"names":["InputError","ConflictError","stringifyEntityRef"],"mappings":";;;;;AAoBO,MAAM,+BAA+B,CAAC;AAAA,EAC3C,OAAA;AAAA,EACA;AACF,CAAA,KAGM;AACJ,EAAA,eAAA,CAAgB,QAAA,CAAS;AAAA,IACvB,IAAA,EAAM,oBAAA;AAAA,IACN,KAAA,EAAO,oBAAA;AAAA,IACP,WAAA,EAAa;AAAA;AAAA;AAAA;AAAA,IAAA,CAAA;AAAA,IAKb,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO,CAAA,CAAA,KACL,CAAA,CAAE,MAAA,CAAO;AAAA,QACP,IAAA,EAAM,CAAA,CACH,MAAA,EAAO,CACP,QAAA;AAAA,UACC;AAAA,UAED,QAAA,EAAS;AAAA,QACZ,SAAA,EAAW,CAAA,CACR,MAAA,EAAO,CACP,QAAA;AAAA,UACC;AAAA,UAED,QAAA,EAAS;AAAA,QACZ,IAAA,EAAM,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,iCAAiC;AAAA,OAC5D,CAAA;AAAA;AAAA,MAEH,QAAQ,CAAA,CAAA,KAAK,CAAA,CAAE,OAAO,EAAE,EAAE,WAAA;AAAY,KACxC;AAAA,IACA,MAAA,EAAQ,OAAO,EAAE,KAAA,EAAO,aAAY,KAAM;AACxC,MAAA,MAAM,MAAA,GAAiC,EAAE,eAAA,EAAiB,KAAA,CAAM,IAAA,EAAK;AAErE,MAAA,IAAI,MAAM,IAAA,EAAM;AACd,QAAA,MAAA,CAAO,OAAO,KAAA,CAAM,IAAA;AAAA,MACtB;AAEA,MAAA,IAAI,MAAM,SAAA,EAAW;AACnB,QAAA,MAAA,CAAO,oBAAoB,IAAI,KAAA,CAAM,SAAA;AAAA,MACvC;AAEA,MAAA,MAAM,EAAE,KAAA,EAAM,GAAI,MAAM,OAAA,CAAQ,aAAA;AAAA,QAC9B,EAAE,MAAA,EAAO;AAAA,QACT;AAAA,UACE;AAAA;AACF,OACF;AAEA,MAAA,IAAI,KAAA,CAAM,WAAW,CAAA,EAAG;AACtB,QAAA,MAAM,IAAIA,iBAAA,CAAW,CAAA,2BAAA,EAA8B,KAAA,CAAM,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,MAClE;AAEA,MAAA,IAAI,KAAA,CAAM,SAAS,CAAA,EAAG;AACpB,QAAA,MAAM,IAAIC,oBAAA;AAAA,UACR,CAAA,mCAAA,EACE,KAAA,CAAM,IACR,CAAA,yDAAA,EAA4D,MACzD,GAAA,CAAI,CAAA,IAAA,KAAQ,CAAA,CAAA,EAAIC,+BAAA,CAAmB,IAAI,CAAC,CAAA,CAAA,CAAG,CAAA,CAC3C,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,SACf;AAAA,MACF;AAEA,MAAA,MAAM,CAAC,MAAM,CAAA,GAAI,KAAA;AAEjB,MAAA,OAAO;AAAA,QACL,MAAA,EAAQ;AAAA,OACV;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"createGetCatalogEntityAction.cjs.js","sources":["../../src/actions/createGetCatalogEntityAction.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { ActionsRegistryService } from '@backstage/backend-plugin-api/alpha';\nimport { stringifyEntityRef } from '@backstage/catalog-model';\nimport { ConflictError, InputError } from '@backstage/errors';\nimport { CatalogService } from '@backstage/plugin-catalog-node';\n\nexport const createGetCatalogEntityAction = ({\n catalog,\n actionsRegistry,\n}: {\n catalog: CatalogService;\n actionsRegistry: ActionsRegistryService;\n}) => {\n actionsRegistry.register({\n name: 'get-catalog-entity',\n title: 'Get Catalog Entity',\n attributes: {\n destructive: false,\n readOnly: true,\n idempotent: true,\n },\n description: `\nThis allows you to get a single entity from the software catalog.\nEach entity in the software catalog has a unique name, kind, and namespace. The default namespace is \"default\".\nEach entity is identified by a unique entity reference, which is a string of the form \"kind:namespace/name\".\n `,\n schema: {\n input: z =>\n z.object({\n kind: z\n .string()\n .describe(\n 'The kind of the entity to query. If the kind is unknown it can be omitted.',\n )\n .optional(),\n namespace: z\n .string()\n .describe(\n 'The namespace of the entity to query. If the namespace is unknown it can be omitted.',\n )\n .optional(),\n name: z.string().describe('The name of the entity to query'),\n }),\n // TODO: is there a better way to do this?\n output: z => z.object({}).passthrough(),\n },\n action: async ({ input, credentials }) => {\n const filter: Record<string, string> = { 'metadata.name': input.name };\n\n if (input.kind) {\n filter.kind = input.kind;\n }\n\n if (input.namespace) {\n filter['metadata.namespace'] = input.namespace;\n }\n\n const { items } = await catalog.queryEntities(\n { filter },\n {\n credentials,\n },\n );\n\n if (items.length === 0) {\n throw new InputError(`No entity found with name \"${input.name}\"`);\n }\n\n if (items.length > 1) {\n throw new ConflictError(\n `Multiple entities found with name \"${\n input.name\n }\", please provide more specific filters. Entities found: ${items\n .map(item => `\"${stringifyEntityRef(item)}\"`)\n .join(', ')}`,\n );\n }\n\n const [entity] = items;\n\n return {\n output: entity,\n };\n },\n });\n};\n"],"names":["InputError","ConflictError","stringifyEntityRef"],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AA,EAAO;AAAA,QACT;AAAA,UACE;AAAA;AACF,OACF;AAEA,MAAA,IAAI,KAAA,CAAM,WAAW,CAAA,EAAG;AACtB,QAAA,MAAM,IAAIA,iBAAA,CAAW,CAAA,2BAAA,EAA8B,KAAA,CAAM,IAAI,CAAA,CAAA,CAAG,CAAA;AAAA,MAClE;AAEA,MAAA,IAAI,KAAA,CAAM,SAAS,CAAA,EAAG;AACpB,QAAA,MAAM,IAAIC,oBAAA;AAAA,UACR,CAAA,mCAAA,EACE,KAAA,CAAM,IACR,CAAA,yDAAA,EAA4D,MACzD,GAAA,CAAI,CAAA,IAAA,KAAQ,CAAA,CAAA,EAAIC,+BAAA,CAAmB,IAAI,CAAC,CAAA,CAAA,CAAG,CAAA,CAC3C,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,SACf;AAAA,MACF;AAEA,MAAA,MAAM,CAAC,MAAM,CAAA,GAAI,KAAA;AAEjB,MAAA,OAAO;AAAA,QACL,MAAA,EAAQ;AAAA,OACV;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
@@ -2,11 +2,18 @@
2
2
 
3
3
  var path = require('path');
4
4
  var minimatch = require('minimatch');
5
+ var zod = require('zod');
5
6
 
6
7
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
7
8
 
8
9
  var path__default = /*#__PURE__*/_interopDefaultCompat(path);
9
10
 
11
+ const allowRuleParser = zod.z.array(
12
+ zod.z.object({
13
+ kind: zod.z.string(),
14
+ "spec.type": zod.z.string().optional()
15
+ }).or(zod.z.string()).transform((val) => typeof val === "string" ? { kind: val } : val)
16
+ );
10
17
  class DefaultCatalogRulesEnforcer {
11
18
  constructor(rules) {
12
19
  this.rules = rules;
@@ -39,6 +46,9 @@ class DefaultCatalogRulesEnforcer {
39
46
  * catalog:
40
47
  * rules:
41
48
  * - allow: [Component, API]
49
+ * - allow:
50
+ * - kind: Resource
51
+ * 'spec.type': database
42
52
  * - allow: [Template]
43
53
  * locations:
44
54
  * - type: url
@@ -63,7 +73,7 @@ class DefaultCatalogRulesEnforcer {
63
73
  const rules = new Array();
64
74
  if (config.has("catalog.rules")) {
65
75
  const globalRules = config.getConfigArray("catalog.rules").map((ruleConf) => ({
66
- allow: ruleConf.getStringArray("allow").map((kind) => ({ kind })),
76
+ allow: allowRuleParser.parse(ruleConf.get("allow")),
67
77
  locations: ruleConf.getOptionalConfigArray("locations")?.map((locationConfig) => {
68
78
  const location = {
69
79
  pattern: locationConfig.getOptionalString("pattern"),
@@ -139,9 +149,17 @@ class DefaultCatalogRulesEnforcer {
139
149
  return true;
140
150
  }
141
151
  for (const matcher of matchers) {
142
- if (entity?.kind?.toLowerCase() !== matcher.kind.toLowerCase()) {
152
+ if (entity.kind?.toLocaleLowerCase("en-US") !== matcher.kind.toLocaleLowerCase("en-US")) {
143
153
  continue;
144
154
  }
155
+ if (matcher["spec.type"]) {
156
+ if (typeof entity.spec?.type !== "string") {
157
+ continue;
158
+ }
159
+ if (matcher["spec.type"].toLocaleLowerCase("en-US") !== entity.spec.type.toLocaleLowerCase("en-US")) {
160
+ continue;
161
+ }
162
+ }
145
163
  return true;
146
164
  }
147
165
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogRules.cjs.js","sources":["../../src/ingestion/CatalogRules.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport { Entity } from '@backstage/catalog-model';\nimport path from 'path';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport { minimatch } from 'minimatch';\n\n/**\n * Rules to apply to catalog entities.\n *\n * An undefined list of matchers means match all, an empty list of matchers means match none.\n */\nexport type CatalogRule = {\n allow: Array<{\n kind: string;\n }>;\n locations?: Array<{\n exact?: string;\n type: string;\n pattern?: string;\n }>;\n};\n\n/**\n * Decides whether an entity from a given location is allowed to enter the\n * catalog, according to some rule set.\n */\nexport type CatalogRulesEnforcer = {\n isAllowed(entity: Entity, location: LocationSpec): boolean;\n};\n\n/**\n * Implements the default catalog rule set, consuming the config keys\n * `catalog.rules` and `catalog.locations.[].rules`.\n */\nexport class DefaultCatalogRulesEnforcer implements CatalogRulesEnforcer {\n /**\n * Default rules used by the catalog.\n *\n * Denies any location from specifying user or group entities.\n */\n static readonly defaultRules: CatalogRule[] = [\n {\n allow: ['Component', 'API', 'Location'].map(kind => ({ kind })),\n },\n ];\n\n /**\n * Loads catalog rules from config.\n *\n * This reads `catalog.rules` and defaults to the default rules if no value is present.\n * The value of the config should be a list of config objects, each with a single `allow`\n * field which in turn is a list of entity kinds to allow.\n *\n * If there is no matching rule to allow an ingested entity, it will be rejected by the catalog.\n *\n * It also reads in rules from `catalog.locations`, where each location can have a list\n * of rules for that specific location, specified in a `rules` field.\n *\n * For example:\n *\n * ```yaml\n * catalog:\n * rules:\n * - allow: [Component, API]\n * - allow: [Template]\n * locations:\n * - type: url\n * pattern: https://github.com/org/*\\/blob/master/template.yaml\n * - allow: [Location]\n * locations:\n * - type: url\n * pattern: https://github.com/org/repo/blob/master/location.yaml\n *\n * locations:\n * - type: url\n * target: https://github.com/org/repo/blob/master/users.yaml\n * rules:\n * - allow: [User, Group]\n * - type: url\n * target: https://github.com/org/repo/blob/master/systems.yaml\n * rules:\n * - allow: [System]\n * ```\n */\n static fromConfig(config: Config) {\n const rules = new Array<CatalogRule>();\n\n if (config.has('catalog.rules')) {\n const globalRules = config\n .getConfigArray('catalog.rules')\n .map(ruleConf => ({\n allow: ruleConf.getStringArray('allow').map(kind => ({ kind })),\n locations: ruleConf\n .getOptionalConfigArray('locations')\n ?.map(locationConfig => {\n const location = {\n pattern: locationConfig.getOptionalString('pattern'),\n type: locationConfig.getString('type'),\n exact: locationConfig.getOptionalString('exact'),\n };\n if (location.pattern && location.exact) {\n throw new Error(\n 'A catalog rule location cannot have both exact and pattern values',\n );\n }\n return location;\n }),\n }));\n rules.push(...globalRules);\n } else {\n rules.push(...DefaultCatalogRulesEnforcer.defaultRules);\n }\n\n if (config.has('catalog.locations')) {\n const locationRules = config\n .getConfigArray('catalog.locations')\n .flatMap(locConf => {\n if (!locConf.has('rules')) {\n return [];\n }\n const type = locConf.getString('type');\n const exact = resolveTarget(type, locConf.getString('target'));\n\n return locConf.getConfigArray('rules').map(ruleConf => ({\n allow: ruleConf.getStringArray('allow').map(kind => ({ kind })),\n locations: [{ type, exact }],\n }));\n });\n\n rules.push(...locationRules);\n }\n\n return new DefaultCatalogRulesEnforcer(rules);\n }\n\n constructor(private readonly rules: CatalogRule[]) {}\n\n /**\n * Checks whether a specific entity/location combination is allowed\n * according to the configured rules.\n */\n isAllowed(entity: Entity, location: LocationSpec) {\n for (const rule of this.rules) {\n if (!this.matchLocation(location, rule.locations)) {\n continue;\n }\n\n if (this.matchEntity(entity, rule.allow)) {\n return true;\n }\n }\n\n return false;\n }\n\n private matchLocation(\n location: LocationSpec,\n matchers?: { exact?: string; type: string; pattern?: string }[],\n ): boolean {\n if (!matchers) {\n return true;\n }\n\n for (const matcher of matchers) {\n if (matcher.type !== location?.type) {\n continue;\n }\n if (matcher.exact && matcher.exact !== location?.target) {\n continue;\n }\n if (\n matcher.pattern &&\n !minimatch(location?.target, matcher.pattern, {\n nocase: true,\n dot: true,\n })\n ) {\n continue;\n }\n return true;\n }\n\n return false;\n }\n\n private matchEntity(entity: Entity, matchers?: { kind: string }[]): boolean {\n if (!matchers) {\n return true;\n }\n\n for (const matcher of matchers) {\n if (entity?.kind?.toLowerCase() !== matcher.kind.toLowerCase()) {\n continue;\n }\n\n return true;\n }\n\n return false;\n }\n}\n\nfunction resolveTarget(type: string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AAA,IAAI,QAAQ,IAAA,EAAM,WAAA,OAAkB,OAAA,CAAQ,IAAA,CAAK,aAAY,EAAG;AAC9D,QAAA;AAAA,MACF;AAEA,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AAEA,SAAS,aAAA,CAAc,MAAc,MAAA,EAAwB;AAC3D,EAAA,IAAI,SAAS,MAAA,EAAQ;AACnB,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAOC,qBAAA,CAAK,QAAQ,MAAM,CAAA;AAC5B;;;;"}
1
+ {"version":3,"file":"CatalogRules.cjs.js","sources":["../../src/ingestion/CatalogRules.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Config } from '@backstage/config';\nimport { Entity } from '@backstage/catalog-model';\nimport path from 'path';\nimport { LocationSpec } from '@backstage/plugin-catalog-common';\nimport { minimatch } from 'minimatch';\nimport { z } from 'zod';\n\n/**\n * Rules to apply to catalog entities.\n *\n * An undefined list of matchers means match all, an empty list of matchers means match none.\n */\nexport type CatalogRule = {\n allow: CatalogRuleAllow[];\n locations?: Array<{\n exact?: string;\n type: string;\n pattern?: string;\n }>;\n};\n\ntype CatalogRuleAllow = {\n kind: string;\n 'spec.type'?: string;\n};\n\n/**\n * Decides whether an entity from a given location is allowed to enter the\n * catalog, according to some rule set.\n */\nexport type CatalogRulesEnforcer = {\n isAllowed(entity: Entity, location: LocationSpec): boolean;\n};\n\nconst allowRuleParser = z.array(\n z\n .object({\n kind: z.string(),\n 'spec.type': z.string().optional(),\n })\n .or(z.string())\n .transform(val => (typeof val === 'string' ? { kind: val } : val)),\n);\n\n/**\n * Implements the default catalog rule set, consuming the config keys\n * `catalog.rules` and `catalog.locations.[].rules`.\n */\nexport class DefaultCatalogRulesEnforcer implements CatalogRulesEnforcer {\n /**\n * Default rules used by the catalog.\n *\n * Denies any location from specifying user or group entities.\n */\n static readonly defaultRules: CatalogRule[] = [\n {\n allow: ['Component', 'API', 'Location'].map(kind => ({ kind })),\n },\n ];\n\n /**\n * Loads catalog rules from config.\n *\n * This reads `catalog.rules` and defaults to the default rules if no value is present.\n * The value of the config should be a list of config objects, each with a single `allow`\n * field which in turn is a list of entity kinds to allow.\n *\n * If there is no matching rule to allow an ingested entity, it will be rejected by the catalog.\n *\n * It also reads in rules from `catalog.locations`, where each location can have a list\n * of rules for that specific location, specified in a `rules` field.\n *\n * For example:\n *\n * ```yaml\n * catalog:\n * rules:\n * - allow: [Component, API]\n * - allow:\n * - kind: Resource\n * 'spec.type': database\n * - allow: [Template]\n * locations:\n * - type: url\n * pattern: https://github.com/org/*\\/blob/master/template.yaml\n * - allow: [Location]\n * locations:\n * - type: url\n * pattern: https://github.com/org/repo/blob/master/location.yaml\n *\n * locations:\n * - type: url\n * target: https://github.com/org/repo/blob/master/users.yaml\n * rules:\n * - allow: [User, Group]\n * - type: url\n * target: https://github.com/org/repo/blob/master/systems.yaml\n * rules:\n * - allow: [System]\n * ```\n */\n static fromConfig(config: Config) {\n const rules = new Array<CatalogRule>();\n\n if (config.has('catalog.rules')) {\n const globalRules = config\n .getConfigArray('catalog.rules')\n .map(ruleConf => ({\n allow: allowRuleParser.parse(ruleConf.get('allow')),\n locations: ruleConf\n .getOptionalConfigArray('locations')\n ?.map(locationConfig => {\n const location = {\n pattern: locationConfig.getOptionalString('pattern'),\n type: locationConfig.getString('type'),\n exact: locationConfig.getOptionalString('exact'),\n };\n if (location.pattern && location.exact) {\n throw new Error(\n 'A catalog rule location cannot have both exact and pattern values',\n );\n }\n return location;\n }),\n }));\n rules.push(...globalRules);\n } else {\n rules.push(...DefaultCatalogRulesEnforcer.defaultRules);\n }\n\n if (config.has('catalog.locations')) {\n const locationRules = config\n .getConfigArray('catalog.locations')\n .flatMap(locConf => {\n if (!locConf.has('rules')) {\n return [];\n }\n const type = locConf.getString('type');\n const exact = resolveTarget(type, locConf.getString('target'));\n\n return locConf.getConfigArray('rules').map(ruleConf => ({\n allow: ruleConf.getStringArray('allow').map(kind => ({ kind })),\n locations: [{ type, exact }],\n }));\n });\n\n rules.push(...locationRules);\n }\n\n return new DefaultCatalogRulesEnforcer(rules);\n }\n\n constructor(private readonly rules: CatalogRule[]) {}\n\n /**\n * Checks whether a specific entity/location combination is allowed\n * according to the configured rules.\n */\n isAllowed(entity: Entity, location: LocationSpec) {\n for (const rule of this.rules) {\n if (!this.matchLocation(location, rule.locations)) {\n continue;\n }\n\n if (this.matchEntity(entity, rule.allow)) {\n return true;\n }\n }\n\n return false;\n }\n\n private matchLocation(\n location: LocationSpec,\n matchers?: { exact?: string; type: string; pattern?: string }[],\n ): boolean {\n if (!matchers) {\n return true;\n }\n\n for (const matcher of matchers) {\n if (matcher.type !== location?.type) {\n continue;\n }\n if (matcher.exact && matcher.exact !== location?.target) {\n continue;\n }\n if (\n matcher.pattern &&\n !minimatch(location?.target, matcher.pattern, {\n nocase: true,\n dot: true,\n })\n ) {\n continue;\n }\n return true;\n }\n\n return false;\n }\n\n private matchEntity(entity: Entity, matchers?: CatalogRuleAllow[]): boolean {\n if (!matchers) {\n return true;\n }\n\n for (const matcher of matchers) {\n if (\n entity.kind?.toLocaleLowerCase('en-US') !==\n matcher.kind.toLocaleLowerCase('en-US')\n ) {\n continue;\n }\n\n if (matcher['spec.type']) {\n if (typeof entity.spec?.type !== 'string') {\n continue;\n }\n if (\n matcher['spec.type'].toLocaleLowerCase('en-US') !==\n entity.spec.type.toLocaleLowerCase('en-US')\n ) {\n continue;\n }\n }\n\n return true;\n }\n\n return false;\n }\n}\n\nfunction resolveTarget(type: string, target: string): string {\n if (type !== 'file') {\n return target;\n }\n\n return path.resolve(target);\n}\n"],"names":["z","minimatch","path"],"mappings":";;;;;;;;;;AAkDA,MAAM,kBAAkBA,KAAA,CAAE,KAAA;AAAA,EACxBA,MACG,MAAA,CAAO;AAAA,IACN,IAAA,EAAMA,MAAE,MAAA,EAAO;AAAA,IACf,WAAA,EAAaA,KAAA,CAAE,MAAA,EAAO,CAAE,QAAA;AAAS,GAClC,CAAA,CACA,EAAA,CAAGA,KAAA,CAAE,MAAA,EAAQ,CAAA,CACb,SAAA,CAAU,CAAA,GAAA,KAAQ,OAAO,QAAQ,QAAA,GAAW,EAAE,IAAA,EAAM,GAAA,KAAQ,GAAI;AACrE,CAAA;AAMO,MAAM,2BAAA,CAA4D;AAAA,EAwGvE,YAA6B,KAAA,EAAsB;AAAtB,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AAAA,EAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAlGpD,OAAgB,YAAA,GAA8B;AAAA,IAC5C;AAAA,MACE,KAAA,EAAO,CAAC,WAAA,EAAa,KAAA,EAAO,UAAU,EAAE,GAAA,CAAI,CAAA,IAAA,MAAS,EAAE,IAAA,EAAK,CAAE;AAAA;AAChE,GACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA2CA,OAAO,WAAW,MAAA,EAAgB;AAChC,IAAA,MAAM,KAAA,GAAQ,IAAI,KAAA,EAAmB;AAErC,IAAA,IAAI,MAAA,CAAO,GAAA,CAAI,eAAe,CAAA,EAAG;AAC/B,MAAA,MAAM,cAAc,MAAA,CACjB,cAAA,CAAe,eAAe,CAAA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A,EAAS;AAAA,QAC5C,MAAA,EAAQ,IAAA;AAAA,QACR,GAAA,EAAK;AAAA,OACN,CAAA,EACD;AACA,QAAA;AAAA,MACF;AACA,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,OAAO,KAAA;AAAA,EACT;AAAA,EAEQ,WAAA,CAAY,QAAgB,QAAA,EAAwC;AAC1E,IAAA,IAAI,CAAC,QAAA,EAAU;AACb,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,KAAA,MAAW,WAAW,QAAA,EAAU;AAC9B,MAAA,IACE,MAAA,CAAO,MAAM,iBAAA,CAAkB,OAAO,MACtC,OAAA,CAAQ,IAAA,CAAK,iBAAA,CAAkB,OAAO,CAAA,EACtC;AACA,QAAA;AAAA,MACF;AAEA,MAAA,IAAI,OAAA,CAAQ,WAAW,CAAA,EAAG;AACxB,QAAA,IAAI,OAAO,MAAA,CAAO,IAAA,EAAM,IAAA,KAAS,QAAA,EAAU;AACzC,UAAA;AAAA,QACF;AACA,QAAA,IACE,OAAA,CAAQ,WAAW,CAAA,CAAE,iBAAA,CAAkB,OAAO,CAAA,KAC9C,MAAA,CAAO,IAAA,CAAK,IAAA,CAAK,iBAAA,CAAkB,OAAO,CAAA,EAC1C;AACA,UAAA;AAAA,QACF;AAAA,MACF;AAEA,MAAA,OAAO,IAAA;AAAA,IACT;AAEA,IAAA,OAAO,KAAA;AAAA,EACT;AACF;AAEA,SAAS,aAAA,CAAc,MAAc,MAAA,EAAwB;AAC3D,EAAA,IAAI,SAAS,MAAA,EAAQ;AACnB,IAAA,OAAO,MAAA;AAAA,EACT;AAEA,EAAA,OAAOC,qBAAA,CAAK,QAAQ,MAAM,CAAA;AAC5B;;;;"}
@@ -7,7 +7,7 @@ const spec = {
7
7
  info: {
8
8
  title: "catalog",
9
9
  version: "1",
10
- description: "The API surface consists of a few distinct groups of functionality. Each has a\ndedicated section below.\n\n> **Note:** This page only describes some of the most commonly used parts of the\n> API, and is a work in progress.\n\nAll of the URL paths in this article are assumed to be on top of some base URL\npointing at your catalog installation. For example, if the path given in a\nsection below is `/entities`, and the catalog is located at\n`http://localhost:7007/api/catalog` during local development, the full URL would\nbe `http://localhost:7007/api/catalog/entities`. The actual URL may vary from\none organization to the other, especially in production, but is commonly your\n`backend.baseUrl` in your app config, plus `/api/catalog` at the end.\n\nSome or all of the endpoints may accept or require an `Authorization` header\nwith a `Bearer` token, which should then be the Backstage token returned by the\n[`identity API`](https://backstage.io/docs/reference/core-plugin-api.identityapiref).\n",
10
+ description: "The API surface consists of a few distinct groups of functionality. Each has a\ndedicated section below.\n\n:::note Note \n This page only describes some of the most commonly used parts of the API, and is a work in progress.\n:::\n\nAll of the URL paths in this article are assumed to be on top of some base URL\npointing at your catalog installation. For example, if the path given in a\nsection below is `/entities`, and the catalog is located at\n`http://localhost:7007/api/catalog` during local development, the full URL would\nbe `http://localhost:7007/api/catalog/entities`. The actual URL may vary from\none organization to the other, especially in production, but is commonly your\n`backend.baseUrl` in your app config, plus `/api/catalog` at the end.\n\nSome or all of the endpoints may accept or require an `Authorization` header\nwith a `Bearer` token, which should then be the Backstage token returned by the\n[`identity API`](https://backstage.io/docs/reference/core-plugin-api.identityapiref).\n",
11
11
  license: {
12
12
  name: "Apache-2.0",
13
13
  url: "http://www.apache.org/licenses/LICENSE-2.0.html"
@@ -1 +1 @@
1
- {"version":3,"file":"router.cjs.js","sources":["../../../../src/schema/openapi/generated/router.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { createValidatedOpenApiRouterFromGeneratedEndpointMap } from '@backstage/backend-openapi-utils';\nimport { EndpointMap } from './apis';\n\nexport const spec = {\n openapi: '3.0.3',\n info: {\n title: 'catalog',\n version: '1',\n description:\n 'The API surface consists of a few distinct groups of functionality. Each has a\\ndedicated section below.\\n\\n> **Note:** This page only describes some of the most commonly used parts of the\\n> API, and is a work in progress.\\n\\nAll of the URL paths in this article are assumed to be on top of some base URL\\npointing at your catalog installation. For example, if the path given in a\\nsection below is `/entities`, and the catalog is located at\\n`http://localhost:7007/api/catalog` during local development, the full URL would\\nbe `http://localhost:7007/api/catalog/entities`. The actual URL may vary from\\none organization to the other, especially in production, but is commonly your\\n`backend.baseUrl` in your app config, plus `/api/catalog` at the end.\\n\\nSome or all of the endpoints may accept or require an `Authorization` header\\nwith a `Bearer` token, which should then be the Backstage token returned by the\\n[`identity API`](https://backstage.io/docs/reference/core-plugin-api.identityapiref).\\n',\n license: {\n name: 'Apache-2.0',\n url: 'http://www.apache.org/licenses/LICENSE-2.0.html',\n },\n contact: {},\n },\n servers: [\n {\n url: '/',\n },\n ],\n components: {\n examples: {},\n headers: {},\n parameters: {\n kind: {\n name: 'kind',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n namespace: {\n name: 'namespace',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n name: {\n name: 'name',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n uid: {\n name: 'uid',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n cursor: {\n name: 'cursor',\n in: 'query',\n description:\n 'You may pass the `cursor` query parameters to perform cursor based pagination\\nthrough the set of entities. The value of `cursor` will be returned in the response, under the `pageInfo` property:\\n\\n```json\\n \"pageInfo\": {\\n \"nextCursor\": \"a-cursor\",\\n \"prevCursor\": \"another-cursor\"\\n }\\n```\\n\\nIf `nextCursor` exists, it can be used to retrieve the next batch of entities. Following the same approach,\\nif `prevCursor` exists, it can be used to retrieve the previous batch of entities.\\n\\n- [`filter`](#filtering), for selecting only a subset of all entities\\n- [`fields`](#field-selection), for selecting only parts of the full data\\n structure of each entity\\n- `limit` for limiting the number of entities returned (20 is the default)\\n- [`orderField`](#ordering), for deciding the order of the entities\\n- `fullTextFilter`\\n **NOTE**: [`filter`, `orderField`, `fullTextFilter`] and `cursor` are mutually exclusive. This means that,\\n it isn\\'t possible to change any of [`filter`, `orderField`, `fullTextFilter`] when passing `cursor` as query parameters,\\n as changing any of these properties will affect pagination. If any of `filter`, `orderField`, `fullTextFilter` is specified together with `cursor`, only the latter is taken into consideration.\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n minLength: 1,\n },\n },\n after: {\n name: 'after',\n in: 'query',\n description: 'Pointer to the previous page of results.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n minLength: 1,\n },\n },\n fields: {\n name: 'fields',\n in: 'query',\n description:\n \"By default the full entities are returned, but you can pass in a `fields` query\\nparameter which selects what parts of the entity data to retain. This makes the\\nresponse smaller and faster to transfer, and may allow the catalog to perform\\nmore efficient queries.\\n\\nThe query parameter value is a comma separated list of simplified JSON paths\\nlike above. Each path corresponds to the key of either a value, or of a subtree\\nroot that you want to keep in the output. The rest is pruned away. For example,\\nspecifying `?fields=metadata.name,metadata.annotations,spec` retains only the\\n`name` and `annotations` fields of the `metadata` of each entity (it'll be an\\nobject with at most two keys), keeps the entire `spec` unchanged, and cuts out\\nall other roots such as `relations`.\\n\\nSome more real world usable examples:\\n\\n- Return only enough data to form the full ref of each entity:\\n\\n `/entities/by-query?fields=kind,metadata.namespace,metadata.name`\\n\",\n required: false,\n allowReserved: true,\n explode: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Get name and the entire relations collection': {\n value: ['metadata.name', 'relations'],\n },\n 'Get kind, name and namespace': {\n value: ['kind', 'metadata.name', 'metadata.namespace'],\n },\n },\n },\n filter: {\n name: 'filter',\n in: 'query',\n description:\n 'You can pass in one or more filter sets that get matched against each entity.\\nEach filter set is a number of conditions that all have to match for the\\ncondition to be true (conditions effectively have an AND between them). At least\\none filter set has to be true for the entity to be part of the result set\\n(filter sets effectively have an OR between them).\\n\\nExample:\\n\\n```text\\n/entities/by-query?filter=kind=user,metadata.namespace=default&filter=kind=group,spec.type\\n\\n Return entities that match\\n\\n Filter set 1:\\n Condition 1: kind = user\\n AND\\n Condition 2: metadata.namespace = default\\n\\n OR\\n\\n Filter set 2:\\n Condition 1: kind = group\\n AND\\n Condition 2: spec.type exists\\n```\\n\\nEach condition is either on the form `<key>`, or on the form `<key>=<value>`.\\nThe first form asserts on the existence of a certain key (with any value), and\\nthe second asserts that the key exists and has a certain value. All checks are\\nalways case _insensitive_.\\n\\nIn all cases, the key is a simplified JSON path in a given piece of entity data.\\nEach part of the path is a key of an object, and the traversal also descends\\nthrough arrays. There are two special forms:\\n\\n- Array items that are simple value types (such as strings) match on a key-value\\n pair where the key is the item as a string, and the value is the string `true`\\n- Relations can be matched on a `relations.<type>=<targetRef>` form\\n\\nLet\\'s look at a simplified example to illustrate the concept:\\n\\n```json\\n{\\n \"a\": {\\n \"b\": [\"c\", { \"d\": 1 }],\\n \"e\": 7\\n }\\n}\\n```\\n\\nThis would match any one of the following conditions:\\n\\n- `a`\\n- `a.b`\\n- `a.b.c`\\n- `a.b.c=true`\\n- `a.b.d`\\n- `a.b.d=1`\\n- `a.e`\\n- `a.e=7`\\n\\nSome more real world usable examples:\\n\\n- Return all orphaned entities:\\n\\n `/entities/by-query?filter=metadata.annotations.backstage.io/orphan=true`\\n\\n- Return all users and groups:\\n\\n `/entities/by-query?filter=kind=user&filter=kind=group`\\n\\n- Return all service components:\\n\\n `/entities/by-query?filter=kind=component,spec.type=service`\\n\\n- Return all entities with the `java` tag:\\n\\n `/entities/by-query?filter=metadata.tags.java`\\n\\n- Return all users who are members of the `ops` group (note that the full\\n [reference](references.md) of the group is used):\\n\\n `/entities/by-query?filter=kind=user,relations.memberof=group:default/ops`\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Get groups': {\n value: ['kind=group'],\n },\n 'Get orphaned components': {\n value: [\n 'kind=component,metadata.annotations.backstage.io/orphan=true',\n ],\n },\n },\n },\n offset: {\n name: 'offset',\n in: 'query',\n description: 'Number of records to skip in the query page.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n limit: {\n name: 'limit',\n in: 'query',\n description: 'Number of records to return in the response.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n orderField: {\n name: 'orderField',\n in: 'query',\n description:\n 'By default the entities are returned ordered by their internal uid. You can\\ncustomize the `orderField` query parameters to affect that ordering.\\n\\nFor example, to return entities by their name:\\n\\n`/entities/by-query?orderField=metadata.name,asc`\\n\\nEach parameter can be followed by `asc` for ascending lexicographical order or\\n`desc` for descending (reverse) lexicographical order.\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n description: 'A two-item tuple of [field, order].',\n },\n },\n explode: true,\n style: 'form',\n examples: {\n 'Order ascending by name': {\n value: ['metadata.name,asc'],\n },\n 'Order descending by owner': {\n value: ['spec.owner,desc'],\n },\n },\n },\n },\n requestBodies: {},\n responses: {\n ErrorResponse: {\n description: 'An error response from the backend.',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Error',\n },\n },\n },\n },\n },\n schemas: {\n Error: {\n type: 'object',\n properties: {\n error: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n stack: {\n type: 'string',\n },\n code: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n },\n request: {\n type: 'object',\n properties: {\n method: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n },\n required: ['method', 'url'],\n },\n response: {\n type: 'object',\n properties: {\n statusCode: {\n type: 'number',\n },\n },\n required: ['statusCode'],\n },\n },\n required: ['error', 'response'],\n additionalProperties: {},\n },\n JsonObject: {\n type: 'object',\n properties: {},\n description: 'A type representing all allowed JSON object values.',\n additionalProperties: {},\n },\n MapStringString: {\n type: 'object',\n properties: {},\n additionalProperties: {\n type: 'string',\n },\n description: 'Construct a type with a set of properties K of type T',\n },\n EntityLink: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n description:\n 'An optional value to categorize links into specific groups',\n },\n icon: {\n type: 'string',\n description:\n 'An optional semantic key that represents a visual icon.',\n },\n title: {\n type: 'string',\n description: 'An optional descriptive title for the link.',\n },\n url: {\n type: 'string',\n description: 'The url to the external site, document, etc.',\n },\n },\n required: ['url'],\n description:\n 'A link to external information that is related to the entity.',\n additionalProperties: false,\n },\n EntityMeta: {\n type: 'object',\n properties: {\n links: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityLink',\n },\n description: 'A list of external hyperlinks related to the entity.',\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'A list of single-valued strings, to for example classify catalog entities in\\nvarious ways.',\n },\n annotations: {\n $ref: '#/components/schemas/MapStringString',\n },\n labels: {\n $ref: '#/components/schemas/MapStringString',\n },\n description: {\n type: 'string',\n description:\n 'A short (typically relatively few words, on one line) description of the\\nentity.',\n },\n title: {\n type: 'string',\n description:\n 'A display name of the entity, to be presented in user interfaces instead\\nof the `name` property above, when available.\\nThis field is sometimes useful when the `name` is cumbersome or ends up\\nbeing perceived as overly technical. The title generally does not have\\nas stringent format requirements on it, so it may contain special\\ncharacters and be more explanatory. Do keep it very short though, and\\navoid situations where a title can be confused with the name of another\\nentity, or where two entities share a title.\\nNote that this is only for display purposes, and may be ignored by some\\nparts of the code. Entity references still always make use of the `name`\\nproperty, not the title.',\n },\n namespace: {\n type: 'string',\n description: 'The namespace that the entity belongs to.',\n },\n name: {\n type: 'string',\n description:\n 'The name of the entity.\\nMust be unique within the catalog at any given point in time, for any\\ngiven namespace + kind pair. This value is part of the technical\\nidentifier of the entity, and as such it will appear in URLs, database\\ntables, entity references, and similar. It is subject to restrictions\\nregarding what characters are allowed.\\nIf you want to use a different, more human readable string with fewer\\nrestrictions on it in user interfaces, see the `title` field below.',\n },\n etag: {\n type: 'string',\n description:\n 'An opaque string that changes for each update operation to any part of\\nthe entity, including metadata.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, and the server will then reject the\\noperation if it does not match the current stored value.',\n },\n uid: {\n type: 'string',\n description:\n 'A globally unique ID for the entity.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, but the server is free to reject requests\\nthat do so in such a way that it breaks semantics.',\n },\n },\n required: ['name'],\n description: 'Metadata fields common to all versions/kinds of entity.',\n additionalProperties: {},\n },\n EntityRelation: {\n type: 'object',\n properties: {\n targetRef: {\n type: 'string',\n description: 'The entity ref of the target of this relation.',\n },\n type: {\n type: 'string',\n description: 'The type of the relation.',\n },\n },\n required: ['targetRef', 'type'],\n description:\n 'A relation of a specific type to another entity in the catalog.',\n additionalProperties: false,\n },\n Entity: {\n type: 'object',\n properties: {\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n metadata: {\n $ref: '#/components/schemas/EntityMeta',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n },\n required: ['metadata', 'kind', 'apiVersion'],\n description:\n \"The parts of the format that's common to all versions/kinds of entity.\",\n },\n NullableEntity: {\n type: 'object',\n properties: {\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n metadata: {\n $ref: '#/components/schemas/EntityMeta',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n },\n required: ['metadata', 'kind', 'apiVersion'],\n description:\n \"The parts of the format that's common to all versions/kinds of entity.\",\n nullable: true,\n },\n EntityAncestryResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n parentEntityRefs: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n entity: {\n $ref: '#/components/schemas/Entity',\n },\n },\n required: ['parentEntityRefs', 'entity'],\n },\n },\n rootEntityRef: {\n type: 'string',\n },\n },\n required: ['items', 'rootEntityRef'],\n additionalProperties: false,\n },\n EntitiesBatchResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/NullableEntity',\n },\n description:\n 'The list of entities, in the same order as the refs in the request. Entries\\nthat are null signify that no entity existed with that ref.',\n },\n },\n required: ['items'],\n additionalProperties: false,\n },\n EntityFacet: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n },\n count: {\n type: 'number',\n },\n },\n required: ['value', 'count'],\n additionalProperties: false,\n },\n EntityFacetsResponse: {\n type: 'object',\n properties: {\n facets: {\n type: 'object',\n additionalProperties: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityFacet',\n },\n },\n },\n },\n required: ['facets'],\n additionalProperties: false,\n },\n Location: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n },\n required: ['target', 'type', 'id'],\n description: 'Entity location for a specific entity.',\n additionalProperties: false,\n },\n LocationSpec: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n },\n required: ['target', 'type'],\n description: 'Holds the entity location information.',\n additionalProperties: false,\n },\n AnalyzeLocationExistingEntity: {\n type: 'object',\n properties: {\n entity: {\n $ref: '#/components/schemas/Entity',\n },\n isRegistered: {\n type: 'boolean',\n },\n location: {\n $ref: '#/components/schemas/LocationSpec',\n },\n },\n required: ['entity', 'isRegistered', 'location'],\n description:\n \"If the folder pointed to already contained catalog info yaml files, they are\\nread and emitted like this so that the frontend can inform the user that it\\nlocated them and can make sure to register them as well if they weren't\\nalready\",\n additionalProperties: false,\n },\n RecursivePartialEntityRelation: {\n type: 'object',\n properties: {\n targetRef: {\n type: 'string',\n description: 'The entity ref of the target of this relation.',\n },\n type: {\n type: 'string',\n description: 'The type of the relation.',\n },\n },\n description:\n 'A relation of a specific type to another entity in the catalog.',\n additionalProperties: false,\n },\n RecursivePartialEntityMeta: {\n allOf: [\n {\n $ref: '#/components/schemas/JsonObject',\n },\n {\n type: 'object',\n properties: {\n links: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityLink',\n },\n description:\n 'A list of external hyperlinks related to the entity.',\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'A list of single-valued strings, to for example classify catalog entities in\\nvarious ways.',\n },\n annotations: {\n $ref: '#/components/schemas/MapStringString',\n },\n labels: {\n $ref: '#/components/schemas/MapStringString',\n },\n description: {\n type: 'string',\n description:\n 'A short (typically relatively few words, on one line) description of the\\nentity.',\n },\n title: {\n type: 'string',\n description:\n 'A display name of the entity, to be presented in user interfaces instead\\nof the `name` property above, when available.\\nThis field is sometimes useful when the `name` is cumbersome or ends up\\nbeing perceived as overly technical. The title generally does not have\\nas stringent format requirements on it, so it may contain special\\ncharacters and be more explanatory. Do keep it very short though, and\\navoid situations where a title can be confused with the name of another\\nentity, or where two entities share a title.\\nNote that this is only for display purposes, and may be ignored by some\\nparts of the code. Entity references still always make use of the `name`\\nproperty, not the title.',\n },\n namespace: {\n type: 'string',\n description: 'The namespace that the entity belongs to.',\n },\n name: {\n type: 'string',\n description:\n 'The name of the entity.\\nMust be unique within the catalog at any given point in time, for any\\ngiven namespace + kind pair. This value is part of the technical\\nidentifier of the entity, and as such it will appear in URLs, database\\ntables, entity references, and similar. It is subject to restrictions\\nregarding what characters are allowed.\\nIf you want to use a different, more human readable string with fewer\\nrestrictions on it in user interfaces, see the `title` field below.',\n },\n etag: {\n type: 'string',\n description:\n 'An opaque string that changes for each update operation to any part of\\nthe entity, including metadata.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, and the server will then reject the\\noperation if it does not match the current stored value.',\n },\n uid: {\n type: 'string',\n description:\n 'A globally unique ID for the entity.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, but the server is free to reject requests\\nthat do so in such a way that it breaks semantics.',\n },\n },\n description:\n 'Metadata fields common to all versions/kinds of entity.',\n },\n ],\n additionalProperties: false,\n },\n RecursivePartialEntity: {\n type: 'object',\n properties: {\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n metadata: {\n $ref: '#/components/schemas/RecursivePartialEntityMeta',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/RecursivePartialEntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n },\n description: 'Makes all keys of an entire hierarchy optional.',\n additionalProperties: false,\n },\n AnalyzeLocationEntityField: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n description:\n 'A text to show to the user to inform about the choices made. Like, it could say\\n\"Found a CODEOWNERS file that covers this target, so we suggest leaving this\\nfield empty; which would currently make it owned by X\" where X is taken from the\\ncodeowners file.',\n },\n value: {\n type: 'string',\n nullable: true,\n },\n state: {\n type: 'string',\n enum: [\n 'analysisSuggestedValue',\n 'analysisSuggestedNoValue',\n 'needsUserInput',\n ],\n description:\n 'The outcome of the analysis for this particular field',\n },\n field: {\n type: 'string',\n description:\n 'e.g. \"spec.owner\"? The frontend needs to know how to \"inject\" the field into the\\nentity again if the user wants to change it',\n },\n },\n required: ['description', 'value', 'state', 'field'],\n additionalProperties: false,\n },\n AnalyzeLocationGenerateEntity: {\n type: 'object',\n properties: {\n fields: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/AnalyzeLocationEntityField',\n },\n },\n entity: {\n $ref: '#/components/schemas/RecursivePartialEntity',\n },\n },\n required: ['fields', 'entity'],\n description:\n \"This is some form of representation of what the analyzer could deduce.\\nWe should probably have a chat about how this can best be conveyed to\\nthe frontend. It'll probably contain a (possibly incomplete) entity, plus\\nenough info for the frontend to know what form data to show to the user\\nfor overriding/completing the info.\",\n additionalProperties: false,\n },\n AnalyzeLocationResponse: {\n type: 'object',\n properties: {\n generateEntities: {\n items: {\n $ref: '#/components/schemas/AnalyzeLocationGenerateEntity',\n },\n type: 'array',\n },\n existingEntityFiles: {\n items: {\n $ref: '#/components/schemas/AnalyzeLocationExistingEntity',\n },\n type: 'array',\n },\n },\n required: ['generateEntities', 'existingEntityFiles'],\n additionalProperties: false,\n },\n LocationInput: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n },\n target: {\n type: 'string',\n },\n },\n required: ['type', 'target'],\n additionalProperties: false,\n },\n EntitiesQueryResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Entity',\n },\n description: 'The list of entities paginated by a specific filter.',\n },\n totalItems: {\n type: 'number',\n },\n pageInfo: {\n type: 'object',\n properties: {\n nextCursor: {\n type: 'string',\n description: 'The cursor for the next batch of entities.',\n },\n prevCursor: {\n type: 'string',\n description: 'The cursor for the previous batch of entities.',\n },\n },\n },\n },\n required: ['items', 'totalItems', 'pageInfo'],\n additionalProperties: false,\n },\n },\n securitySchemes: {\n JWT: {\n type: 'http',\n scheme: 'bearer',\n bearerFormat: 'JWT',\n },\n },\n },\n paths: {\n '/refresh': {\n post: {\n operationId: 'RefreshEntity',\n tags: ['Entity'],\n description: 'Refresh the entity related to entityRef.',\n responses: {\n '200': {\n description: 'Refreshed',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n authorizationToken: {\n type: 'string',\n },\n entityRef: {\n type: 'string',\n description:\n 'The reference to a single entity that should be refreshed',\n },\n },\n required: ['entityRef'],\n description:\n 'Options for requesting a refresh of entities in the catalog.',\n additionalProperties: false,\n },\n },\n },\n },\n },\n },\n '/entities': {\n get: {\n operationId: 'GetEntities',\n tags: ['Entity'],\n description: 'Get all entities matching a given filter.',\n responses: {\n '200': {\n description: '',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/fields',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/filter',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/after',\n },\n {\n name: 'order',\n in: 'query',\n allowReserved: true,\n required: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n ],\n },\n },\n '/entities/by-uid/{uid}': {\n get: {\n operationId: 'GetEntityByUid',\n tags: ['Entity'],\n description: 'Get a single entity by the UID.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/uid',\n },\n ],\n },\n delete: {\n operationId: 'DeleteEntityByUid',\n tags: ['Entity'],\n description: 'Delete a single entity by UID.',\n responses: {\n '204': {\n description: 'Deleted successfully.',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/uid',\n },\n ],\n },\n },\n '/entities/by-name/{kind}/{namespace}/{name}': {\n get: {\n operationId: 'GetEntityByName',\n tags: ['Entity'],\n description: 'Get an entity by an entity ref.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/entities/by-name/{kind}/{namespace}/{name}/ancestry': {\n get: {\n operationId: 'GetEntityAncestryByName',\n tags: ['Entity'],\n description: \"Get an entity's ancestry by entity ref.\",\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntityAncestryResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/entities/by-refs': {\n post: {\n operationId: 'GetEntitiesByRefs',\n tags: ['Entity'],\n description:\n 'Get a batch set of entities given an array of entityRefs.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntitiesBatchResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n requestBody: {\n required: false,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n required: ['entityRefs'],\n properties: {\n entityRefs: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n fields: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n },\n examples: {\n 'Fetch Backstage entities': {\n value: {\n entityRefs: [\n 'component:default/backstage',\n 'api:default/backstage',\n ],\n },\n },\n 'Fetch annotations for backstage entity': {\n value: {\n entityRefs: ['component:default/backstage'],\n fields: ['metadata.annotations'],\n },\n },\n },\n },\n },\n },\n parameters: [\n {\n $ref: '#/components/parameters/filter',\n },\n ],\n },\n },\n '/entities/by-query': {\n get: {\n operationId: 'GetEntitiesByQuery',\n tags: ['Entity'],\n description: 'Search for entities by a given query.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntitiesQueryResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/fields',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/orderField',\n },\n {\n $ref: '#/components/parameters/cursor',\n },\n {\n $ref: '#/components/parameters/filter',\n },\n {\n name: 'fullTextFilterTerm',\n in: 'query',\n description: 'Text search term.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n name: 'fullTextFilterFields',\n in: 'query',\n description:\n 'A comma separated list of fields to sort returned results by.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n explode: false,\n style: 'form',\n },\n ],\n },\n },\n '/entity-facets': {\n get: {\n operationId: 'GetEntityFacets',\n tags: ['Entity'],\n description: 'Get all entity facets that match the given filters.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntityFacetsResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'query',\n name: 'facet',\n required: true,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Entities by kind': {\n value: ['kind'],\n },\n 'Entities by spec type': {\n value: ['spec.type'],\n },\n },\n },\n {\n $ref: '#/components/parameters/filter',\n },\n ],\n },\n },\n '/locations': {\n post: {\n operationId: 'CreateLocation',\n tags: ['Locations'],\n description: 'Create a location for a given target.',\n responses: {\n '201': {\n description: 'Created',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n exists: {\n type: 'boolean',\n },\n entities: {\n items: {\n $ref: '#/components/schemas/Entity',\n },\n type: 'array',\n },\n location: {\n $ref: '#/components/schemas/Location',\n },\n },\n required: ['entities', 'location'],\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'query',\n name: 'dryRun',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n },\n required: ['target', 'type'],\n },\n },\n },\n },\n },\n get: {\n operationId: 'GetLocations',\n tags: ['Locations'],\n description: 'Get all locations',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n data: {\n $ref: '#/components/schemas/Location',\n },\n },\n required: ['data'],\n },\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n },\n },\n '/locations/{id}': {\n get: {\n operationId: 'GetLocation',\n tags: ['Locations'],\n description: 'Get a location by id.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Location',\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'id',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n delete: {\n operationId: 'DeleteLocation',\n tags: ['Locations'],\n description: 'Delete a location by id.',\n responses: {\n '204': {\n description: 'No content',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'id',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/locations/by-entity/{kind}/{namespace}/{name}': {\n get: {\n operationId: 'getLocationByEntity',\n tags: ['Locations'],\n description: 'Get a location for entity.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Location',\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'kind',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'namespace',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'name',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/analyze-location': {\n post: {\n operationId: 'AnalyzeLocation',\n tags: ['Locations'],\n description: 'Validate a given location.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/AnalyzeLocationResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n catalogFileName: {\n type: 'string',\n },\n location: {\n $ref: '#/components/schemas/LocationInput',\n },\n },\n required: ['location'],\n },\n },\n },\n },\n },\n },\n '/validate-entity': {\n post: {\n operationId: 'ValidateEntity',\n tags: ['Entity'],\n description:\n 'Validate that a passed in entity has no errors in schema.',\n responses: {\n '200': {\n description: 'Ok',\n },\n '400': {\n description: 'Validation errors.',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n errors: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n additionalProperties: {},\n },\n },\n },\n required: ['errors'],\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n location: {\n type: 'string',\n },\n entity: {\n type: 'object',\n additionalProperties: {},\n },\n },\n required: ['location', 'entity'],\n },\n },\n },\n },\n },\n },\n },\n} as const;\nexport const createOpenApiRouter = async (\n options?: Parameters<\n typeof createValidatedOpenApiRouterFromGeneratedEndpointMap\n >['1'],\n) =>\n createValidatedOpenApiRouterFromGeneratedEndpointMap<EndpointMap>(\n spec,\n options,\n );\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BACF;AAAA,kBACA,QAAA,EAAU,CAAC,QAAQ;AAAA;AACrB;AACF;AACF;AACF,SACF;AAAA,QACA,QAAA,EAAU;AAAA,UACR,EAAC;AAAA,UACD;AAAA,YACE,KAAK;AAAC;AACR,SACF;AAAA,QACA,YAAY,EAAC;AAAA,QACb,WAAA,EAAa;AAAA,UACX,QAAA,EAAU,IAAA;AAAA,UACV,OAAA,EAAS;AAAA,YACP,kBAAA,EAAoB;AAAA,cAClB,MAAA,EAAQ;AAAA,gBACN,IAAA,EAAM,QAAA;AAAA,gBACN,UAAA,EAAY;AAAA,kBACV,QAAA,EAAU;AAAA,oBACR,IAAA,EAAM;AAAA,mBACR;AAAA,kBACA,MAAA,EAAQ;AAAA,oBACN,IAAA,EAAM,QAAA;AAAA,oBACN,sBAAsB;AAAC;AACzB,iBACF;AAAA,gBACA,QAAA,EAAU,CAAC,UAAA,EAAY,QAAQ;AAAA;AACjC;AACF;AACF;AACF;AACF;AACF;AAEJ;AACO,MAAM,mBAAA,GAAsB,OACjC,OAAA,KAIAA,wEAAA;AAAA,EACE,IAAA;AAAA,EACA;AACF;;;;;"}
1
+ {"version":3,"file":"router.cjs.js","sources":["../../../../src/schema/openapi/generated/router.ts"],"sourcesContent":["/*\n * Copyright 2025 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// ******************************************************************\n// * THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. *\n// ******************************************************************\nimport { createValidatedOpenApiRouterFromGeneratedEndpointMap } from '@backstage/backend-openapi-utils';\nimport { EndpointMap } from './apis';\n\nexport const spec = {\n openapi: '3.0.3',\n info: {\n title: 'catalog',\n version: '1',\n description:\n 'The API surface consists of a few distinct groups of functionality. Each has a\\ndedicated section below.\\n\\n:::note Note \\n This page only describes some of the most commonly used parts of the API, and is a work in progress.\\n:::\\n\\nAll of the URL paths in this article are assumed to be on top of some base URL\\npointing at your catalog installation. For example, if the path given in a\\nsection below is `/entities`, and the catalog is located at\\n`http://localhost:7007/api/catalog` during local development, the full URL would\\nbe `http://localhost:7007/api/catalog/entities`. The actual URL may vary from\\none organization to the other, especially in production, but is commonly your\\n`backend.baseUrl` in your app config, plus `/api/catalog` at the end.\\n\\nSome or all of the endpoints may accept or require an `Authorization` header\\nwith a `Bearer` token, which should then be the Backstage token returned by the\\n[`identity API`](https://backstage.io/docs/reference/core-plugin-api.identityapiref).\\n',\n license: {\n name: 'Apache-2.0',\n url: 'http://www.apache.org/licenses/LICENSE-2.0.html',\n },\n contact: {},\n },\n servers: [\n {\n url: '/',\n },\n ],\n components: {\n examples: {},\n headers: {},\n parameters: {\n kind: {\n name: 'kind',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n namespace: {\n name: 'namespace',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n name: {\n name: 'name',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n uid: {\n name: 'uid',\n in: 'path',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n cursor: {\n name: 'cursor',\n in: 'query',\n description:\n 'You may pass the `cursor` query parameters to perform cursor based pagination\\nthrough the set of entities. The value of `cursor` will be returned in the response, under the `pageInfo` property:\\n\\n```json\\n \"pageInfo\": {\\n \"nextCursor\": \"a-cursor\",\\n \"prevCursor\": \"another-cursor\"\\n }\\n```\\n\\nIf `nextCursor` exists, it can be used to retrieve the next batch of entities. Following the same approach,\\nif `prevCursor` exists, it can be used to retrieve the previous batch of entities.\\n\\n- [`filter`](#filtering), for selecting only a subset of all entities\\n- [`fields`](#field-selection), for selecting only parts of the full data\\n structure of each entity\\n- `limit` for limiting the number of entities returned (20 is the default)\\n- [`orderField`](#ordering), for deciding the order of the entities\\n- `fullTextFilter`\\n **NOTE**: [`filter`, `orderField`, `fullTextFilter`] and `cursor` are mutually exclusive. This means that,\\n it isn\\'t possible to change any of [`filter`, `orderField`, `fullTextFilter`] when passing `cursor` as query parameters,\\n as changing any of these properties will affect pagination. If any of `filter`, `orderField`, `fullTextFilter` is specified together with `cursor`, only the latter is taken into consideration.\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n minLength: 1,\n },\n },\n after: {\n name: 'after',\n in: 'query',\n description: 'Pointer to the previous page of results.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n minLength: 1,\n },\n },\n fields: {\n name: 'fields',\n in: 'query',\n description:\n \"By default the full entities are returned, but you can pass in a `fields` query\\nparameter which selects what parts of the entity data to retain. This makes the\\nresponse smaller and faster to transfer, and may allow the catalog to perform\\nmore efficient queries.\\n\\nThe query parameter value is a comma separated list of simplified JSON paths\\nlike above. Each path corresponds to the key of either a value, or of a subtree\\nroot that you want to keep in the output. The rest is pruned away. For example,\\nspecifying `?fields=metadata.name,metadata.annotations,spec` retains only the\\n`name` and `annotations` fields of the `metadata` of each entity (it'll be an\\nobject with at most two keys), keeps the entire `spec` unchanged, and cuts out\\nall other roots such as `relations`.\\n\\nSome more real world usable examples:\\n\\n- Return only enough data to form the full ref of each entity:\\n\\n `/entities/by-query?fields=kind,metadata.namespace,metadata.name`\\n\",\n required: false,\n allowReserved: true,\n explode: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Get name and the entire relations collection': {\n value: ['metadata.name', 'relations'],\n },\n 'Get kind, name and namespace': {\n value: ['kind', 'metadata.name', 'metadata.namespace'],\n },\n },\n },\n filter: {\n name: 'filter',\n in: 'query',\n description:\n 'You can pass in one or more filter sets that get matched against each entity.\\nEach filter set is a number of conditions that all have to match for the\\ncondition to be true (conditions effectively have an AND between them). At least\\none filter set has to be true for the entity to be part of the result set\\n(filter sets effectively have an OR between them).\\n\\nExample:\\n\\n```text\\n/entities/by-query?filter=kind=user,metadata.namespace=default&filter=kind=group,spec.type\\n\\n Return entities that match\\n\\n Filter set 1:\\n Condition 1: kind = user\\n AND\\n Condition 2: metadata.namespace = default\\n\\n OR\\n\\n Filter set 2:\\n Condition 1: kind = group\\n AND\\n Condition 2: spec.type exists\\n```\\n\\nEach condition is either on the form `<key>`, or on the form `<key>=<value>`.\\nThe first form asserts on the existence of a certain key (with any value), and\\nthe second asserts that the key exists and has a certain value. All checks are\\nalways case _insensitive_.\\n\\nIn all cases, the key is a simplified JSON path in a given piece of entity data.\\nEach part of the path is a key of an object, and the traversal also descends\\nthrough arrays. There are two special forms:\\n\\n- Array items that are simple value types (such as strings) match on a key-value\\n pair where the key is the item as a string, and the value is the string `true`\\n- Relations can be matched on a `relations.<type>=<targetRef>` form\\n\\nLet\\'s look at a simplified example to illustrate the concept:\\n\\n```json\\n{\\n \"a\": {\\n \"b\": [\"c\", { \"d\": 1 }],\\n \"e\": 7\\n }\\n}\\n```\\n\\nThis would match any one of the following conditions:\\n\\n- `a`\\n- `a.b`\\n- `a.b.c`\\n- `a.b.c=true`\\n- `a.b.d`\\n- `a.b.d=1`\\n- `a.e`\\n- `a.e=7`\\n\\nSome more real world usable examples:\\n\\n- Return all orphaned entities:\\n\\n `/entities/by-query?filter=metadata.annotations.backstage.io/orphan=true`\\n\\n- Return all users and groups:\\n\\n `/entities/by-query?filter=kind=user&filter=kind=group`\\n\\n- Return all service components:\\n\\n `/entities/by-query?filter=kind=component,spec.type=service`\\n\\n- Return all entities with the `java` tag:\\n\\n `/entities/by-query?filter=metadata.tags.java`\\n\\n- Return all users who are members of the `ops` group (note that the full\\n [reference](references.md) of the group is used):\\n\\n `/entities/by-query?filter=kind=user,relations.memberof=group:default/ops`\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Get groups': {\n value: ['kind=group'],\n },\n 'Get orphaned components': {\n value: [\n 'kind=component,metadata.annotations.backstage.io/orphan=true',\n ],\n },\n },\n },\n offset: {\n name: 'offset',\n in: 'query',\n description: 'Number of records to skip in the query page.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n limit: {\n name: 'limit',\n in: 'query',\n description: 'Number of records to return in the response.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'integer',\n minimum: 0,\n },\n },\n orderField: {\n name: 'orderField',\n in: 'query',\n description:\n 'By default the entities are returned ordered by their internal uid. You can\\ncustomize the `orderField` query parameters to affect that ordering.\\n\\nFor example, to return entities by their name:\\n\\n`/entities/by-query?orderField=metadata.name,asc`\\n\\nEach parameter can be followed by `asc` for ascending lexicographical order or\\n`desc` for descending (reverse) lexicographical order.\\n',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n description: 'A two-item tuple of [field, order].',\n },\n },\n explode: true,\n style: 'form',\n examples: {\n 'Order ascending by name': {\n value: ['metadata.name,asc'],\n },\n 'Order descending by owner': {\n value: ['spec.owner,desc'],\n },\n },\n },\n },\n requestBodies: {},\n responses: {\n ErrorResponse: {\n description: 'An error response from the backend.',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Error',\n },\n },\n },\n },\n },\n schemas: {\n Error: {\n type: 'object',\n properties: {\n error: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n stack: {\n type: 'string',\n },\n code: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n },\n request: {\n type: 'object',\n properties: {\n method: {\n type: 'string',\n },\n url: {\n type: 'string',\n },\n },\n required: ['method', 'url'],\n },\n response: {\n type: 'object',\n properties: {\n statusCode: {\n type: 'number',\n },\n },\n required: ['statusCode'],\n },\n },\n required: ['error', 'response'],\n additionalProperties: {},\n },\n JsonObject: {\n type: 'object',\n properties: {},\n description: 'A type representing all allowed JSON object values.',\n additionalProperties: {},\n },\n MapStringString: {\n type: 'object',\n properties: {},\n additionalProperties: {\n type: 'string',\n },\n description: 'Construct a type with a set of properties K of type T',\n },\n EntityLink: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n description:\n 'An optional value to categorize links into specific groups',\n },\n icon: {\n type: 'string',\n description:\n 'An optional semantic key that represents a visual icon.',\n },\n title: {\n type: 'string',\n description: 'An optional descriptive title for the link.',\n },\n url: {\n type: 'string',\n description: 'The url to the external site, document, etc.',\n },\n },\n required: ['url'],\n description:\n 'A link to external information that is related to the entity.',\n additionalProperties: false,\n },\n EntityMeta: {\n type: 'object',\n properties: {\n links: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityLink',\n },\n description: 'A list of external hyperlinks related to the entity.',\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'A list of single-valued strings, to for example classify catalog entities in\\nvarious ways.',\n },\n annotations: {\n $ref: '#/components/schemas/MapStringString',\n },\n labels: {\n $ref: '#/components/schemas/MapStringString',\n },\n description: {\n type: 'string',\n description:\n 'A short (typically relatively few words, on one line) description of the\\nentity.',\n },\n title: {\n type: 'string',\n description:\n 'A display name of the entity, to be presented in user interfaces instead\\nof the `name` property above, when available.\\nThis field is sometimes useful when the `name` is cumbersome or ends up\\nbeing perceived as overly technical. The title generally does not have\\nas stringent format requirements on it, so it may contain special\\ncharacters and be more explanatory. Do keep it very short though, and\\navoid situations where a title can be confused with the name of another\\nentity, or where two entities share a title.\\nNote that this is only for display purposes, and may be ignored by some\\nparts of the code. Entity references still always make use of the `name`\\nproperty, not the title.',\n },\n namespace: {\n type: 'string',\n description: 'The namespace that the entity belongs to.',\n },\n name: {\n type: 'string',\n description:\n 'The name of the entity.\\nMust be unique within the catalog at any given point in time, for any\\ngiven namespace + kind pair. This value is part of the technical\\nidentifier of the entity, and as such it will appear in URLs, database\\ntables, entity references, and similar. It is subject to restrictions\\nregarding what characters are allowed.\\nIf you want to use a different, more human readable string with fewer\\nrestrictions on it in user interfaces, see the `title` field below.',\n },\n etag: {\n type: 'string',\n description:\n 'An opaque string that changes for each update operation to any part of\\nthe entity, including metadata.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, and the server will then reject the\\noperation if it does not match the current stored value.',\n },\n uid: {\n type: 'string',\n description:\n 'A globally unique ID for the entity.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, but the server is free to reject requests\\nthat do so in such a way that it breaks semantics.',\n },\n },\n required: ['name'],\n description: 'Metadata fields common to all versions/kinds of entity.',\n additionalProperties: {},\n },\n EntityRelation: {\n type: 'object',\n properties: {\n targetRef: {\n type: 'string',\n description: 'The entity ref of the target of this relation.',\n },\n type: {\n type: 'string',\n description: 'The type of the relation.',\n },\n },\n required: ['targetRef', 'type'],\n description:\n 'A relation of a specific type to another entity in the catalog.',\n additionalProperties: false,\n },\n Entity: {\n type: 'object',\n properties: {\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n metadata: {\n $ref: '#/components/schemas/EntityMeta',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n },\n required: ['metadata', 'kind', 'apiVersion'],\n description:\n \"The parts of the format that's common to all versions/kinds of entity.\",\n },\n NullableEntity: {\n type: 'object',\n properties: {\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n metadata: {\n $ref: '#/components/schemas/EntityMeta',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n },\n required: ['metadata', 'kind', 'apiVersion'],\n description:\n \"The parts of the format that's common to all versions/kinds of entity.\",\n nullable: true,\n },\n EntityAncestryResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n parentEntityRefs: {\n items: {\n type: 'string',\n },\n type: 'array',\n },\n entity: {\n $ref: '#/components/schemas/Entity',\n },\n },\n required: ['parentEntityRefs', 'entity'],\n },\n },\n rootEntityRef: {\n type: 'string',\n },\n },\n required: ['items', 'rootEntityRef'],\n additionalProperties: false,\n },\n EntitiesBatchResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/NullableEntity',\n },\n description:\n 'The list of entities, in the same order as the refs in the request. Entries\\nthat are null signify that no entity existed with that ref.',\n },\n },\n required: ['items'],\n additionalProperties: false,\n },\n EntityFacet: {\n type: 'object',\n properties: {\n value: {\n type: 'string',\n },\n count: {\n type: 'number',\n },\n },\n required: ['value', 'count'],\n additionalProperties: false,\n },\n EntityFacetsResponse: {\n type: 'object',\n properties: {\n facets: {\n type: 'object',\n additionalProperties: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityFacet',\n },\n },\n },\n },\n required: ['facets'],\n additionalProperties: false,\n },\n Location: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n id: {\n type: 'string',\n },\n },\n required: ['target', 'type', 'id'],\n description: 'Entity location for a specific entity.',\n additionalProperties: false,\n },\n LocationSpec: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n },\n required: ['target', 'type'],\n description: 'Holds the entity location information.',\n additionalProperties: false,\n },\n AnalyzeLocationExistingEntity: {\n type: 'object',\n properties: {\n entity: {\n $ref: '#/components/schemas/Entity',\n },\n isRegistered: {\n type: 'boolean',\n },\n location: {\n $ref: '#/components/schemas/LocationSpec',\n },\n },\n required: ['entity', 'isRegistered', 'location'],\n description:\n \"If the folder pointed to already contained catalog info yaml files, they are\\nread and emitted like this so that the frontend can inform the user that it\\nlocated them and can make sure to register them as well if they weren't\\nalready\",\n additionalProperties: false,\n },\n RecursivePartialEntityRelation: {\n type: 'object',\n properties: {\n targetRef: {\n type: 'string',\n description: 'The entity ref of the target of this relation.',\n },\n type: {\n type: 'string',\n description: 'The type of the relation.',\n },\n },\n description:\n 'A relation of a specific type to another entity in the catalog.',\n additionalProperties: false,\n },\n RecursivePartialEntityMeta: {\n allOf: [\n {\n $ref: '#/components/schemas/JsonObject',\n },\n {\n type: 'object',\n properties: {\n links: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/EntityLink',\n },\n description:\n 'A list of external hyperlinks related to the entity.',\n },\n tags: {\n type: 'array',\n items: {\n type: 'string',\n },\n description:\n 'A list of single-valued strings, to for example classify catalog entities in\\nvarious ways.',\n },\n annotations: {\n $ref: '#/components/schemas/MapStringString',\n },\n labels: {\n $ref: '#/components/schemas/MapStringString',\n },\n description: {\n type: 'string',\n description:\n 'A short (typically relatively few words, on one line) description of the\\nentity.',\n },\n title: {\n type: 'string',\n description:\n 'A display name of the entity, to be presented in user interfaces instead\\nof the `name` property above, when available.\\nThis field is sometimes useful when the `name` is cumbersome or ends up\\nbeing perceived as overly technical. The title generally does not have\\nas stringent format requirements on it, so it may contain special\\ncharacters and be more explanatory. Do keep it very short though, and\\navoid situations where a title can be confused with the name of another\\nentity, or where two entities share a title.\\nNote that this is only for display purposes, and may be ignored by some\\nparts of the code. Entity references still always make use of the `name`\\nproperty, not the title.',\n },\n namespace: {\n type: 'string',\n description: 'The namespace that the entity belongs to.',\n },\n name: {\n type: 'string',\n description:\n 'The name of the entity.\\nMust be unique within the catalog at any given point in time, for any\\ngiven namespace + kind pair. This value is part of the technical\\nidentifier of the entity, and as such it will appear in URLs, database\\ntables, entity references, and similar. It is subject to restrictions\\nregarding what characters are allowed.\\nIf you want to use a different, more human readable string with fewer\\nrestrictions on it in user interfaces, see the `title` field below.',\n },\n etag: {\n type: 'string',\n description:\n 'An opaque string that changes for each update operation to any part of\\nthe entity, including metadata.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, and the server will then reject the\\noperation if it does not match the current stored value.',\n },\n uid: {\n type: 'string',\n description:\n 'A globally unique ID for the entity.\\nThis field can not be set by the user at creation time, and the server\\nwill reject an attempt to do so. The field will be populated in read\\noperations. The field can (optionally) be specified when performing\\nupdate or delete operations, but the server is free to reject requests\\nthat do so in such a way that it breaks semantics.',\n },\n },\n description:\n 'Metadata fields common to all versions/kinds of entity.',\n },\n ],\n additionalProperties: false,\n },\n RecursivePartialEntity: {\n type: 'object',\n properties: {\n apiVersion: {\n type: 'string',\n description:\n 'The version of specification format for this particular entity that\\nthis is written against.',\n },\n kind: {\n type: 'string',\n description: 'The high level entity type being described.',\n },\n metadata: {\n $ref: '#/components/schemas/RecursivePartialEntityMeta',\n },\n spec: {\n $ref: '#/components/schemas/JsonObject',\n },\n relations: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/RecursivePartialEntityRelation',\n },\n description:\n 'The relations that this entity has with other entities.',\n },\n },\n description: 'Makes all keys of an entire hierarchy optional.',\n additionalProperties: false,\n },\n AnalyzeLocationEntityField: {\n type: 'object',\n properties: {\n description: {\n type: 'string',\n description:\n 'A text to show to the user to inform about the choices made. Like, it could say\\n\"Found a CODEOWNERS file that covers this target, so we suggest leaving this\\nfield empty; which would currently make it owned by X\" where X is taken from the\\ncodeowners file.',\n },\n value: {\n type: 'string',\n nullable: true,\n },\n state: {\n type: 'string',\n enum: [\n 'analysisSuggestedValue',\n 'analysisSuggestedNoValue',\n 'needsUserInput',\n ],\n description:\n 'The outcome of the analysis for this particular field',\n },\n field: {\n type: 'string',\n description:\n 'e.g. \"spec.owner\"? The frontend needs to know how to \"inject\" the field into the\\nentity again if the user wants to change it',\n },\n },\n required: ['description', 'value', 'state', 'field'],\n additionalProperties: false,\n },\n AnalyzeLocationGenerateEntity: {\n type: 'object',\n properties: {\n fields: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/AnalyzeLocationEntityField',\n },\n },\n entity: {\n $ref: '#/components/schemas/RecursivePartialEntity',\n },\n },\n required: ['fields', 'entity'],\n description:\n \"This is some form of representation of what the analyzer could deduce.\\nWe should probably have a chat about how this can best be conveyed to\\nthe frontend. It'll probably contain a (possibly incomplete) entity, plus\\nenough info for the frontend to know what form data to show to the user\\nfor overriding/completing the info.\",\n additionalProperties: false,\n },\n AnalyzeLocationResponse: {\n type: 'object',\n properties: {\n generateEntities: {\n items: {\n $ref: '#/components/schemas/AnalyzeLocationGenerateEntity',\n },\n type: 'array',\n },\n existingEntityFiles: {\n items: {\n $ref: '#/components/schemas/AnalyzeLocationExistingEntity',\n },\n type: 'array',\n },\n },\n required: ['generateEntities', 'existingEntityFiles'],\n additionalProperties: false,\n },\n LocationInput: {\n type: 'object',\n properties: {\n type: {\n type: 'string',\n },\n target: {\n type: 'string',\n },\n },\n required: ['type', 'target'],\n additionalProperties: false,\n },\n EntitiesQueryResponse: {\n type: 'object',\n properties: {\n items: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Entity',\n },\n description: 'The list of entities paginated by a specific filter.',\n },\n totalItems: {\n type: 'number',\n },\n pageInfo: {\n type: 'object',\n properties: {\n nextCursor: {\n type: 'string',\n description: 'The cursor for the next batch of entities.',\n },\n prevCursor: {\n type: 'string',\n description: 'The cursor for the previous batch of entities.',\n },\n },\n },\n },\n required: ['items', 'totalItems', 'pageInfo'],\n additionalProperties: false,\n },\n },\n securitySchemes: {\n JWT: {\n type: 'http',\n scheme: 'bearer',\n bearerFormat: 'JWT',\n },\n },\n },\n paths: {\n '/refresh': {\n post: {\n operationId: 'RefreshEntity',\n tags: ['Entity'],\n description: 'Refresh the entity related to entityRef.',\n responses: {\n '200': {\n description: 'Refreshed',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n authorizationToken: {\n type: 'string',\n },\n entityRef: {\n type: 'string',\n description:\n 'The reference to a single entity that should be refreshed',\n },\n },\n required: ['entityRef'],\n description:\n 'Options for requesting a refresh of entities in the catalog.',\n additionalProperties: false,\n },\n },\n },\n },\n },\n },\n '/entities': {\n get: {\n operationId: 'GetEntities',\n tags: ['Entity'],\n description: 'Get all entities matching a given filter.',\n responses: {\n '200': {\n description: '',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/fields',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/filter',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/after',\n },\n {\n name: 'order',\n in: 'query',\n allowReserved: true,\n required: false,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n ],\n },\n },\n '/entities/by-uid/{uid}': {\n get: {\n operationId: 'GetEntityByUid',\n tags: ['Entity'],\n description: 'Get a single entity by the UID.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/uid',\n },\n ],\n },\n delete: {\n operationId: 'DeleteEntityByUid',\n tags: ['Entity'],\n description: 'Delete a single entity by UID.',\n responses: {\n '204': {\n description: 'Deleted successfully.',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/uid',\n },\n ],\n },\n },\n '/entities/by-name/{kind}/{namespace}/{name}': {\n get: {\n operationId: 'GetEntityByName',\n tags: ['Entity'],\n description: 'Get an entity by an entity ref.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Entity',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/entities/by-name/{kind}/{namespace}/{name}/ancestry': {\n get: {\n operationId: 'GetEntityAncestryByName',\n tags: ['Entity'],\n description: \"Get an entity's ancestry by entity ref.\",\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntityAncestryResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/kind',\n },\n {\n $ref: '#/components/parameters/namespace',\n },\n {\n $ref: '#/components/parameters/name',\n },\n ],\n },\n },\n '/entities/by-refs': {\n post: {\n operationId: 'GetEntitiesByRefs',\n tags: ['Entity'],\n description:\n 'Get a batch set of entities given an array of entityRefs.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntitiesBatchResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n requestBody: {\n required: false,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n required: ['entityRefs'],\n properties: {\n entityRefs: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n fields: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n },\n },\n examples: {\n 'Fetch Backstage entities': {\n value: {\n entityRefs: [\n 'component:default/backstage',\n 'api:default/backstage',\n ],\n },\n },\n 'Fetch annotations for backstage entity': {\n value: {\n entityRefs: ['component:default/backstage'],\n fields: ['metadata.annotations'],\n },\n },\n },\n },\n },\n },\n parameters: [\n {\n $ref: '#/components/parameters/filter',\n },\n ],\n },\n },\n '/entities/by-query': {\n get: {\n operationId: 'GetEntitiesByQuery',\n tags: ['Entity'],\n description: 'Search for entities by a given query.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntitiesQueryResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n $ref: '#/components/parameters/fields',\n },\n {\n $ref: '#/components/parameters/limit',\n },\n {\n $ref: '#/components/parameters/offset',\n },\n {\n $ref: '#/components/parameters/orderField',\n },\n {\n $ref: '#/components/parameters/cursor',\n },\n {\n $ref: '#/components/parameters/filter',\n },\n {\n name: 'fullTextFilterTerm',\n in: 'query',\n description: 'Text search term.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n name: 'fullTextFilterFields',\n in: 'query',\n description:\n 'A comma separated list of fields to sort returned results by.',\n required: false,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n explode: false,\n style: 'form',\n },\n ],\n },\n },\n '/entity-facets': {\n get: {\n operationId: 'GetEntityFacets',\n tags: ['Entity'],\n description: 'Get all entity facets that match the given filters.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/EntityFacetsResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'query',\n name: 'facet',\n required: true,\n allowReserved: true,\n schema: {\n type: 'array',\n items: {\n type: 'string',\n },\n },\n examples: {\n 'Entities by kind': {\n value: ['kind'],\n },\n 'Entities by spec type': {\n value: ['spec.type'],\n },\n },\n },\n {\n $ref: '#/components/parameters/filter',\n },\n ],\n },\n },\n '/locations': {\n post: {\n operationId: 'CreateLocation',\n tags: ['Locations'],\n description: 'Create a location for a given target.',\n responses: {\n '201': {\n description: 'Created',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n exists: {\n type: 'boolean',\n },\n entities: {\n items: {\n $ref: '#/components/schemas/Entity',\n },\n type: 'array',\n },\n location: {\n $ref: '#/components/schemas/Location',\n },\n },\n required: ['entities', 'location'],\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'query',\n name: 'dryRun',\n required: false,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n target: {\n type: 'string',\n },\n type: {\n type: 'string',\n },\n },\n required: ['target', 'type'],\n },\n },\n },\n },\n },\n get: {\n operationId: 'GetLocations',\n tags: ['Locations'],\n description: 'Get all locations',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n data: {\n $ref: '#/components/schemas/Location',\n },\n },\n required: ['data'],\n },\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n },\n },\n '/locations/{id}': {\n get: {\n operationId: 'GetLocation',\n tags: ['Locations'],\n description: 'Get a location by id.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Location',\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'id',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n delete: {\n operationId: 'DeleteLocation',\n tags: ['Locations'],\n description: 'Delete a location by id.',\n responses: {\n '204': {\n description: 'No content',\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'id',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/locations/by-entity/{kind}/{namespace}/{name}': {\n get: {\n operationId: 'getLocationByEntity',\n tags: ['Locations'],\n description: 'Get a location for entity.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/Location',\n },\n },\n },\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [\n {\n in: 'path',\n name: 'kind',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'namespace',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n {\n in: 'path',\n name: 'name',\n required: true,\n allowReserved: true,\n schema: {\n type: 'string',\n },\n },\n ],\n },\n },\n '/analyze-location': {\n post: {\n operationId: 'AnalyzeLocation',\n tags: ['Locations'],\n description: 'Validate a given location.',\n responses: {\n '200': {\n description: 'Ok',\n content: {\n 'application/json': {\n schema: {\n $ref: '#/components/schemas/AnalyzeLocationResponse',\n },\n },\n },\n },\n '400': {\n $ref: '#/components/responses/ErrorResponse',\n },\n default: {\n $ref: '#/components/responses/ErrorResponse',\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n catalogFileName: {\n type: 'string',\n },\n location: {\n $ref: '#/components/schemas/LocationInput',\n },\n },\n required: ['location'],\n },\n },\n },\n },\n },\n },\n '/validate-entity': {\n post: {\n operationId: 'ValidateEntity',\n tags: ['Entity'],\n description:\n 'Validate that a passed in entity has no errors in schema.',\n responses: {\n '200': {\n description: 'Ok',\n },\n '400': {\n description: 'Validation errors.',\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n errors: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n name: {\n type: 'string',\n },\n message: {\n type: 'string',\n },\n },\n required: ['name', 'message'],\n additionalProperties: {},\n },\n },\n },\n required: ['errors'],\n },\n },\n },\n },\n },\n security: [\n {},\n {\n JWT: [],\n },\n ],\n parameters: [],\n requestBody: {\n required: true,\n content: {\n 'application/json': {\n schema: {\n type: 'object',\n properties: {\n location: {\n type: 'string',\n },\n entity: {\n type: 'object',\n additionalProperties: {},\n },\n },\n required: ['location', 'entity'],\n },\n },\n },\n },\n },\n },\n },\n} as const;\nexport const createOpenApiRouter = async (\n options?: Parameters<\n typeof createValidatedOpenApiRouterFromGeneratedEndpointMap\n >['1'],\n) =>\n createValidatedOpenApiRouterFromGeneratedEndpointMap<EndpointMap>(\n spec,\n options,\n );\n"],"names":["createValidatedOpenApiRouterFromGeneratedEndpointMap"],"mappings":";;;;AAsBO,MAAM,IAAA,GAAO;AAAA,EAClB,OAAA,EAAS,OAAA;AAAA,EACT,IAAA,EAAM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YACE,KAAK;AAAC;AACR,SACF;AAAA,QACA,YAAY,EAAC;AAAA,QACb,WAAA,EAAa;AAAA,UACX,QAAA,EAAU,IAAA;AAAA,UACV,OAAA,EAAS;AAAA,YACP,kBAAA,EAAoB;AAAA,cAClB,MAAA,EAAQ;AAAA,gBACN,IAAA,EAAM,QAAA;AAAA,gBACN,UAAA,EAAY;AAAA,kBACV,QAAA,EAAU;AAAA,oBACR,IAAA,EAAM;AAAA,mBACR;AAAA,kBACA,MAAA,EAAQ;AAAA,oBACN,IAAA,EAAM,QAAA;AAAA,oBACN,sBAAsB;AAAC;AACzB,iBACF;AAAA,gBACA,QAAA,EAAU,CAAC,UAAA,EAAY,QAAQ;AAAA;AACjC;AACF;AACF;AACF;AACF;AACF;AAEJ;AACO,MAAM,mBAAA,GAAsB,OACjC,OAAA,KAIAA,wEAAA;AAAA,EACE,IAAA;AAAA,EACA;AACF;;;;;"}
@@ -406,9 +406,11 @@ class CatalogBuilder {
406
406
  }
407
407
  const locationStore = new DefaultLocationStore.DefaultLocationStore(dbClient);
408
408
  const configLocationProvider = new ConfigLocationEntityProvider.ConfigLocationEntityProvider(config);
409
- const entityProviders = lodash__default.default.uniqBy(
410
- [...this.entityProviders, locationStore, configLocationProvider],
411
- (provider) => provider.getProviderName()
409
+ const entityProviders = this.filterProviders(
410
+ lodash__default.default.uniqBy(
411
+ [...this.entityProviders, locationStore, configLocationProvider],
412
+ (provider) => provider.getProviderName()
413
+ )
412
414
  );
413
415
  const processingEngine = new DefaultCatalogProcessingEngine.DefaultCatalogProcessingEngine({
414
416
  config,
@@ -522,7 +524,39 @@ class CatalogBuilder {
522
524
  }
523
525
  processors.push(...this.processors);
524
526
  this.checkMissingExternalProcessors(processors);
525
- return processors;
527
+ const filteredProcessors = this.filterProcessors(processors);
528
+ filteredProcessors.sort((a, b) => {
529
+ const getProcessorPriority = (processor) => {
530
+ try {
531
+ return config.getOptionalNumber(
532
+ `catalog.processors.${processor.getProcessorName()}.priority`
533
+ ) ?? processor.getPriority?.() ?? 20;
534
+ } catch (_) {
535
+ return 20;
536
+ }
537
+ };
538
+ const aPriority = getProcessorPriority(a);
539
+ const bPriority = getProcessorPriority(b);
540
+ return aPriority - bPriority;
541
+ });
542
+ return filteredProcessors;
543
+ }
544
+ filterProcessors(processors) {
545
+ const { config } = this.env;
546
+ const processorsConfig = config.getOptionalConfig("catalog.processors");
547
+ if (!processorsConfig) {
548
+ return processors;
549
+ }
550
+ return processors.filter((p) => {
551
+ try {
552
+ const processorConfig = processorsConfig.getOptionalConfig(
553
+ p.getProcessorName()
554
+ );
555
+ return processorConfig?.getOptionalBoolean("enabled") ?? true;
556
+ } catch (_) {
557
+ return true;
558
+ }
559
+ });
526
560
  }
527
561
  // TODO(Rugvip): These old processors are removed, for a while we'll be throwing
528
562
  // errors here to make sure people know where to move the config
@@ -620,6 +654,23 @@ class CatalogBuilder {
620
654
  "https://backstage.io/docs/integrations/azure/org"
621
655
  );
622
656
  }
657
+ filterProviders(providers) {
658
+ const { config } = this.env;
659
+ const providersConfig = config.getOptionalConfig("catalog.providers");
660
+ if (!providersConfig) {
661
+ return providers;
662
+ }
663
+ return providers.filter((p) => {
664
+ try {
665
+ const providerConfig = providersConfig.getOptionalConfig(
666
+ p.getProviderName()
667
+ );
668
+ return providerConfig?.getOptionalBoolean("enabled") ?? true;
669
+ } catch (_) {
670
+ return true;
671
+ }
672
+ });
673
+ }
623
674
  static getDefaultProcessingInterval(config$1) {
624
675
  const processingIntervalKey = "catalog.processingInterval";
625
676
  if (!config$1.has(processingIntervalKey)) {
@@ -1 +1 @@
1
- {"version":3,"file":"CatalogBuilder.cjs.js","sources":["../../src/service/CatalogBuilder.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n DefaultNamespaceEntityPolicy,\n Entity,\n EntityPolicies,\n EntityPolicy,\n FieldFormatEntityPolicy,\n makeValidator,\n NoForeignRootFieldsEntityPolicy,\n SchemaValidEntityPolicy,\n Validators,\n} from '@backstage/catalog-model';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { createHash } from 'crypto';\nimport { Router } from 'express';\nimport lodash from 'lodash';\n\nimport {\n AuditorService,\n AuthService,\n DatabaseService,\n HttpAuthService,\n LoggerService,\n PermissionsRegistryService,\n PermissionsService,\n RootConfigService,\n SchedulerService,\n UrlReaderService,\n} from '@backstage/backend-plugin-api';\nimport { Config, readDurationFromConfig } from '@backstage/config';\nimport {\n catalogPermissions,\n RESOURCE_TYPE_CATALOG_ENTITY,\n} from '@backstage/plugin-catalog-common/alpha';\nimport {\n CatalogProcessor,\n CatalogProcessorParser,\n EntityProvider,\n LocationAnalyzer,\n PlaceholderResolver,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\nimport { EventBroker, EventsService } from '@backstage/plugin-events-node';\nimport {\n Permission,\n PermissionAuthorizer,\n toPermissionEvaluator,\n} from '@backstage/plugin-permission-common';\nimport {\n createConditionTransformer,\n createPermissionIntegrationRouter,\n} from '@backstage/plugin-permission-node';\nimport { durationToMilliseconds } from '@backstage/types';\nimport { DefaultCatalogDatabase } from '../database/DefaultCatalogDatabase';\nimport { DefaultProcessingDatabase } from '../database/DefaultProcessingDatabase';\nimport { DefaultProviderDatabase } from '../database/DefaultProviderDatabase';\nimport { applyDatabaseMigrations } from '../database/migrations';\nimport { DefaultCatalogRulesEnforcer } from '../ingestion/CatalogRules';\nimport { RepoLocationAnalyzer } from '../ingestion/LocationAnalyzer';\nimport { permissionRules as catalogPermissionRules } from '../permissions/rules';\nimport { CatalogProcessingEngine } from '../processing/types';\nimport {\n createRandomProcessingInterval,\n ProcessingIntervalFunction,\n} from '../processing/refresh';\nimport { connectEntityProviders } from '../processing/connectEntityProviders';\nimport { evictEntitiesFromOrphanedProviders } from '../processing/evictEntitiesFromOrphanedProviders';\nimport { DefaultCatalogProcessingEngine } from '../processing/DefaultCatalogProcessingEngine';\nimport { DefaultCatalogProcessingOrchestrator } from '../processing/DefaultCatalogProcessingOrchestrator';\nimport {\n AnnotateLocationEntityProcessor,\n BuiltinKindsEntityProcessor,\n FileReaderProcessor,\n PlaceholderProcessor,\n UrlReaderProcessor,\n} from '../processors';\nimport {\n jsonPlaceholderResolver,\n textPlaceholderResolver,\n yamlPlaceholderResolver,\n} from '../processors/PlaceholderProcessor';\nimport { ConfigLocationEntityProvider } from '../providers/ConfigLocationEntityProvider';\nimport { DefaultLocationStore } from '../providers/DefaultLocationStore';\nimport { DefaultStitcher } from '../stitching/DefaultStitcher';\nimport { defaultEntityDataParser } from '../util/parse';\nimport { AuthorizedEntitiesCatalog } from './AuthorizedEntitiesCatalog';\nimport { AuthorizedLocationAnalyzer } from './AuthorizedLocationAnalyzer';\nimport { AuthorizedLocationService } from './AuthorizedLocationService';\nimport { AuthorizedRefreshService } from './AuthorizedRefreshService';\nimport { createRouter } from './createRouter';\nimport { DefaultEntitiesCatalog } from './DefaultEntitiesCatalog';\nimport { DefaultLocationService } from './DefaultLocationService';\nimport { DefaultRefreshService } from './DefaultRefreshService';\nimport { entitiesResponseToObjects } from './response';\nimport {\n catalogEntityPermissionResourceRef,\n CatalogPermissionRuleInput,\n} from '@backstage/plugin-catalog-node/alpha';\n\nexport type CatalogEnvironment = {\n logger: LoggerService;\n database: DatabaseService;\n config: RootConfigService;\n reader: UrlReaderService;\n permissions: PermissionsService | PermissionAuthorizer;\n permissionsRegistry?: PermissionsRegistryService;\n scheduler?: SchedulerService;\n auth: AuthService;\n httpAuth: HttpAuthService;\n auditor?: AuditorService;\n};\n\n/**\n * A builder that helps wire up all of the component parts of the catalog.\n *\n * The touch points where you can replace or extend behavior are as follows:\n *\n * - Entity policies can be added or replaced. These are automatically run\n * after the processors' pre-processing steps. All policies are given the\n * chance to inspect the entity, and all of them have to pass in order for\n * the entity to be considered valid from an overall point of view.\n * - Location analyzers can be added. These are responsible for analyzing\n * repositories when onboarding them into the catalog, by finding\n * catalog-info.yaml files and other artifacts that can help automatically\n * register or create catalog data on the user's behalf.\n * - Placeholder resolvers can be replaced or added. These run on the raw\n * structured data between the parsing and pre-processing steps, to replace\n * dollar-prefixed entries with their actual values (like $file).\n * - Field format validators can be replaced. These check the format of\n * individual core fields such as metadata.name, to ensure that they adhere\n * to certain rules.\n * - Processors can be added or replaced. These implement the functionality of\n * reading, parsing, validating, and processing the entity data before it is\n * persisted in the catalog.\n */\nexport class CatalogBuilder {\n private readonly env: CatalogEnvironment;\n private entityPolicies: EntityPolicy[];\n private entityPoliciesReplace: boolean;\n private placeholderResolvers: Record<string, PlaceholderResolver>;\n private fieldFormatValidators: Partial<Validators>;\n private entityProviders: EntityProvider[];\n private processors: CatalogProcessor[];\n private locationAnalyzers: ScmLocationAnalyzer[];\n private processorsReplace: boolean;\n private parser: CatalogProcessorParser | undefined;\n private onProcessingError?: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void;\n private processingInterval: ProcessingIntervalFunction;\n private locationAnalyzer: LocationAnalyzer | undefined = undefined;\n private readonly permissions: Permission[];\n private readonly permissionRules: CatalogPermissionRuleInput[];\n private allowedLocationType: string[];\n private legacySingleProcessorValidation = false;\n private eventBroker?: EventBroker | EventsService;\n\n /**\n * Creates a catalog builder.\n */\n static create(env: CatalogEnvironment): CatalogBuilder {\n return new CatalogBuilder(env);\n }\n\n private constructor(env: CatalogEnvironment) {\n this.env = env;\n this.entityPolicies = [];\n this.entityPoliciesReplace = false;\n this.placeholderResolvers = {};\n this.fieldFormatValidators = {};\n this.entityProviders = [];\n this.processors = [];\n this.locationAnalyzers = [];\n this.processorsReplace = false;\n this.parser = undefined;\n this.permissions = [...catalogPermissions];\n this.permissionRules = Object.values(catalogPermissionRules);\n this.allowedLocationType = ['url'];\n\n this.processingInterval = CatalogBuilder.getDefaultProcessingInterval(\n env.config,\n );\n }\n\n /**\n * Adds policies that are used to validate entities between the pre-\n * processing and post-processing stages. All such policies must pass for the\n * entity to be considered valid.\n *\n * If what you want to do is to replace the rules for what format is allowed\n * in various core entity fields (such as metadata.name), you may want to use\n * {@link CatalogBuilder#setFieldFormatValidators} instead.\n *\n * @param policies - One or more policies\n */\n addEntityPolicy(\n ...policies: Array<EntityPolicy | Array<EntityPolicy>>\n ): CatalogBuilder {\n this.entityPolicies.push(...policies.flat());\n return this;\n }\n\n /**\n * Processing interval determines how often entities should be processed.\n * Seconds provided will be multiplied by 1.5\n * The default processing interval is 100-150 seconds.\n * setting this too low will potentially deplete request quotas to upstream services.\n */\n setProcessingIntervalSeconds(seconds: number): CatalogBuilder {\n this.processingInterval = createRandomProcessingInterval({\n minSeconds: seconds,\n maxSeconds: seconds * 1.5,\n });\n return this;\n }\n\n /**\n * Overwrites the default processing interval function used to spread\n * entity updates in the catalog.\n */\n setProcessingInterval(\n processingInterval: ProcessingIntervalFunction,\n ): CatalogBuilder {\n this.processingInterval = processingInterval;\n return this;\n }\n\n /**\n * Overwrites the default location analyzer.\n */\n setLocationAnalyzer(locationAnalyzer: LocationAnalyzer): CatalogBuilder {\n this.locationAnalyzer = locationAnalyzer;\n return this;\n }\n\n /**\n * Sets what policies to use for validation of entities between the pre-\n * processing and post-processing stages. All such policies must pass for the\n * entity to be considered valid.\n *\n * If what you want to do is to replace the rules for what format is allowed\n * in various core entity fields (such as metadata.name), you may want to use\n * {@link CatalogBuilder#setFieldFormatValidators} instead.\n *\n * This function replaces the default set of policies; use with care.\n *\n * @param policies - One or more policies\n */\n replaceEntityPolicies(policies: EntityPolicy[]): CatalogBuilder {\n this.entityPolicies = [...policies];\n this.entityPoliciesReplace = true;\n return this;\n }\n\n /**\n * Adds, or overwrites, a handler for placeholders (e.g. $file) in entity\n * definition files.\n *\n * @param key - The key that identifies the placeholder, e.g. \"file\"\n * @param resolver - The resolver that gets values for this placeholder\n */\n setPlaceholderResolver(\n key: string,\n resolver: PlaceholderResolver,\n ): CatalogBuilder {\n this.placeholderResolvers[key] = resolver;\n return this;\n }\n\n /**\n * Sets the validator function to use for one or more special fields of an\n * entity. This is useful if the default rules for formatting of fields are\n * not sufficient.\n *\n * This function has no effect if used together with\n * {@link CatalogBuilder#replaceEntityPolicies}.\n *\n * @param validators - The (subset of) validators to set\n */\n setFieldFormatValidators(validators: Partial<Validators>): CatalogBuilder {\n lodash.merge(this.fieldFormatValidators, validators);\n return this;\n }\n\n /**\n * Adds or replaces entity providers. These are responsible for bootstrapping\n * the list of entities out of original data sources. For example, there is\n * one entity source for the config locations, and one for the database\n * stored locations. If you ingest entities out of a third party system, you\n * may want to implement that in terms of an entity provider as well.\n *\n * @param providers - One or more entity providers\n */\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): CatalogBuilder {\n this.entityProviders.push(...providers.flat());\n return this;\n }\n\n /**\n * Adds entity processors. These are responsible for reading, parsing, and\n * processing entities before they are persisted in the catalog.\n *\n * @param processors - One or more processors\n */\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): CatalogBuilder {\n this.processors.push(...processors.flat());\n return this;\n }\n\n /**\n * Sets what entity processors to use. These are responsible for reading,\n * parsing, and processing entities before they are persisted in the catalog.\n *\n * This function replaces the default set of processors, consider using with\n * {@link CatalogBuilder#getDefaultProcessors}; use with care.\n *\n * @param processors - One or more processors\n */\n replaceProcessors(processors: CatalogProcessor[]): CatalogBuilder {\n this.processors = [...processors];\n this.processorsReplace = true;\n return this;\n }\n\n /**\n * Returns the default list of entity processors. These are responsible for reading,\n * parsing, and processing entities before they are persisted in the catalog. Changing\n * the order of processing can give more control to custom processors.\n *\n * Consider using with {@link CatalogBuilder#replaceProcessors}\n *\n */\n getDefaultProcessors(): CatalogProcessor[] {\n const { config, logger, reader } = this.env;\n const integrations = ScmIntegrations.fromConfig(config);\n\n return [\n new FileReaderProcessor(),\n new UrlReaderProcessor({ reader, logger }),\n new AnnotateLocationEntityProcessor({ integrations }),\n ];\n }\n\n /**\n * Adds Location Analyzers. These are responsible for analyzing\n * repositories when onboarding them into the catalog, by finding\n * catalog-info.yaml files and other artifacts that can help automatically\n * register or create catalog data on the user's behalf.\n *\n * @param locationAnalyzers - One or more location analyzers\n */\n addLocationAnalyzers(\n ...analyzers: Array<ScmLocationAnalyzer | Array<ScmLocationAnalyzer>>\n ): CatalogBuilder {\n this.locationAnalyzers.push(...analyzers.flat());\n return this;\n }\n\n /**\n * Sets up the catalog to use a custom parser for entity data.\n *\n * This is the function that gets called immediately after some raw entity\n * specification data has been read from a remote source, and needs to be\n * parsed and emitted as structured data.\n *\n * @param parser - The custom parser\n */\n setEntityDataParser(parser: CatalogProcessorParser): CatalogBuilder {\n this.parser = parser;\n return this;\n }\n\n /**\n * Adds additional permissions. See\n * {@link @backstage/plugin-permission-node#Permission}.\n *\n * @param permissions - Additional permissions\n */\n addPermissions(...permissions: Array<Permission | Array<Permission>>) {\n this.permissions.push(...permissions.flat());\n return this;\n }\n\n /**\n * Adds additional permission rules. Permission rules are used to evaluate\n * catalog resources against queries. See\n * {@link @backstage/plugin-permission-node#PermissionRule}.\n *\n * @param permissionRules - Additional permission rules\n */\n addPermissionRules(\n ...permissionRules: Array<\n CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>\n >\n ) {\n this.permissionRules.push(...permissionRules.flat());\n return this;\n }\n\n /**\n * Sets up the allowed location types from being registered via the location service.\n *\n * @param allowedLocationTypes - the allowed location types\n */\n setAllowedLocationTypes(allowedLocationTypes: string[]): CatalogBuilder {\n this.allowedLocationType = allowedLocationTypes;\n return this;\n }\n\n /**\n * Enables the legacy behaviour of canceling validation early whenever only a\n * single processor declares an entity kind to be valid.\n */\n useLegacySingleProcessorValidation(): this {\n this.legacySingleProcessorValidation = true;\n return this;\n }\n\n /**\n * Enables the publishing of events for conflicts in the DefaultProcessingDatabase\n */\n setEventBroker(broker: EventBroker | EventsService): CatalogBuilder {\n this.eventBroker = broker;\n return this;\n }\n\n /**\n * Wires up and returns all of the component parts of the catalog\n */\n async build(): Promise<{\n processingEngine: CatalogProcessingEngine;\n router: Router;\n }> {\n const {\n config,\n database,\n logger,\n permissions,\n scheduler,\n permissionsRegistry,\n auditor,\n auth,\n httpAuth,\n } = this.env;\n\n const enableRelationsCompatibility = Boolean(\n config.getOptionalBoolean('catalog.enableRelationsCompatibility'),\n );\n\n const policy = this.buildEntityPolicy();\n const processors = this.buildProcessors();\n const parser = this.parser || defaultEntityDataParser;\n\n const dbClient = await database.getClient();\n if (!database.migrations?.skip) {\n logger.info('Performing database migration');\n await applyDatabaseMigrations(dbClient);\n }\n\n const stitcher = DefaultStitcher.fromConfig(config, {\n knex: dbClient,\n logger,\n });\n\n const processingDatabase = new DefaultProcessingDatabase({\n database: dbClient,\n logger,\n refreshInterval: this.processingInterval,\n eventBroker: this.eventBroker,\n });\n const providerDatabase = new DefaultProviderDatabase({\n database: dbClient,\n logger,\n });\n const catalogDatabase = new DefaultCatalogDatabase({\n database: dbClient,\n logger,\n });\n const integrations = ScmIntegrations.fromConfig(config);\n const rulesEnforcer = DefaultCatalogRulesEnforcer.fromConfig(config);\n\n const unauthorizedEntitiesCatalog = new DefaultEntitiesCatalog({\n database: dbClient,\n logger,\n stitcher,\n enableRelationsCompatibility,\n });\n\n let permissionsService: PermissionsService;\n if ('authorizeConditional' in permissions) {\n permissionsService = permissions as PermissionsService;\n } else {\n logger.warn(\n 'PermissionAuthorizer is deprecated. Please use an instance of PermissionEvaluator instead of PermissionAuthorizer in PluginEnvironment#permissions',\n );\n permissionsService = toPermissionEvaluator(permissions);\n }\n\n const orchestrator = new DefaultCatalogProcessingOrchestrator({\n processors,\n integrations,\n rulesEnforcer,\n logger,\n parser,\n policy,\n legacySingleProcessorValidation: this.legacySingleProcessorValidation,\n });\n\n const entitiesCatalog = new AuthorizedEntitiesCatalog(\n unauthorizedEntitiesCatalog,\n permissionsService,\n permissionsRegistry\n ? createConditionTransformer(\n permissionsRegistry.getPermissionRuleset(\n catalogEntityPermissionResourceRef,\n ),\n )\n : createConditionTransformer(this.permissionRules),\n );\n\n const getResources = async (resourceRefs: string[]) => {\n const { items } = await unauthorizedEntitiesCatalog.entitiesBatch({\n credentials: await auth.getOwnServiceCredentials(),\n entityRefs: resourceRefs,\n });\n\n return entitiesResponseToObjects(items).map(e => e || undefined);\n };\n\n let permissionIntegrationRouter:\n | ReturnType<typeof createPermissionIntegrationRouter>\n | undefined;\n if (permissionsRegistry) {\n permissionsRegistry.addResourceType({\n resourceRef: catalogEntityPermissionResourceRef,\n getResources,\n permissions: this.permissions,\n rules: this.permissionRules,\n });\n } else {\n permissionIntegrationRouter = createPermissionIntegrationRouter({\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n getResources,\n permissions: this.permissions,\n rules: this.permissionRules,\n });\n }\n\n const locationStore = new DefaultLocationStore(dbClient);\n const configLocationProvider = new ConfigLocationEntityProvider(config);\n const entityProviders = lodash.uniqBy(\n [...this.entityProviders, locationStore, configLocationProvider],\n provider => provider.getProviderName(),\n );\n\n const processingEngine = new DefaultCatalogProcessingEngine({\n config,\n scheduler,\n logger,\n knex: dbClient,\n processingDatabase,\n orchestrator,\n stitcher,\n createHash: () => createHash('sha1'),\n pollingIntervalMs: 1000,\n onProcessingError: event => {\n this.onProcessingError?.(event);\n },\n eventBroker: this.eventBroker,\n });\n\n const locationAnalyzer =\n this.locationAnalyzer ??\n new AuthorizedLocationAnalyzer(\n new RepoLocationAnalyzer(logger, integrations, this.locationAnalyzers),\n permissionsService,\n );\n const locationService = new AuthorizedLocationService(\n new DefaultLocationService(locationStore, orchestrator, {\n allowedLocationTypes: this.allowedLocationType,\n }),\n permissionsService,\n );\n const refreshService = new AuthorizedRefreshService(\n new DefaultRefreshService({ database: catalogDatabase }),\n permissionsService,\n );\n\n const router = await createRouter({\n entitiesCatalog,\n locationAnalyzer,\n locationService,\n orchestrator,\n refreshService,\n logger,\n config,\n permissionIntegrationRouter,\n auth,\n httpAuth,\n permissionsService,\n auditor,\n enableRelationsCompatibility,\n });\n\n await connectEntityProviders(providerDatabase, entityProviders);\n\n return {\n processingEngine: {\n async start() {\n if (\n config.getOptionalString('catalog.orphanProviderStrategy') !==\n 'keep'\n ) {\n await evictEntitiesFromOrphanedProviders({\n db: providerDatabase,\n providers: entityProviders,\n logger,\n });\n }\n await processingEngine.start();\n await stitcher.start();\n },\n async stop() {\n await processingEngine.stop();\n await stitcher.stop();\n },\n },\n router,\n };\n }\n\n subscribe(options: {\n onProcessingError: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void;\n }) {\n this.onProcessingError = options.onProcessingError;\n }\n\n private buildEntityPolicy(): EntityPolicy {\n const entityPolicies: EntityPolicy[] = this.entityPoliciesReplace\n ? [new SchemaValidEntityPolicy(), ...this.entityPolicies]\n : [\n new SchemaValidEntityPolicy(),\n new DefaultNamespaceEntityPolicy(),\n new NoForeignRootFieldsEntityPolicy(),\n new FieldFormatEntityPolicy(\n makeValidator(this.fieldFormatValidators),\n ),\n ...this.entityPolicies,\n ];\n\n return EntityPolicies.allOf(entityPolicies);\n }\n\n private buildProcessors(): CatalogProcessor[] {\n const { config, reader } = this.env;\n const integrations = ScmIntegrations.fromConfig(config);\n\n this.checkDeprecatedReaderProcessors();\n\n const placeholderResolvers: Record<string, PlaceholderResolver> = {\n json: jsonPlaceholderResolver,\n yaml: yamlPlaceholderResolver,\n text: textPlaceholderResolver,\n ...this.placeholderResolvers,\n };\n\n // The placeholder is always there no matter what\n const processors: CatalogProcessor[] = [\n new PlaceholderProcessor({\n resolvers: placeholderResolvers,\n reader,\n integrations,\n }),\n ];\n\n const builtinKindsEntityProcessor = new BuiltinKindsEntityProcessor();\n // If the user adds a processor named 'BuiltinKindsEntityProcessor',\n // skip inclusion of the catalog-backend version.\n if (\n !this.processors.some(\n processor =>\n processor.getProcessorName() ===\n builtinKindsEntityProcessor.getProcessorName(),\n )\n ) {\n processors.push(builtinKindsEntityProcessor);\n }\n\n const disableDefaultProcessors = config.getOptionalBoolean(\n 'catalog.disableDefaultProcessors',\n );\n\n // Add default processors if:\n // - processors have NOT been explicitly replaced\n // - and default processors are NOT disabled via config\n if (!this.processorsReplace && !disableDefaultProcessors) {\n processors.push(...this.getDefaultProcessors());\n }\n\n // Add the ones (if any) that the user added\n processors.push(...this.processors);\n\n this.checkMissingExternalProcessors(processors);\n\n return processors;\n }\n\n // TODO(Rugvip): These old processors are removed, for a while we'll be throwing\n // errors here to make sure people know where to move the config\n private checkDeprecatedReaderProcessors() {\n const pc = this.env.config.getOptionalConfig('catalog.processors');\n if (pc?.has('github')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.github, move to using integrations.github instead`,\n );\n }\n if (pc?.has('gitlabApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.gitlabApi, move to using integrations.gitlab instead`,\n );\n }\n if (pc?.has('bitbucketApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.bitbucketApi, move to using integrations.bitbucket instead`,\n );\n }\n if (pc?.has('azureApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.azureApi, move to using integrations.azure instead`,\n );\n }\n }\n\n // TODO(freben): This can be removed no sooner than June 2022, after adopters have had some time to adapt to the new package structure\n private checkMissingExternalProcessors(processors: CatalogProcessor[]) {\n const skipCheckVarName = 'BACKSTAGE_CATALOG_SKIP_MISSING_PROCESSORS_CHECK';\n if (process.env[skipCheckVarName]) {\n return;\n }\n\n const locationTypes = new Set(\n this.env.config\n .getOptionalConfigArray('catalog.locations')\n ?.map(l => l.getString('type')) ?? [],\n );\n const processorNames = new Set(processors.map(p => p.getProcessorName()));\n\n function check(\n locationType: string,\n processorName: string,\n installationUrl: string,\n ) {\n if (\n locationTypes.has(locationType) &&\n !processorNames.has(processorName)\n ) {\n throw new Error(\n [\n `Your config contains a \"catalog.locations\" entry of type ${locationType},`,\n `but does not have the corresponding catalog processor ${processorName} installed.`,\n `This processor used to be built into the catalog itself, but is now moved to an`,\n `external module that has to be installed manually. Please follow the installation`,\n `instructions at ${installationUrl} if you are using this ability, or remove the`,\n `location from your app config if you do not. You can also silence this check entirely`,\n `by setting the environment variable ${skipCheckVarName} to 'true'.`,\n ].join(' '),\n );\n }\n }\n\n check(\n 'aws-cloud-accounts',\n 'AwsOrganizationCloudAccountProcessor',\n 'https://backstage.io/docs/integrations',\n );\n check(\n 's3-discovery',\n 'AwsS3DiscoveryProcessor',\n 'https://backstage.io/docs/integrations/aws-s3/discovery',\n );\n check(\n 'azure-discovery',\n 'AzureDevOpsDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/azure/discovery',\n );\n check(\n 'bitbucket-discovery',\n 'BitbucketDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/bitbucket/discovery',\n );\n check(\n 'github-discovery',\n 'GithubDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/github/discovery',\n );\n check(\n 'github-org',\n 'GithubOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/github/org',\n );\n check(\n 'gitlab-discovery',\n 'GitLabDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/gitlab/discovery',\n );\n check(\n 'ldap-org',\n 'LdapOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/ldap/org',\n );\n check(\n 'microsoft-graph-org',\n 'MicrosoftGraphOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/azure/org',\n );\n }\n\n private static getDefaultProcessingInterval(\n config: Config,\n ): ProcessingIntervalFunction {\n const processingIntervalKey = 'catalog.processingInterval';\n\n if (!config.has(processingIntervalKey)) {\n return createRandomProcessingInterval({\n minSeconds: 100,\n maxSeconds: 150,\n });\n }\n\n if (!Boolean(config.get('catalog.processingInterval'))) {\n return () => {\n throw new Error(\n 'catalog.processingInterval is set to false, processing is disabled.',\n );\n };\n }\n\n const duration = readDurationFromConfig(config, {\n key: processingIntervalKey,\n });\n\n const seconds = Math.max(\n 1,\n Math.round(durationToMilliseconds(duration) / 1000),\n );\n\n return createRandomProcessingInterval({\n minSeconds: seconds,\n maxSeconds: seconds * 1.5,\n });\n }\n}\n"],"names":["catalogPermissions","catalogPermissionRules","createRandomProcessingInterval","lodash","ScmIntegrations","FileReaderProcessor","UrlReaderProcessor","AnnotateLocationEntityProcessor","defaultEntityDataParser","applyDatabaseMigrations","DefaultStitcher","DefaultProcessingDatabase","DefaultProviderDatabase","DefaultCatalogDatabase","DefaultCatalogRulesEnforcer","DefaultEntitiesCatalog","toPermissionEvaluator","DefaultCatalogProcessingOrchestrator","AuthorizedEntitiesCatalog","createConditionTransformer","catalogEntityPermissionResourceRef","entitiesResponseToObjects","createPermissionIntegrationRouter","RESOURCE_TYPE_CATALOG_ENTITY","DefaultLocationStore","ConfigLocationEntityProvider","DefaultCatalogProcessingEngine","createHash","AuthorizedLocationAnalyzer","RepoLocationAnalyzer","AuthorizedLocationService","DefaultLocationService","AuthorizedRefreshService","DefaultRefreshService","createRouter","connectEntityProviders","evictEntitiesFromOrphanedProviders","SchemaValidEntityPolicy","DefaultNamespaceEntityPolicy","NoForeignRootFieldsEntityPolicy","FieldFormatEntityPolicy","makeValidator","EntityPolicies","jsonPlaceholderResolver","yamlPlaceholderResolver","textPlaceholderResolver","PlaceholderProcessor","BuiltinKindsEntityProcessor","config","readDurationFromConfig","durationToMilliseconds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsJO,MAAM,cAAA,CAAe;AAAA,EACT,GAAA;AAAA,EACT,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,oBAAA;AAAA,EACA,qBAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EAIA,kBAAA;AAAA,EACA,gBAAA,GAAiD,MAAA;AAAA,EACxC,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BACbC,QAAA,EAC4B;AAC5B,IAAA,MAAM,qBAAA,GAAwB,4BAAA;AAE9B,IAAA,IAAI,CAACA,QAAA,CAAO,GAAA,CAAI,qBAAqB,CAAA,EAAG;AACtC,MAAA,OAAO9C,sCAAA,CAA+B;AAAA,QACpC,UAAA,EAAY,GAAA;AAAA,QACZ,UAAA,EAAY;AAAA,OACb,CAAA;AAAA,IACH;AAEA,IAAA,IAAI,CAAC,OAAA,CAAQ8C,QAAA,CAAO,GAAA,CAAI,4BAA4B,CAAC,CAAA,EAAG;AACtD,MAAA,OAAO,MAAM;AACX,QAAA,MAAM,IAAI,KAAA;AAAA,UACR;AAAA,SACF;AAAA,MACF,CAAA;AAAA,IACF;AAEA,IAAA,MAAM,QAAA,GAAWC,8BAAuBD,QAAA,EAAQ;AAAA,MAC9C,GAAA,EAAK;AAAA,KACN,CAAA;AAED,IAAA,MAAM,UAAU,IAAA,CAAK,GAAA;AAAA,MACnB,CAAA;AAAA,MACA,IAAA,CAAK,KAAA,CAAME,4BAAA,CAAuB,QAAQ,IAAI,GAAI;AAAA,KACpD;AAEA,IAAA,OAAOhD,sCAAA,CAA+B;AAAA,MACpC,UAAA,EAAY,OAAA;AAAA,MACZ,YAAY,OAAA,GAAU;AAAA,KACvB,CAAA;AAAA,EACH;AACF;;;;"}
1
+ {"version":3,"file":"CatalogBuilder.cjs.js","sources":["../../src/service/CatalogBuilder.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n DefaultNamespaceEntityPolicy,\n Entity,\n EntityPolicies,\n EntityPolicy,\n FieldFormatEntityPolicy,\n makeValidator,\n NoForeignRootFieldsEntityPolicy,\n SchemaValidEntityPolicy,\n Validators,\n} from '@backstage/catalog-model';\nimport { ScmIntegrations } from '@backstage/integration';\nimport { createHash } from 'crypto';\nimport { Router } from 'express';\nimport lodash from 'lodash';\n\nimport {\n AuditorService,\n AuthService,\n DatabaseService,\n HttpAuthService,\n LoggerService,\n PermissionsRegistryService,\n PermissionsService,\n RootConfigService,\n SchedulerService,\n UrlReaderService,\n} from '@backstage/backend-plugin-api';\nimport { Config, readDurationFromConfig } from '@backstage/config';\nimport {\n catalogPermissions,\n RESOURCE_TYPE_CATALOG_ENTITY,\n} from '@backstage/plugin-catalog-common/alpha';\nimport {\n CatalogProcessor,\n CatalogProcessorParser,\n EntityProvider,\n LocationAnalyzer,\n PlaceholderResolver,\n ScmLocationAnalyzer,\n} from '@backstage/plugin-catalog-node';\nimport { EventBroker, EventsService } from '@backstage/plugin-events-node';\nimport {\n Permission,\n PermissionAuthorizer,\n toPermissionEvaluator,\n} from '@backstage/plugin-permission-common';\nimport {\n createConditionTransformer,\n createPermissionIntegrationRouter,\n} from '@backstage/plugin-permission-node';\nimport { durationToMilliseconds } from '@backstage/types';\nimport { DefaultCatalogDatabase } from '../database/DefaultCatalogDatabase';\nimport { DefaultProcessingDatabase } from '../database/DefaultProcessingDatabase';\nimport { DefaultProviderDatabase } from '../database/DefaultProviderDatabase';\nimport { applyDatabaseMigrations } from '../database/migrations';\nimport { DefaultCatalogRulesEnforcer } from '../ingestion/CatalogRules';\nimport { RepoLocationAnalyzer } from '../ingestion/LocationAnalyzer';\nimport { permissionRules as catalogPermissionRules } from '../permissions/rules';\nimport { CatalogProcessingEngine } from '../processing/types';\nimport {\n createRandomProcessingInterval,\n ProcessingIntervalFunction,\n} from '../processing/refresh';\nimport { connectEntityProviders } from '../processing/connectEntityProviders';\nimport { evictEntitiesFromOrphanedProviders } from '../processing/evictEntitiesFromOrphanedProviders';\nimport { DefaultCatalogProcessingEngine } from '../processing/DefaultCatalogProcessingEngine';\nimport { DefaultCatalogProcessingOrchestrator } from '../processing/DefaultCatalogProcessingOrchestrator';\nimport {\n AnnotateLocationEntityProcessor,\n BuiltinKindsEntityProcessor,\n FileReaderProcessor,\n PlaceholderProcessor,\n UrlReaderProcessor,\n} from '../processors';\nimport {\n jsonPlaceholderResolver,\n textPlaceholderResolver,\n yamlPlaceholderResolver,\n} from '../processors/PlaceholderProcessor';\nimport { ConfigLocationEntityProvider } from '../providers/ConfigLocationEntityProvider';\nimport { DefaultLocationStore } from '../providers/DefaultLocationStore';\nimport { DefaultStitcher } from '../stitching/DefaultStitcher';\nimport { defaultEntityDataParser } from '../util/parse';\nimport { AuthorizedEntitiesCatalog } from './AuthorizedEntitiesCatalog';\nimport { AuthorizedLocationAnalyzer } from './AuthorizedLocationAnalyzer';\nimport { AuthorizedLocationService } from './AuthorizedLocationService';\nimport { AuthorizedRefreshService } from './AuthorizedRefreshService';\nimport { createRouter } from './createRouter';\nimport { DefaultEntitiesCatalog } from './DefaultEntitiesCatalog';\nimport { DefaultLocationService } from './DefaultLocationService';\nimport { DefaultRefreshService } from './DefaultRefreshService';\nimport { entitiesResponseToObjects } from './response';\nimport {\n catalogEntityPermissionResourceRef,\n CatalogPermissionRuleInput,\n} from '@backstage/plugin-catalog-node/alpha';\n\nexport type CatalogEnvironment = {\n logger: LoggerService;\n database: DatabaseService;\n config: RootConfigService;\n reader: UrlReaderService;\n permissions: PermissionsService | PermissionAuthorizer;\n permissionsRegistry?: PermissionsRegistryService;\n scheduler?: SchedulerService;\n auth: AuthService;\n httpAuth: HttpAuthService;\n auditor?: AuditorService;\n};\n\n/**\n * A builder that helps wire up all of the component parts of the catalog.\n *\n * The touch points where you can replace or extend behavior are as follows:\n *\n * - Entity policies can be added or replaced. These are automatically run\n * after the processors' pre-processing steps. All policies are given the\n * chance to inspect the entity, and all of them have to pass in order for\n * the entity to be considered valid from an overall point of view.\n * - Location analyzers can be added. These are responsible for analyzing\n * repositories when onboarding them into the catalog, by finding\n * catalog-info.yaml files and other artifacts that can help automatically\n * register or create catalog data on the user's behalf.\n * - Placeholder resolvers can be replaced or added. These run on the raw\n * structured data between the parsing and pre-processing steps, to replace\n * dollar-prefixed entries with their actual values (like $file).\n * - Field format validators can be replaced. These check the format of\n * individual core fields such as metadata.name, to ensure that they adhere\n * to certain rules.\n * - Processors can be added or replaced. These implement the functionality of\n * reading, parsing, validating, and processing the entity data before it is\n * persisted in the catalog.\n */\nexport class CatalogBuilder {\n private readonly env: CatalogEnvironment;\n private entityPolicies: EntityPolicy[];\n private entityPoliciesReplace: boolean;\n private placeholderResolvers: Record<string, PlaceholderResolver>;\n private fieldFormatValidators: Partial<Validators>;\n private entityProviders: EntityProvider[];\n private processors: CatalogProcessor[];\n private locationAnalyzers: ScmLocationAnalyzer[];\n private processorsReplace: boolean;\n private parser: CatalogProcessorParser | undefined;\n private onProcessingError?: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void;\n private processingInterval: ProcessingIntervalFunction;\n private locationAnalyzer: LocationAnalyzer | undefined = undefined;\n private readonly permissions: Permission[];\n private readonly permissionRules: CatalogPermissionRuleInput[];\n private allowedLocationType: string[];\n private legacySingleProcessorValidation = false;\n private eventBroker?: EventBroker | EventsService;\n\n /**\n * Creates a catalog builder.\n */\n static create(env: CatalogEnvironment): CatalogBuilder {\n return new CatalogBuilder(env);\n }\n\n private constructor(env: CatalogEnvironment) {\n this.env = env;\n this.entityPolicies = [];\n this.entityPoliciesReplace = false;\n this.placeholderResolvers = {};\n this.fieldFormatValidators = {};\n this.entityProviders = [];\n this.processors = [];\n this.locationAnalyzers = [];\n this.processorsReplace = false;\n this.parser = undefined;\n this.permissions = [...catalogPermissions];\n this.permissionRules = Object.values(catalogPermissionRules);\n this.allowedLocationType = ['url'];\n\n this.processingInterval = CatalogBuilder.getDefaultProcessingInterval(\n env.config,\n );\n }\n\n /**\n * Adds policies that are used to validate entities between the pre-\n * processing and post-processing stages. All such policies must pass for the\n * entity to be considered valid.\n *\n * If what you want to do is to replace the rules for what format is allowed\n * in various core entity fields (such as metadata.name), you may want to use\n * {@link CatalogBuilder#setFieldFormatValidators} instead.\n *\n * @param policies - One or more policies\n */\n addEntityPolicy(\n ...policies: Array<EntityPolicy | Array<EntityPolicy>>\n ): CatalogBuilder {\n this.entityPolicies.push(...policies.flat());\n return this;\n }\n\n /**\n * Processing interval determines how often entities should be processed.\n * Seconds provided will be multiplied by 1.5\n * The default processing interval is 100-150 seconds.\n * setting this too low will potentially deplete request quotas to upstream services.\n */\n setProcessingIntervalSeconds(seconds: number): CatalogBuilder {\n this.processingInterval = createRandomProcessingInterval({\n minSeconds: seconds,\n maxSeconds: seconds * 1.5,\n });\n return this;\n }\n\n /**\n * Overwrites the default processing interval function used to spread\n * entity updates in the catalog.\n */\n setProcessingInterval(\n processingInterval: ProcessingIntervalFunction,\n ): CatalogBuilder {\n this.processingInterval = processingInterval;\n return this;\n }\n\n /**\n * Overwrites the default location analyzer.\n */\n setLocationAnalyzer(locationAnalyzer: LocationAnalyzer): CatalogBuilder {\n this.locationAnalyzer = locationAnalyzer;\n return this;\n }\n\n /**\n * Sets what policies to use for validation of entities between the pre-\n * processing and post-processing stages. All such policies must pass for the\n * entity to be considered valid.\n *\n * If what you want to do is to replace the rules for what format is allowed\n * in various core entity fields (such as metadata.name), you may want to use\n * {@link CatalogBuilder#setFieldFormatValidators} instead.\n *\n * This function replaces the default set of policies; use with care.\n *\n * @param policies - One or more policies\n */\n replaceEntityPolicies(policies: EntityPolicy[]): CatalogBuilder {\n this.entityPolicies = [...policies];\n this.entityPoliciesReplace = true;\n return this;\n }\n\n /**\n * Adds, or overwrites, a handler for placeholders (e.g. $file) in entity\n * definition files.\n *\n * @param key - The key that identifies the placeholder, e.g. \"file\"\n * @param resolver - The resolver that gets values for this placeholder\n */\n setPlaceholderResolver(\n key: string,\n resolver: PlaceholderResolver,\n ): CatalogBuilder {\n this.placeholderResolvers[key] = resolver;\n return this;\n }\n\n /**\n * Sets the validator function to use for one or more special fields of an\n * entity. This is useful if the default rules for formatting of fields are\n * not sufficient.\n *\n * This function has no effect if used together with\n * {@link CatalogBuilder#replaceEntityPolicies}.\n *\n * @param validators - The (subset of) validators to set\n */\n setFieldFormatValidators(validators: Partial<Validators>): CatalogBuilder {\n lodash.merge(this.fieldFormatValidators, validators);\n return this;\n }\n\n /**\n * Adds or replaces entity providers. These are responsible for bootstrapping\n * the list of entities out of original data sources. For example, there is\n * one entity source for the config locations, and one for the database\n * stored locations. If you ingest entities out of a third party system, you\n * may want to implement that in terms of an entity provider as well.\n *\n * @param providers - One or more entity providers\n */\n addEntityProvider(\n ...providers: Array<EntityProvider | Array<EntityProvider>>\n ): CatalogBuilder {\n this.entityProviders.push(...providers.flat());\n return this;\n }\n\n /**\n * Adds entity processors. These are responsible for reading, parsing, and\n * processing entities before they are persisted in the catalog.\n *\n * @param processors - One or more processors\n */\n addProcessor(\n ...processors: Array<CatalogProcessor | Array<CatalogProcessor>>\n ): CatalogBuilder {\n this.processors.push(...processors.flat());\n return this;\n }\n\n /**\n * Sets what entity processors to use. These are responsible for reading,\n * parsing, and processing entities before they are persisted in the catalog.\n *\n * This function replaces the default set of processors, consider using with\n * {@link CatalogBuilder#getDefaultProcessors}; use with care.\n *\n * @param processors - One or more processors\n */\n replaceProcessors(processors: CatalogProcessor[]): CatalogBuilder {\n this.processors = [...processors];\n this.processorsReplace = true;\n return this;\n }\n\n /**\n * Returns the default list of entity processors. These are responsible for reading,\n * parsing, and processing entities before they are persisted in the catalog. Changing\n * the order of processing can give more control to custom processors.\n *\n * Consider using with {@link CatalogBuilder#replaceProcessors}\n *\n */\n getDefaultProcessors(): CatalogProcessor[] {\n const { config, logger, reader } = this.env;\n const integrations = ScmIntegrations.fromConfig(config);\n\n return [\n new FileReaderProcessor(),\n new UrlReaderProcessor({ reader, logger }),\n new AnnotateLocationEntityProcessor({ integrations }),\n ];\n }\n\n /**\n * Adds Location Analyzers. These are responsible for analyzing\n * repositories when onboarding them into the catalog, by finding\n * catalog-info.yaml files and other artifacts that can help automatically\n * register or create catalog data on the user's behalf.\n *\n * @param locationAnalyzers - One or more location analyzers\n */\n addLocationAnalyzers(\n ...analyzers: Array<ScmLocationAnalyzer | Array<ScmLocationAnalyzer>>\n ): CatalogBuilder {\n this.locationAnalyzers.push(...analyzers.flat());\n return this;\n }\n\n /**\n * Sets up the catalog to use a custom parser for entity data.\n *\n * This is the function that gets called immediately after some raw entity\n * specification data has been read from a remote source, and needs to be\n * parsed and emitted as structured data.\n *\n * @param parser - The custom parser\n */\n setEntityDataParser(parser: CatalogProcessorParser): CatalogBuilder {\n this.parser = parser;\n return this;\n }\n\n /**\n * Adds additional permissions. See\n * {@link @backstage/plugin-permission-node#Permission}.\n *\n * @param permissions - Additional permissions\n */\n addPermissions(...permissions: Array<Permission | Array<Permission>>) {\n this.permissions.push(...permissions.flat());\n return this;\n }\n\n /**\n * Adds additional permission rules. Permission rules are used to evaluate\n * catalog resources against queries. See\n * {@link @backstage/plugin-permission-node#PermissionRule}.\n *\n * @param permissionRules - Additional permission rules\n */\n addPermissionRules(\n ...permissionRules: Array<\n CatalogPermissionRuleInput | Array<CatalogPermissionRuleInput>\n >\n ) {\n this.permissionRules.push(...permissionRules.flat());\n return this;\n }\n\n /**\n * Sets up the allowed location types from being registered via the location service.\n *\n * @param allowedLocationTypes - the allowed location types\n */\n setAllowedLocationTypes(allowedLocationTypes: string[]): CatalogBuilder {\n this.allowedLocationType = allowedLocationTypes;\n return this;\n }\n\n /**\n * Enables the legacy behaviour of canceling validation early whenever only a\n * single processor declares an entity kind to be valid.\n */\n useLegacySingleProcessorValidation(): this {\n this.legacySingleProcessorValidation = true;\n return this;\n }\n\n /**\n * Enables the publishing of events for conflicts in the DefaultProcessingDatabase\n */\n setEventBroker(broker: EventBroker | EventsService): CatalogBuilder {\n this.eventBroker = broker;\n return this;\n }\n\n /**\n * Wires up and returns all of the component parts of the catalog\n */\n async build(): Promise<{\n processingEngine: CatalogProcessingEngine;\n router: Router;\n }> {\n const {\n config,\n database,\n logger,\n permissions,\n scheduler,\n permissionsRegistry,\n auditor,\n auth,\n httpAuth,\n } = this.env;\n\n const enableRelationsCompatibility = Boolean(\n config.getOptionalBoolean('catalog.enableRelationsCompatibility'),\n );\n\n const policy = this.buildEntityPolicy();\n const processors = this.buildProcessors();\n const parser = this.parser || defaultEntityDataParser;\n\n const dbClient = await database.getClient();\n if (!database.migrations?.skip) {\n logger.info('Performing database migration');\n await applyDatabaseMigrations(dbClient);\n }\n\n const stitcher = DefaultStitcher.fromConfig(config, {\n knex: dbClient,\n logger,\n });\n\n const processingDatabase = new DefaultProcessingDatabase({\n database: dbClient,\n logger,\n refreshInterval: this.processingInterval,\n eventBroker: this.eventBroker,\n });\n const providerDatabase = new DefaultProviderDatabase({\n database: dbClient,\n logger,\n });\n const catalogDatabase = new DefaultCatalogDatabase({\n database: dbClient,\n logger,\n });\n const integrations = ScmIntegrations.fromConfig(config);\n const rulesEnforcer = DefaultCatalogRulesEnforcer.fromConfig(config);\n\n const unauthorizedEntitiesCatalog = new DefaultEntitiesCatalog({\n database: dbClient,\n logger,\n stitcher,\n enableRelationsCompatibility,\n });\n\n let permissionsService: PermissionsService;\n if ('authorizeConditional' in permissions) {\n permissionsService = permissions as PermissionsService;\n } else {\n logger.warn(\n 'PermissionAuthorizer is deprecated. Please use an instance of PermissionEvaluator instead of PermissionAuthorizer in PluginEnvironment#permissions',\n );\n permissionsService = toPermissionEvaluator(permissions);\n }\n\n const orchestrator = new DefaultCatalogProcessingOrchestrator({\n processors,\n integrations,\n rulesEnforcer,\n logger,\n parser,\n policy,\n legacySingleProcessorValidation: this.legacySingleProcessorValidation,\n });\n\n const entitiesCatalog = new AuthorizedEntitiesCatalog(\n unauthorizedEntitiesCatalog,\n permissionsService,\n permissionsRegistry\n ? createConditionTransformer(\n permissionsRegistry.getPermissionRuleset(\n catalogEntityPermissionResourceRef,\n ),\n )\n : createConditionTransformer(this.permissionRules),\n );\n\n const getResources = async (resourceRefs: string[]) => {\n const { items } = await unauthorizedEntitiesCatalog.entitiesBatch({\n credentials: await auth.getOwnServiceCredentials(),\n entityRefs: resourceRefs,\n });\n\n return entitiesResponseToObjects(items).map(e => e || undefined);\n };\n\n let permissionIntegrationRouter:\n | ReturnType<typeof createPermissionIntegrationRouter>\n | undefined;\n if (permissionsRegistry) {\n permissionsRegistry.addResourceType({\n resourceRef: catalogEntityPermissionResourceRef,\n getResources,\n permissions: this.permissions,\n rules: this.permissionRules,\n });\n } else {\n permissionIntegrationRouter = createPermissionIntegrationRouter({\n resourceType: RESOURCE_TYPE_CATALOG_ENTITY,\n getResources,\n permissions: this.permissions,\n rules: this.permissionRules,\n });\n }\n\n const locationStore = new DefaultLocationStore(dbClient);\n const configLocationProvider = new ConfigLocationEntityProvider(config);\n const entityProviders = this.filterProviders(\n lodash.uniqBy(\n [...this.entityProviders, locationStore, configLocationProvider],\n provider => provider.getProviderName(),\n ),\n );\n\n const processingEngine = new DefaultCatalogProcessingEngine({\n config,\n scheduler,\n logger,\n knex: dbClient,\n processingDatabase,\n orchestrator,\n stitcher,\n createHash: () => createHash('sha1'),\n pollingIntervalMs: 1000,\n onProcessingError: event => {\n this.onProcessingError?.(event);\n },\n eventBroker: this.eventBroker,\n });\n\n const locationAnalyzer =\n this.locationAnalyzer ??\n new AuthorizedLocationAnalyzer(\n new RepoLocationAnalyzer(logger, integrations, this.locationAnalyzers),\n permissionsService,\n );\n const locationService = new AuthorizedLocationService(\n new DefaultLocationService(locationStore, orchestrator, {\n allowedLocationTypes: this.allowedLocationType,\n }),\n permissionsService,\n );\n const refreshService = new AuthorizedRefreshService(\n new DefaultRefreshService({ database: catalogDatabase }),\n permissionsService,\n );\n\n const router = await createRouter({\n entitiesCatalog,\n locationAnalyzer,\n locationService,\n orchestrator,\n refreshService,\n logger,\n config,\n permissionIntegrationRouter,\n auth,\n httpAuth,\n permissionsService,\n auditor,\n enableRelationsCompatibility,\n });\n\n await connectEntityProviders(providerDatabase, entityProviders);\n\n return {\n processingEngine: {\n async start() {\n if (\n config.getOptionalString('catalog.orphanProviderStrategy') !==\n 'keep'\n ) {\n await evictEntitiesFromOrphanedProviders({\n db: providerDatabase,\n providers: entityProviders,\n logger,\n });\n }\n await processingEngine.start();\n await stitcher.start();\n },\n async stop() {\n await processingEngine.stop();\n await stitcher.stop();\n },\n },\n router,\n };\n }\n\n subscribe(options: {\n onProcessingError: (event: {\n unprocessedEntity: Entity;\n errors: Error[];\n }) => Promise<void> | void;\n }) {\n this.onProcessingError = options.onProcessingError;\n }\n\n private buildEntityPolicy(): EntityPolicy {\n const entityPolicies: EntityPolicy[] = this.entityPoliciesReplace\n ? [new SchemaValidEntityPolicy(), ...this.entityPolicies]\n : [\n new SchemaValidEntityPolicy(),\n new DefaultNamespaceEntityPolicy(),\n new NoForeignRootFieldsEntityPolicy(),\n new FieldFormatEntityPolicy(\n makeValidator(this.fieldFormatValidators),\n ),\n ...this.entityPolicies,\n ];\n\n return EntityPolicies.allOf(entityPolicies);\n }\n\n private buildProcessors(): CatalogProcessor[] {\n const { config, reader } = this.env;\n const integrations = ScmIntegrations.fromConfig(config);\n\n this.checkDeprecatedReaderProcessors();\n\n const placeholderResolvers: Record<string, PlaceholderResolver> = {\n json: jsonPlaceholderResolver,\n yaml: yamlPlaceholderResolver,\n text: textPlaceholderResolver,\n ...this.placeholderResolvers,\n };\n\n // The placeholder is always there no matter what\n const processors: CatalogProcessor[] = [\n new PlaceholderProcessor({\n resolvers: placeholderResolvers,\n reader,\n integrations,\n }),\n ];\n\n const builtinKindsEntityProcessor = new BuiltinKindsEntityProcessor();\n // If the user adds a processor named 'BuiltinKindsEntityProcessor',\n // skip inclusion of the catalog-backend version.\n if (\n !this.processors.some(\n processor =>\n processor.getProcessorName() ===\n builtinKindsEntityProcessor.getProcessorName(),\n )\n ) {\n processors.push(builtinKindsEntityProcessor);\n }\n\n const disableDefaultProcessors = config.getOptionalBoolean(\n 'catalog.disableDefaultProcessors',\n );\n\n // Add default processors if:\n // - processors have NOT been explicitly replaced\n // - and default processors are NOT disabled via config\n if (!this.processorsReplace && !disableDefaultProcessors) {\n processors.push(...this.getDefaultProcessors());\n }\n\n // Add the ones (if any) that the user added\n processors.push(...this.processors);\n\n this.checkMissingExternalProcessors(processors);\n\n const filteredProcessors = this.filterProcessors(processors);\n\n // Lastly sort the processors by priority. Config can override the\n // priority of a processor to allow control of 3rd party processors.\n filteredProcessors.sort((a, b) => {\n const getProcessorPriority = (processor: CatalogProcessor) => {\n try {\n return (\n config.getOptionalNumber(\n `catalog.processors.${processor.getProcessorName()}.priority`,\n ) ??\n processor.getPriority?.() ??\n 20\n );\n } catch (_) {\n // In case the processor config is not an object, just return default priority\n return 20;\n }\n };\n\n const aPriority = getProcessorPriority(a);\n const bPriority = getProcessorPriority(b);\n return aPriority - bPriority;\n });\n\n return filteredProcessors;\n }\n\n private filterProcessors(processors: CatalogProcessor[]) {\n const { config } = this.env;\n const processorsConfig = config.getOptionalConfig('catalog.processors');\n if (!processorsConfig) {\n return processors;\n }\n\n return processors.filter(p => {\n try {\n const processorConfig = processorsConfig.getOptionalConfig(\n p.getProcessorName(),\n );\n return processorConfig?.getOptionalBoolean('enabled') ?? true;\n } catch (_) {\n // In case the processor config is not an object, just include the processor\n return true;\n }\n });\n }\n\n // TODO(Rugvip): These old processors are removed, for a while we'll be throwing\n // errors here to make sure people know where to move the config\n private checkDeprecatedReaderProcessors() {\n const pc = this.env.config.getOptionalConfig('catalog.processors');\n if (pc?.has('github')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.github, move to using integrations.github instead`,\n );\n }\n if (pc?.has('gitlabApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.gitlabApi, move to using integrations.gitlab instead`,\n );\n }\n if (pc?.has('bitbucketApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.bitbucketApi, move to using integrations.bitbucket instead`,\n );\n }\n if (pc?.has('azureApi')) {\n throw new Error(\n `Using deprecated configuration for catalog.processors.azureApi, move to using integrations.azure instead`,\n );\n }\n }\n\n // TODO(freben): This can be removed no sooner than June 2022, after adopters have had some time to adapt to the new package structure\n private checkMissingExternalProcessors(processors: CatalogProcessor[]) {\n const skipCheckVarName = 'BACKSTAGE_CATALOG_SKIP_MISSING_PROCESSORS_CHECK';\n if (process.env[skipCheckVarName]) {\n return;\n }\n\n const locationTypes = new Set(\n this.env.config\n .getOptionalConfigArray('catalog.locations')\n ?.map(l => l.getString('type')) ?? [],\n );\n const processorNames = new Set(processors.map(p => p.getProcessorName()));\n\n function check(\n locationType: string,\n processorName: string,\n installationUrl: string,\n ) {\n if (\n locationTypes.has(locationType) &&\n !processorNames.has(processorName)\n ) {\n throw new Error(\n [\n `Your config contains a \"catalog.locations\" entry of type ${locationType},`,\n `but does not have the corresponding catalog processor ${processorName} installed.`,\n `This processor used to be built into the catalog itself, but is now moved to an`,\n `external module that has to be installed manually. Please follow the installation`,\n `instructions at ${installationUrl} if you are using this ability, or remove the`,\n `location from your app config if you do not. You can also silence this check entirely`,\n `by setting the environment variable ${skipCheckVarName} to 'true'.`,\n ].join(' '),\n );\n }\n }\n\n check(\n 'aws-cloud-accounts',\n 'AwsOrganizationCloudAccountProcessor',\n 'https://backstage.io/docs/integrations',\n );\n check(\n 's3-discovery',\n 'AwsS3DiscoveryProcessor',\n 'https://backstage.io/docs/integrations/aws-s3/discovery',\n );\n check(\n 'azure-discovery',\n 'AzureDevOpsDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/azure/discovery',\n );\n check(\n 'bitbucket-discovery',\n 'BitbucketDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/bitbucket/discovery',\n );\n check(\n 'github-discovery',\n 'GithubDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/github/discovery',\n );\n check(\n 'github-org',\n 'GithubOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/github/org',\n );\n check(\n 'gitlab-discovery',\n 'GitLabDiscoveryProcessor',\n 'https://backstage.io/docs/integrations/gitlab/discovery',\n );\n check(\n 'ldap-org',\n 'LdapOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/ldap/org',\n );\n check(\n 'microsoft-graph-org',\n 'MicrosoftGraphOrgReaderProcessor',\n 'https://backstage.io/docs/integrations/azure/org',\n );\n }\n\n private filterProviders(providers: EntityProvider[]) {\n const { config } = this.env;\n const providersConfig = config.getOptionalConfig('catalog.providers');\n if (!providersConfig) {\n return providers;\n }\n\n return providers.filter(p => {\n try {\n const providerConfig = providersConfig.getOptionalConfig(\n p.getProviderName(),\n );\n return providerConfig?.getOptionalBoolean('enabled') ?? true;\n } catch (_) {\n // In case the provider config is not an object, just include the provider\n return true;\n }\n });\n }\n\n private static getDefaultProcessingInterval(\n config: Config,\n ): ProcessingIntervalFunction {\n const processingIntervalKey = 'catalog.processingInterval';\n\n if (!config.has(processingIntervalKey)) {\n return createRandomProcessingInterval({\n minSeconds: 100,\n maxSeconds: 150,\n });\n }\n\n if (!Boolean(config.get('catalog.processingInterval'))) {\n return () => {\n throw new Error(\n 'catalog.processingInterval is set to false, processing is disabled.',\n );\n };\n }\n\n const duration = readDurationFromConfig(config, {\n key: processingIntervalKey,\n });\n\n const seconds = Math.max(\n 1,\n Math.round(durationToMilliseconds(duration) / 1000),\n );\n\n return createRandomProcessingInterval({\n minSeconds: seconds,\n maxSeconds: seconds * 1.5,\n });\n }\n}\n"],"names":["catalogPermissions","catalogPermissionRules","createRandomProcessingInterval","lodash","ScmIntegrations","FileReaderProcessor","UrlReaderProcessor","AnnotateLocationEntityProcessor","defaultEntityDataParser","applyDatabaseMigrations","DefaultStitcher","DefaultProcessingDatabase","DefaultProviderDatabase","DefaultCatalogDatabase","DefaultCatalogRulesEnforcer","DefaultEntitiesCatalog","toPermissionEvaluator","DefaultCatalogProcessingOrchestrator","AuthorizedEntitiesCatalog","createConditionTransformer","catalogEntityPermissionResourceRef","entitiesResponseToObjects","createPermissionIntegrationRouter","RESOURCE_TYPE_CATALOG_ENTITY","DefaultLocationStore","ConfigLocationEntityProvider","DefaultCatalogProcessingEngine","createHash","AuthorizedLocationAnalyzer","RepoLocationAnalyzer","AuthorizedLocationService","DefaultLocationService","AuthorizedRefreshService","DefaultRefreshService","createRouter","connectEntityProviders","evictEntitiesFromOrphanedProviders","SchemaValidEntityPolicy","DefaultNamespaceEntityPolicy","NoForeignRootFieldsEntityPolicy","FieldFormatEntityPolicy","makeValidator","EntityPolicies","jsonPlaceholderResolver","yamlPlaceholderResolver","textPlaceholderResolver","PlaceholderProcessor","BuiltinKindsEntityProcessor","config","readDurationFromConfig","durationToMilliseconds"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsJO,MAAM,cAAA,CAAe;AAAA,EACT,GAAA;AAAA,EACT,cAAA;AAAA,EACA,qBAAA;AAAA,EACA,oBAAA;AAAA,EACA,qBAAA;AAAA,EACA,eAAA;AAAA,EACA,UAAA;AAAA,EACA,iBAAA;AAAA,EACA,iBAAA;AAAA,EACA,MAAA;AAAA,EACA,iBAAA;AAAA,EAIA,kBAAA;AAAA,EACA,gBAAA,GAAiD,MAAA;AAAA,EACxC,WAAA;AAAA,EACA,eAAA;AAAA,EACT,mBAAA;AAAA,EACA,+BAAA,GAAkC,KAAA;AAAA,EAClC,WAAA;AAAA;AAAA;AAAA;AAAA,EAKR,OAAO,OAAO,GAAA,EAAyC;AACrD,IAAA,OAAO,IAAI,eAAe,GAAG,CAAA;AAAA,EAC/B;AAAA,EAEQ,YAAY,GAAA,EAAyB;AAC3C,IAAA,IAAA,CAAK,GAAA,GAAM,GAAA;AACX,IAAA,IAAA,CAAK,iBAAiB,EAAC;AACvB,IAAA,IAAA,CAAK,qBAAA,GAAwB,KAAA;AAC7B,IAAA,IAAA,CAAK,uBAAuB,EAAC;AAC7B,IAAA,IAAA,CAAK,wBAAwB,EAAC;AAC9B,IAAA,IAAA,CAAK,kBAAkB,EAAC;AACxB,IAAA,IAAA,CAAK,aAAa,EAAC;AACnB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AAAA,EACH;AAAA,EAEA,OAAe,6BACbC,QAAA,EAC4B;AAC5B,IAAA,MAAM,qBAAA,GAAwB,4BAAA;AAE9B,IAAA,IAAI,CAACA,QAAA,CAAO,GAAA,CAAI,qBAAqB,CAAA,EAAG;AACtC,MAAA,OAAO9C,sCAAA,CAA+B;AAAA,QACpC,UAAA,EAAY,GAAA;AAAA,QACZ,UAAA,EAAY;AAAA,OACb,CAAA;AAAA,IACH;AAEA,IAAA,IAAI,CAAC,OAAA,CAAQ8C,QAAA,CAAO,GAAA,CAAI,4BAA4B,CAAC,CAAA,EAAG;AACtD,MAAA,OAAO,MAAM;AACX,QAAA,MAAM,IAAI,KAAA;AAAA,UACR;AAAA,SACF;AAAA,MACF,CAAA;AAAA,IACF;AAEA,IAAA,MAAM,QAAA,GAAWC,8BAAuBD,QAAA,EAAQ;AAAA,MAC9C,GAAA,EAAK;AAAA,KACN,CAAA;AAED,IAAA,MAAM,UAAU,IAAA,CAAK,GAAA;AAAA,MACnB,CAAA;AAAA,MACA,IAAA,CAAK,KAAA,CAAME,4BAAA,CAAuB,QAAQ,IAAI,GAAI;AAAA,KACpD;AAEA,IAAA,OAAOhD,sCAAA,CAA+B;AAAA,MACpC,UAAA,EAAY,OAAA;AAAA,MACZ,YAAY,OAAA,GAAU;AAAA,KACvB,CAAA;AAAA,EACH;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-catalog-backend",
3
- "version": "3.0.2-next.1",
3
+ "version": "3.1.0",
4
4
  "description": "The Backstage backend plugin that provides the Backstage catalog",
5
5
  "backstage": {
6
6
  "role": "backend-plugin",
@@ -73,19 +73,19 @@
73
73
  "test": "backstage-cli package test"
74
74
  },
75
75
  "dependencies": {
76
- "@backstage/backend-openapi-utils": "0.6.1-next.0",
77
- "@backstage/backend-plugin-api": "1.4.3-next.0",
78
- "@backstage/catalog-client": "1.12.0-next.0",
79
- "@backstage/catalog-model": "1.7.5",
80
- "@backstage/config": "1.3.3",
81
- "@backstage/errors": "1.2.7",
82
- "@backstage/integration": "1.18.0-next.0",
83
- "@backstage/plugin-catalog-common": "1.1.5",
84
- "@backstage/plugin-catalog-node": "1.19.0-next.1",
85
- "@backstage/plugin-events-node": "0.4.15-next.0",
86
- "@backstage/plugin-permission-common": "0.9.1",
87
- "@backstage/plugin-permission-node": "0.10.4-next.0",
88
- "@backstage/types": "1.2.1",
76
+ "@backstage/backend-openapi-utils": "^0.6.1",
77
+ "@backstage/backend-plugin-api": "^1.4.3",
78
+ "@backstage/catalog-client": "^1.12.0",
79
+ "@backstage/catalog-model": "^1.7.5",
80
+ "@backstage/config": "^1.3.3",
81
+ "@backstage/errors": "^1.2.7",
82
+ "@backstage/integration": "^1.18.0",
83
+ "@backstage/plugin-catalog-common": "^1.1.5",
84
+ "@backstage/plugin-catalog-node": "^1.19.0",
85
+ "@backstage/plugin-events-node": "^0.4.15",
86
+ "@backstage/plugin-permission-common": "^0.9.1",
87
+ "@backstage/plugin-permission-node": "^0.10.4",
88
+ "@backstage/types": "^1.2.2",
89
89
  "@opentelemetry/api": "^1.9.0",
90
90
  "codeowners-utils": "^1.0.2",
91
91
  "core-js": "^3.6.5",
@@ -106,11 +106,11 @@
106
106
  "zod": "^3.22.4"
107
107
  },
108
108
  "devDependencies": {
109
- "@backstage/backend-defaults": "0.12.1-next.1",
110
- "@backstage/backend-test-utils": "1.9.0-next.1",
111
- "@backstage/cli": "0.34.2-next.2",
112
- "@backstage/plugin-permission-common": "0.9.1",
113
- "@backstage/repo-tools": "0.15.2-next.1",
109
+ "@backstage/backend-defaults": "^0.12.1",
110
+ "@backstage/backend-test-utils": "^1.9.0",
111
+ "@backstage/cli": "^0.34.2",
112
+ "@backstage/plugin-permission-common": "^0.9.1",
113
+ "@backstage/repo-tools": "^0.15.2",
114
114
  "@types/core-js": "^2.5.4",
115
115
  "@types/express": "^4.17.6",
116
116
  "@types/git-url-parse": "^9.0.0",