mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-11-01 02:43:35 +08:00 
			
		
		
		
	improvement (S3): hide secret access key by default + auth bugfix - #58
This commit is contained in:
		| @ -92,7 +92,8 @@ export class Form extends React.Component { | ||||
|         let credentials = Object.assign({}, this.props.credentials); | ||||
|         for(let key in this.state.refs){ | ||||
|             if(this.state.refs[key]){ | ||||
|                 let [type, name] = key.split('_'); | ||||
|                 let [type, ...name] = key.split('_'); | ||||
|                 name = name.join("_"); | ||||
|                 if(!credentials[type]) credentials[type] = {}; | ||||
|                 credentials[type][name] = this.state.refs[key].ref.value; | ||||
|             } | ||||
| @ -146,6 +147,7 @@ export class Form extends React.Component { | ||||
|         else if(typeof value === 'number') return 'hidden'; | ||||
|         else if(value === false) return 'hidden'; | ||||
|         else if(key === 'password') return 'password'; | ||||
|         else if(key === 'secret_access_key') return 'password'; | ||||
|         else{ | ||||
|             return 'text'; | ||||
|         } | ||||
|  | ||||
| @ -15,10 +15,9 @@ function connect(params){ | ||||
|         apiVersion: '2006-03-01', | ||||
|         accessKeyId: params.access_key_id, | ||||
|         secretAccessKey: params.secret_access_key, | ||||
|         region: params.region, | ||||
|         sslEnabled: true | ||||
|     });     | ||||
|     return Promise.resolve(s3);     | ||||
|     }); | ||||
|     return Promise.resolve(s3); | ||||
| } | ||||
|  | ||||
| module.exports = { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Mickael KERJEAN
					Mickael KERJEAN