add some basic key validation
This commit is contained in:
parent
38f24649fe
commit
891169e87b
|
@ -24,6 +24,10 @@ if (process.argv[2] === 'get') {
|
|||
} else if (process.argv[2] === 'set') {
|
||||
if (process.argv.length !== 5) return usage();
|
||||
|
||||
// https://docs.aws.amazon.com/IAM/latest/APIReference/API_CreateAccessKey.html
|
||||
if (process.argv[4].length < 5) return console.log('secret key must be atleast 5 characters');
|
||||
if (!/^[\w+=,.@-]+$/.test(process.argv[3])) return console.log('access key has invalid characters');
|
||||
|
||||
accessKey.value = process.argv[3];
|
||||
if (process.argv[4].length < 8) return console.log('secret key must be atleast 8 characters');
|
||||
|
||||
|
|
Loading…
Reference in New Issue