-
Notifications
You must be signed in to change notification settings - Fork 241
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
Add support for S3 #3
Conversation
return "s3::" + url.String(), true, nil | ||
} | ||
|
||
// func (d *S3Detector) detectSSH(src string) (string, bool, error) { |
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.
looks like this was left over from a copy-paste
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.
Removing now, thanks.
Hey @dancannon – great start!
Is that expected, because I don't have access to that URL? It sounds like an invalid URL, not just a permissions thing |
It sounds like something else is going on, could you please paste a sample URL that has the same format? |
This is the test and url that's failing The URL is cUrl suggest the url itself is fine:
|
Ah sorry about that!! I had added some more validation which wasnt quite correct. The tests should pass now. |
) | ||
|
||
const ( | ||
vhostFormat = "" |
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.
Unused constant, remove?
The only thing that appears to be missing is loading credentials from environment, profile, etc. The AWS SDK does this for you but you have to make sure to just enable the credential lookup thing. If you already do this and I missed it or you need more guidance, let me know. Your tests look great. |
Thanks for looking at this so quickly, regarding the AWS credentials I was under the impression that if you dont pass any Credentials to the config then DefaultChainCredentials is used by default which looks up the credentials. Also I tested this code with a private S3 bucket and it seemed to pick up the credentials. If this is incorrect let me know and I will look into it again. |
We should explicitly setup the credential chain. By using |
9a46df2
to
fb2986d
Compare
I have made the suggested change, however now that you had added CI the tests are failing as travis does not have any AWS credentials. Have you got any ideas for how we could fix this? |
I'll take a look locally. Thanks! |
Co-authored-by: Kent 'picat' Gruber <kent@hashicorp.com>
As discussed in #2 I have worked on adding support for S3, I have also included the features requested in the mentioned ticket, to summarise this adds the following features:
BUCKET.s3.amazonaws.com/PATH
BUCKET.s3-REGION.amazonaws.com/PATH
s3.amazonaws.com/BUCKET/PATH
s3-REGION.amazonaws.com/BUCKET/PATH
GetFile
). For example:s3-REGION.amazonaws.com/BUCKET/PATH?aws_access_key_id=foo&aws_access_key_secret=bar&aws_access_token=baz
s3-REGION.amazonaws.com/BUCKET/PATH?version=1234
Get
all files with the given prefix are fetched and stored in the destination path relative to the given prefixGetFile
fetches the given file from S3 and is stored at the destination path. As mentioned it is also possible to fetch a versioned S3 object.If you have any further questions/feature suggestions let me know, thanks.