mirror of
https://git.cloudron.io/cloudron/minio-app
synced 2025-01-11 23:01:08 +00:00
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') {
|
} else if (process.argv[2] === 'set') {
|
||||||
if (process.argv.length !== 5) return usage();
|
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];
|
accessKey.value = process.argv[3];
|
||||||
if (process.argv[4].length < 8) return console.log('secret key must be atleast 8 characters');
|
if (process.argv[4].length < 8) return console.log('secret key must be atleast 8 characters');
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user