mirror of
				https://git.cloudron.io/cloudron/minio-app
				synced 2025-11-04 09:02:35 +00:00 
			
		
		
		
	add some basic key validation
This commit is contained in:
		@@ -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');
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user