@backstage/plugin-scaffolder-backend 1.12.0-next.1 → 1.12.0-next.2

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,23 @@
1
1
  # @backstage/plugin-scaffolder-backend
2
2
 
3
+ ## 1.12.0-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 860de10fa67: Make identity valid if subject of token is a backstage server-2-server auth token
8
+ - 65454876fb2: Minor API report tweaks
9
+ - 9968f455921: catalog write action should allow any shape of object
10
+ - Updated dependencies
11
+ - @backstage/plugin-auth-node@0.2.12-next.2
12
+ - @backstage/backend-tasks@0.5.0-next.2
13
+ - @backstage/backend-common@0.18.3-next.2
14
+ - @backstage/backend-plugin-api@0.4.1-next.2
15
+ - @backstage/plugin-catalog-backend@1.8.0-next.2
16
+ - @backstage/plugin-catalog-node@1.3.4-next.2
17
+ - @backstage/plugin-scaffolder-node@0.1.1-next.2
18
+ - @backstage/config@1.0.7-next.0
19
+ - @backstage/integration@1.4.3-next.0
20
+
3
21
  ## 1.12.0-next.1
4
22
 
5
23
  ### Minor Changes
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Scaffolder Backend
2
2
 
3
3
  This is the backend for the default Backstage [software
4
- templates](https://backstage.io/docs/features/software-templates/software-templates-index).
4
+ templates](https://backstage.io/docs/features/software-templates/).
5
5
  This provides the API for the frontend [scaffolder
6
6
  plugin](https://github.com/backstage/backstage/tree/master/plugins/scaffolder),
7
7
  as well as the built-in template actions, tasks and stages.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-backend",
3
- "version": "1.12.0-next.1",
3
+ "version": "1.12.0-next.2",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
package/dist/alpha.cjs.js CHANGED
@@ -326,7 +326,7 @@ function createCatalogWriteAction() {
326
326
  input: zod.z.object({
327
327
  filePath: zod.z.string().optional().describe("Defaults to catalog-info.yaml"),
328
328
  // TODO: this should reference an zod entity validator if it existed.
329
- entity: zod.z.object({}).describe(
329
+ entity: zod.z.object({}).passthrough().describe(
330
330
  "You can provide the same values used in the Entity schema."
331
331
  )
332
332
  })
@@ -3528,11 +3528,12 @@ const defaultClientFactory = async ({
3528
3528
  ...{ throttle: { enabled: false } }
3529
3529
  });
3530
3530
  };
3531
- const createPublishGithubPullRequestAction = ({
3532
- integrations,
3533
- githubCredentialsProvider,
3534
- clientFactory = defaultClientFactory
3535
- }) => {
3531
+ const createPublishGithubPullRequestAction = (options) => {
3532
+ const {
3533
+ integrations,
3534
+ githubCredentialsProvider,
3535
+ clientFactory = defaultClientFactory
3536
+ } = options;
3536
3537
  return pluginScaffolderNode.createTemplateAction({
3537
3538
  id: "publish:github:pull-request",
3538
3539
  schema: {
@@ -4428,7 +4429,8 @@ class DatabaseTaskStore {
4428
4429
  });
4429
4430
  return { events };
4430
4431
  }
4431
- async shutdownTask({ taskId }) {
4432
+ async shutdownTask(options) {
4433
+ const { taskId } = options;
4432
4434
  const message = `This task was marked as stale as it exceeded its timeout`;
4433
4435
  const statusStepEvents = (await this.listEvents({ taskId })).events.filter(
4434
4436
  ({ body }) => body == null ? void 0 : body.stepId
@@ -5233,13 +5235,12 @@ async function findTemplate(options) {
5233
5235
  function isSupportedTemplate(entity) {
5234
5236
  return entity.apiVersion === "scaffolder.backstage.io/v1beta3";
5235
5237
  }
5236
- function buildDefaultIdentityClient({
5237
- logger
5238
- }) {
5238
+ function buildDefaultIdentityClient(options) {
5239
5239
  return {
5240
5240
  getIdentity: async ({ request }) => {
5241
5241
  var _a;
5242
5242
  const header = request.headers.authorization;
5243
+ const { logger } = options;
5243
5244
  if (!header) {
5244
5245
  return void 0;
5245
5246
  }
@@ -5259,6 +5260,9 @@ function buildDefaultIdentityClient({
5259
5260
  if (typeof sub !== "string") {
5260
5261
  throw new TypeError("Expected string sub claim");
5261
5262
  }
5263
+ if (sub === "backstage-server") {
5264
+ return void 0;
5265
+ }
5262
5266
  catalogModel.parseEntityRef(sub);
5263
5267
  return {
5264
5268
  identity: {
@@ -5292,7 +5296,7 @@ async function createRouter(options) {
5292
5296
  additionalTemplateGlobals
5293
5297
  } = options;
5294
5298
  const logger = parentLogger.child({ plugin: "scaffolder" });
5295
- const identity = options.identity || buildDefaultIdentityClient({ logger });
5299
+ const identity = options.identity || buildDefaultIdentityClient(options);
5296
5300
  const workingDirectory = await getWorkingDirectory(config, logger);
5297
5301
  const integrations = integration.ScmIntegrations.fromConfig(config);
5298
5302
  let taskBroker;