-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to allow for tokens #70
Conversation
As IAM roles also supply a token along with a key and secret, this fix is needed to allow them to connect to DynamoDb.
src/DynamoDbServiceProvider.php
Outdated
@@ -70,4 +77,4 @@ protected function bindForTesting($marshalerOptions = []) | |||
return $client; | |||
}); | |||
} | |||
} | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 1 newline at end of file; 0 found
Added new line to end again
src/DynamoDbServiceProvider.php
Outdated
@@ -40,11 +40,18 @@ protected function bindForApp($marshalerOptions = []) | |||
$config = [ | |||
'credentials' => [ | |||
'key' => config('services.dynamodb.key'), | |||
'secret' => config('services.dynamodb.secret'), | |||
'secret' => config('services.dynamodb.secret') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what happen if we just put token
here:
'token' => config('services.dynamodb.token')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does still work, however I don't believe a parameter we know may or may not be set should be passed through.
I can make the change if you wish, as it doesn't affect functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ok. Btw, could you also update README?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated 😃 I've tried to be explicit with the fact the parameter is used for roles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 😄 . Feel free to update the code as discussed:
'token' => config('services.dynamodb.token')
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - misunderstood your comment - code updated!
src/DynamoDbServiceProvider.php
Outdated
@@ -41,10 +41,12 @@ protected function bindForApp($marshalerOptions = []) | |||
'credentials' => [ | |||
'key' => config('services.dynamodb.key'), | |||
'secret' => config('services.dynamodb.secret'), | |||
'token' => config('services.dynamodb.token') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing ,
please :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
* master: Allow token for IAM role (baopham#70) Clean up old notes Use Query instead of Scan if conditions contain key Fix composite condition where conditions are not EQ Delete README.v0.3.md Update README.md Fix ModelTrait; ensure we use Eloquent's getTable() as getTableName() does not exist Add FAQ Clean up README
…/laravel-dynamodb into feature/first-find-fail * 'feature/first-find-fail' of https://github.com/zoul0813/laravel-dynamodb: Add firstOrFail, findOrFail support Add build status badge Add limit support (baopham#76) Add .travis.yml Add debug support Clean up Make model serializable Use DateTime::ATOM instead Allow token for IAM role (baopham#70) Clean up old notes Use Query instead of Scan if conditions contain key Fix composite condition where conditions are not EQ Delete README.v0.3.md Update README.md Fix ModelTrait; ensure we use Eloquent's getTable() as getTableName() does not exist Add FAQ Clean up README # Conflicts: # src/DynamoDbQueryBuilder.php # tests/DynamoDbCompositeModelTest.php # tests/DynamoDbModelTest.php
As using IAM roles, rather than supplying keys directly, you also supply a token along with a key and secret.
If the token isn't supplied, the connection to DynamoDb is unsuccessful. This fix is needed to allow them to connect to DynamoDb.
This change is