* This function is used as a binary to send a request to S3 and create an * encrypted bucket, because most of the s3 tools don't support custom * headers * * @return {undefined}
()
| 72 | * @return {undefined} |
| 73 | */ |
| 74 | function createEncryptedBucket() { |
| 75 | commander |
| 76 | .version('0.0.1') |
| 77 | .option('-a, --access-key <accessKey>', 'Access key id') |
| 78 | .option('-k, --secret-key <secretKey>', 'Secret access key') |
| 79 | .option('-b, --bucket <bucket>', 'Name of the bucket') |
| 80 | .option('-h, --host <host>', 'Host of the server') |
| 81 | .option('-p, --port <port>', 'Port of the server') |
| 82 | .option('-s, --ssl', 'Enable ssl') |
| 83 | .option('-v, --verbose') |
| 84 | .option('-l, --location-constraint <locationConstraint>', |
| 85 | 'location Constraint') |
| 86 | .parse(process.argv); |
| 87 | |
| 88 | const { host, port, accessKey, secretKey, bucket, verbose, ssl, |
| 89 | locationConstraint } = commander; |
| 90 | |
| 91 | if (!host || !port || !accessKey || !secretKey || !bucket) { |
| 92 | logger.error('missing parameter'); |
| 93 | commander.outputHelp(); |
| 94 | process.exit(1); |
| 95 | } |
| 96 | _createEncryptedBucket(host, port, bucket, accessKey, secretKey, verbose, |
| 97 | ssl, locationConstraint); |
| 98 | } |
| 99 | |
| 100 | module.exports = { |
| 101 | createEncryptedBucket, |
nothing calls this directly
no test coverage detected