Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zeit/schemas

Package Overview
Dependencies
Maintainers
15
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zeit/schemas - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

38

deployment/config-env.js
const maxEnvLength = 100;
const reservedEnvKeys = [
'NOW',
// Questionable?
'PATH',
'HOME',
'TEMP',
// Legacy
'AUTH_TOKEN',
'DEPLOYMENT_ID',
'REGISTRY_AUTH_TOKEN'
];
const allowedEnvKey = [
'NOW_NPM_TOKEN'
];
const EnvKey = {

@@ -25,21 +7,3 @@ type: 'string',

minLength: 1,
maxLength: 256,
allOf: [
{
not: {
'enum': reservedEnvKeys
}
},
{
'if': {
'enum': allowedEnvKey
},
'then': {},
'else': {
not: {
pattern: '^NOW_.*$'
}
}
}
]
maxLength: 256
};

@@ -46,0 +10,0 @@

2

package.json
{
"name": "@zeit/schemas",
"version": "2.0.2",
"version": "2.0.3",
"description": "All schemas used for validation that are shared between our projects",

@@ -5,0 +5,0 @@ "scripts": {

@@ -65,29 +65,2 @@ /* eslint camelcase: 0 */

exports.test_env_keys_reserved = () => {
let isValid = ajv.validate(EnvKeys, [
'FOO',
'NOW'
]);
assert.equal(isValid, false);
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');
};
// EnvObject

@@ -117,9 +90,1 @@ exports.test_env_object_valid = () => {

};
exports.test_env_keys_npm_token = () => {
const isValid = ajv.validate(EnvKeys, [
'NOW_NPM_TOKEN'
]);
assert.equal(isValid, true);
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc