Skip to content

Commit 34e989c

Browse files
feat(environment-variables): update variable validation to align with AEM documentation. fixes #550 (#551)
1 parent cedf0b7 commit 34e989c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/commands/cloudmanager/environment/set-variables.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ const commonArgs = require('../../../common-args')
2121
const { services } = require('../../../constants')
2222
const { codes: validationCodes } = require('../../../ValidationErrors')
2323

24+
const IGNORED_PREFIXES = [
25+
'INTERNAL_',
26+
'ADOBE_',
27+
'CONST_',
28+
]
29+
2430
class SetEnvironmentVariablesCommand extends BaseEnvironmentVariablesCommand {
2531
getFlagDefs () {
2632
const coreFlagDefs = super.getFlagDefs()
@@ -57,7 +63,7 @@ class SetEnvironmentVariablesCommand extends BaseEnvironmentVariablesCommand {
5763

5864
validateVariables (flags, variables) {
5965
variables.forEach(variable => {
60-
if (variable.name && variable.name.startsWith('INTERNAL_')) {
66+
if (variable.name && IGNORED_PREFIXES.find(prefix => variable.name.startsWith(prefix))) {
6167
if (this.strictValidationEnabled(flags)) {
6268
throw new validationCodes.INTERNAL_VARIABLE_USAGE({ messageValues: variable.name })
6369
} else {

0 commit comments

Comments
 (0)