Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
removing the AWS access and secret key
Browse files Browse the repository at this point in the history
  • Loading branch information
torstenheinrich committed Apr 20, 2018
1 parent fb9b518 commit cb31345
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 32 deletions.
18 changes: 2 additions & 16 deletions bin/rumble
Original file line number Diff line number Diff line change
@@ -1,25 +1,11 @@
#!/usr/bin/env php
<?php

require __DIR__ . '/../../../autoload.php';
require __DIR__ . '/../autoload.php';

use Symfony\Component\Console\Application;
use Rumble\Commands\MigrateCommand;
use Rumble\Commands\SeedCommand;

$envVars = [
"AWS_ACCESS_KEY_ID",
"AWS_SECRET_ACCESS_KEY",
"AWS_DYNAMO_REGION",
"AWS_DYNAMO_ENDPOINT",
"AWS_DYNAMO_VERSION"
];

foreach ($envVars as $var) {
if (!getenv($var)) {
throw new Exception("The ${var} environment variable is not set.");
}
}
use Symfony\Component\Console\Application;

$app = new Application('Rumble: DynamoDb migration tool.');
$app->add(new MigrateCommand());
Expand Down
6 changes: 5 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "freitasmurillo/rumble",
"name": "theinrich/rumble",
"description": "A dynamodb migration tool",
"type": "library",
"minimum-stability": "stable",
Expand All @@ -17,6 +17,10 @@
{
"name": "Murillo Brendel Freitas",
"email": "[email protected]"
},
{
"name": "Torsten Heinrich",
"email": "[email protected]"
}
],
"require": {
Expand Down
16 changes: 1 addition & 15 deletions src/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,10 @@ protected function buildClass($file)
*/
protected function getConfig()
{
if (!getenv("AWS_ACCESS_KEY_ID")
|| !getenv("AWS_SECRET_ACCESS_KEY")
|| !getenv("AWS_DYNAMO_REGION")
|| !getenv("AWS_DYNAMO_ENDPOINT")
|| !getenv("AWS_DYNAMO_VERSION")
) {
throw new \Exception("The configuration variables are not set. Please set the environment variables.");
}

return [
'credentials' => new Credentials(
getenv("AWS_ACCESS_KEY_ID"),
getenv("AWS_SECRET_ACCESS_KEY")
),
'region' => getenv("AWS_DYNAMO_REGION"),
'endpoint' => getenv("AWS_DYNAMO_ENDPOINT"),
'version' => getenv("AWS_DYNAMO_VERSION")
];
}

}
}

0 comments on commit cb31345

Please sign in to comment.