@zeit/schemas
Advanced tools
Comparing version 1.6.3 to 1.7.0
@@ -108,3 +108,3 @@ const {EnvKeys, EnvObject} = require('./env'); | ||
minimum: 1, | ||
maximum: 1024 | ||
maximum: 256 | ||
}, | ||
@@ -111,0 +111,0 @@ timeout: { |
@@ -5,5 +5,2 @@ const maxEnvLength = 100; | ||
'NOW', | ||
'NOW_REGION', | ||
'NOW_DC', | ||
'NOW_URL', | ||
@@ -16,3 +13,2 @@ // Questionable? | ||
// Legacy | ||
'NOW_PLAN', | ||
'AUTH_TOKEN', | ||
@@ -28,5 +24,14 @@ 'DEPLOYMENT_ID', | ||
maxLength: 256, | ||
not: { | ||
'enum': reservedEnvKeys | ||
} | ||
allOf: [ | ||
{ | ||
not: { | ||
'enum': reservedEnvKeys | ||
} | ||
}, | ||
{ | ||
not: { | ||
pattern: '^NOW_.*$' | ||
} | ||
} | ||
] | ||
}; | ||
@@ -33,0 +38,0 @@ |
{ | ||
"name": "@zeit/schemas", | ||
"version": "1.6.3", | ||
"version": "1.7.0", | ||
"description": "All schemas used for validation that are shared between our projects", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -66,3 +66,3 @@ /* eslint camelcase: 0 */ | ||
exports.test_env_keys_reserved = () => { | ||
const isValid = ajv.validate(EnvKeys, [ | ||
let isValid = ajv.validate(EnvKeys, [ | ||
'FOO', | ||
@@ -73,2 +73,20 @@ 'NOW' | ||
assert.equal(ajv.errors[0].keyword, 'not'); | ||
isValid = ajv.validate(EnvKeys, [ | ||
'NOW_DC' | ||
]); | ||
assert.equal(isValid, false); | ||
assert.equal(ajv.errors[0].keyword, 'not'); | ||
isValid = ajv.validate(EnvKeys, [ | ||
'NOW_FOO' | ||
]); | ||
assert.equal(isValid, false); | ||
assert.equal(ajv.errors[0].keyword, 'not'); | ||
isValid = ajv.validate(EnvKeys, [ | ||
'AUTH_TOKEN' | ||
]); | ||
assert.equal(isValid, false); | ||
assert.equal(ajv.errors[0].keyword, 'not'); | ||
}; | ||
@@ -75,0 +93,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70587
632