Skip to content
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

Merged
merged 6 commits into from
Aug 8, 2017
Merged

Fix to allow for tokens #70

merged 6 commits into from
Aug 8, 2017

Conversation

footballencarta
Copy link
Contributor

@footballencarta footballencarta commented Aug 8, 2017

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 Reviewable

As IAM roles also supply a token along with a key and secret, this fix is needed to allow them to connect to DynamoDb.
@@ -70,4 +77,4 @@ protected function bindForTesting($marshalerOptions = [])
return $client;
});
}
}
}

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
@@ -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')
Copy link
Owner

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')

Copy link
Contributor Author

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.

Copy link
Owner

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?

Copy link
Contributor Author

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.

Copy link
Owner

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')

Copy link
Contributor Author

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!

@@ -41,10 +41,12 @@ protected function bindForApp($marshalerOptions = [])
'credentials' => [
'key' => config('services.dynamodb.key'),
'secret' => config('services.dynamodb.secret'),
'token' => config('services.dynamodb.token')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing , please :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@baopham baopham merged commit f891a24 into baopham:master Aug 8, 2017
zoul0813 added a commit to zoul0813/laravel-dynamodb that referenced this pull request Aug 8, 2017
* 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
zoul0813 added a commit to zoul0813/laravel-dynamodb that referenced this pull request Aug 14, 2017
…/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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants