screwdriver-api 8.0.166 → 8.0.168

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/bin/server CHANGED
@@ -61,6 +61,19 @@ const notificationConfig = config.get('notifications');
61
61
  // Multiple build cluster feature flag
62
62
  const multiBuildClusterEnabled = convertToBool(config.get('multiBuildCluster').enabled);
63
63
 
64
+ // Maximum total number of YAML merge keys allowed in a pipeline configuration
65
+ const maxTotalMergeKeys = config.has('yamlParser.maxTotalMergeKeys')
66
+ ? Number(config.get('yamlParser.maxTotalMergeKeys'))
67
+ : undefined;
68
+
69
+ if (
70
+ maxTotalMergeKeys !== undefined && !Number.isSafeInteger(maxTotalMergeKeys)
71
+ ) {
72
+ throw new TypeError(
73
+ 'yamlParser.maxTotalMergeKeys must be a positive safe integer.'
74
+ );
75
+ }
76
+
64
77
  // Unzip artifacts feature flag
65
78
  const unzipArtifactsEnabled = convertToBool(config.get('unzipArtifacts').enabled);
66
79
 
@@ -145,6 +158,7 @@ const pipelineFactory = Models.PipelineFactory.getInstance({
145
158
  scm,
146
159
  externalJoin: true,
147
160
  notificationsValidationErr,
161
+ maxTotalMergeKeys,
148
162
  multiBuildClusterEnabled
149
163
  });
150
164
 
@@ -313,7 +327,8 @@ datastore.setup(datastoreConfig.ddlSyncEnabled).then(() =>
313
327
  log,
314
328
  validator: {
315
329
  externalJoin: true,
316
- notificationsValidationErr
330
+ notificationsValidationErr,
331
+ maxTotalMergeKeys
317
332
  },
318
333
  queueWebhook: {
319
334
  executor,
@@ -431,6 +431,9 @@ multiBuildCluster:
431
431
  # Enabled multi build cluster feature or not
432
432
  enabled: MULTI_BUILD_CLUSTER_ENABLED
433
433
 
434
+ yamlParser:
435
+ maxTotalMergeKeys: YAML_PARSER_MAX_TOTAL_MERGE_KEYS
436
+
434
437
  unzipArtifacts:
435
438
  # Enabled unzip artifacts feature or not
436
439
  enabled: UNZIP_ARTIFACTS_ENABLED
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-api",
3
- "version": "8.0.166",
3
+ "version": "8.0.168",
4
4
  "description": "API server for the Screwdriver.cd service",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -98,7 +98,7 @@
98
98
  "hapi-swagger": "^17.2.1",
99
99
  "ioredis": "^5.2.3",
100
100
  "joi": "^17.7.0",
101
- "js-yaml": "^3.14.1",
101
+ "js-yaml": "^4.3.0",
102
102
  "jsonwebtoken": "^9.0.0",
103
103
  "lodash.isempty": "^4.4.0",
104
104
  "lodash.mergewith": "^4.6.2",
@@ -28,7 +28,7 @@ const validatorTemplate = {
28
28
  }
29
29
  },
30
30
  handler: async (request, h) => {
31
- const { notificationsValidationErr } = options;
31
+ const { notificationsValidationErr, maxTotalMergeKeys } = options;
32
32
  const {
33
33
  buildClusterFactory,
34
34
  templateFactory,
@@ -45,7 +45,8 @@ const validatorTemplate = {
45
45
  pipelineTemplateVersionFactory,
46
46
  pipelineTemplateTagFactory,
47
47
  pipelineTemplateFactory,
48
- notificationsValidationErr
48
+ notificationsValidationErr,
49
+ maxTotalMergeKeys
49
50
  }).then(pipeline => h.response(pipeline));
50
51
  },
51
52
  validate: {