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

non amazonaws endpoint support (+ force PATH_STYLE) #506

Closed
wants to merge 1 commit into from

Conversation

blajoie
Copy link

@blajoie blajoie commented Apr 8, 2017

Hi,

Using the new v1.4 (current master)

It looks like when both ~/.s3cfg and ~/.aws credentials exist, then ~/.aws credentials will be used and ~/.s3cfg will be ignored.

We (@NHJohnson, @egor-dolzhenko) have a need to use the new host_base value extracted from the ~/.s3cfg (for non amazonaws endpoint), but we also do not want to force users to remove/disable ~/.aws credentials (this looks to be the only way to force htslib to always read (host_base) from ~/.s3cfg?)

This PR makes a few changes to hfile_s3.c.

always read from both ~/.s3cfg and ~/.aws/credentials, placing priority on ~/.aws for id/secret/token. This allows host_base to always be extracted and used. We are using a local S3 and specifying a non-amazonaws endpoint is required.

Following the logic outlined here (s3tools/s3cmd#416), we also have the need to always force PATH_STYLE over VIRTUAL_STYLE urls. Our s3 resource does not support VIRTUAL_STYLE urls. To achieve this, a user can set host_base and host_bucket to be equal, which then forces PATH_STYLE urls within htslib.

Any feedback is welcomed!

Thanks

…t_base to always be extracted if both config exist, added support to force LOCAL_STYLE paths over VIRTUAL_STYLE paths
@jmarshall
Copy link
Member

This is the wrong approach. Mixing configuration settings from the two config files will rapidly become incomprehensible. The correct approach is to give up waiting for aws-cli upstream and define an equivalent of host_base in ~/.aws/credentials ourselves — this is #436.

OTOH a way to force path-style v. virtual-style is a good idea.

@blajoie
Copy link
Author

blajoie commented Apr 11, 2017

Agreed completely - Glad we are done waiting for the upstream awscli fix :)

I would much rather define the equivalent of a host_base in the ~/.aws/credentials, perhaps even a flag within ~/.aws/credentials to force_path_style, url_mode=path/virtual?

Ideally host_base/url_mode would be set per profile, not global as it appears to be within ~/.s3cfg.

Thanks!

@jmarshall
Copy link
Member

Likewise agreed. We've tried hard to use existing keys in ~/.aws/credentials and ~/.s3cfg (perhaps too hard in the case of endpoint_url!), so will look at what existing facilities to (ab)use for this path/virtual forcing.

HTSlib supports profiles in both these config files. Just put the settings in a [fooprofile] section instead of [default] and specify the profile to use in one of the usual ways. See recent comment on #436 for more details.

@blajoie
Copy link
Author

blajoie commented Apr 14, 2017

Closing this as the better solution is to instead add a new param to ~/.aws/credentials
#436

@blajoie blajoie closed this Apr 14, 2017
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.

4 participants