underarmour / dynago Goto Github PK
View Code? Open in Web Editor NEWA DynamoDB client for Go
License: MIT License
A DynamoDB client for Go
License: MIT License
Hello,
Love this library but can't overcome the manual work that is required to convert to Go types. How do you suggest I convert from a dynago.Document
to a domain object that I create?
Do you plan on implementing marshal/unmarshal? Thanks.
Instance credentials should be checked as a default method of authentication
reference implementation:
https://github.com/goamz/goamz/blob/master/aws/aws.go#L250-L291
Please see pull request: #16
Hi,
We're using dynago for a project and have really enjoyed the API in comparison to aws-go. Thank you open sourcing this project!
It would be very helpful for us if you could add branch tags so that we could use a versioned import from gopkg. It just involves adding tags for versions, like v1.0.0
. We'd rather avoid Godep if possible.
Thanks for your consideration.
Hi,
Dynago Library greatly solves the problem of reading/writing data with normal json from/to Dynamodb. One issue I am facing is to create dynago client with temporary credentials received from AWS STS while assuming role. The error says :
dynago.Error(ErrorAuth): UnrecognizedClientException: The security token included in the request is invalid.
The following code snippet shows what and how I am trying to achieve:
sess := session.Must(session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,}))
svc := sts.New(sess)
input := &sts.AssumeRoleInput{
RoleArn: aws.String("arn:aws:iam::<ACCOUNT-ID>:role/<ROLE-NAME>"),
RoleSessionName: aws.String("Bob"),
}
result, err := svc.AssumeRole(input)
client := dynago.NewAwsClient("<REGION-NAME>", *result.Credentials.AccessKeyId, *result.Credentials.SecretAccessKey)
Is there an alternate way to create dynago client with temporary credentials? If not, do you plan to supoort this case?
Thanks & Regards
Aprimit Garg
Currently MakeRequest
returns a byte array and relies on AWS setting the ContentLength
header in their response. I've encountered a scenario where Amazon returns a large amount of data (a Scan
request) and fails to set the ContentLength
header. I dumped the contents of the request and it had all the data requested.
Technically this is a Amazon issue but I think utilizing encoders from json
will alleviate it. The Local DynamoDB instance is more consistent in setting all the necessary headers which is why your tests haven't caught this.
I'd like to change MakeRequest
to return a io.ReadCloser
and let json.Decoder
handle the body. I'm going to implement this change.
This is just a headsup in case you have any thoughts on it. All the changes are internal so there would be no interface errors.
Hi,
(previously did all testing with DynamoDB local and just now encountered this)
I receive an InvalidSignatureException on all requests made with Dynago. Using the same credentials with aws-go yields a a correct response. I patched both libraries to compare the HTTP headers and discovered that they are not the same set.
Example programs: https://gist.github.com/natebrennand/bf5fc06c23ae98f7c7dd
Dynago:
Authorization: [
AWS4-HMAC-SHA256 Credential=XXXX/20150723/us-west-1/dynamodb/aws4_request,
SignedHeaders=content-type;host;x-amz-date;x-amz-target,
Signature=YYYY
]
X-Amz-Target: [DynamoDB_20120810.DescribeTable]
Content-Type: [application/x-amz-json-1.0]
Host: [dynamodb.us-west-1.amazonaws.com]
X-Amz-Date: [20150723T234215Z]
aws-go:
Authorization: [
AWS4-HMAC-SHA256 Credential=XXXX/20150723/us-west-1/dynamodb/aws4_request,
SignedHeaders=accept-encoding;host;x-amz-date;x-amz-target,
Signature=ZZZZZ
]
X-Amz-Target: [DynamoDB_20120810.DescribeTable]
Content-Type: [application/x-amz-json-1.0]
X-Amz-Date: [20150723T234215Z]
Accept-Encoding: [identity]
Content-Length: [26]
User-Agent: [aws-sdk-go/0.6.7]
X-Amz-Content-Sha256: [WWWWW]
The requests were made in the same second. The signatures in the Authorization header were not identical.
Do you have any advice on how to remedy this?
It would be awesome if support was added to dynamodb transactions in a simple way.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.