{"action":"created","issue":{"url":"https://api.github.com/repos/samtools/htslib/issues/303","labels_url":"https://api.github.com/repos/samtools/htslib/issues/303/labels{/name}","comments_url":"https://api.github.com/repos/samtools/htslib/issues/303/comments","events_url":"https://api.github.com/repos/samtools/htslib/issues/303/events","html_url":"https://github.com/samtools/htslib/pull/303","id":118626695,"number":303,"title":"Support config files and temporary credentials for S3 URLs","user":{"login":"jmarshall","id":70921,"avatar_url":"https://avatars.githubusercontent.com/u/70921?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarshall","html_url":"https://github.com/jmarshall","followers_url":"https://api.github.com/users/jmarshall/followers","following_url":"https://api.github.com/users/jmarshall/following{/other_user}","gists_url":"https://api.github.com/users/jmarshall/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarshall/subscriptions","organizations_url":"https://api.github.com/users/jmarshall/orgs","repos_url":"https://api.github.com/users/jmarshall/repos","events_url":"https://api.github.com/users/jmarshall/events{/privacy}","received_events_url":"https://api.github.com/users/jmarshall/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/samtools/htslib/milestones/5","html_url":"https://github.com/samtools/htslib/milestones/1.3","labels_url":"https://api.github.com/repos/samtools/htslib/milestones/5/labels","id":953251,"number":5,"title":"1.3","description":"","creator":{"login":"jmarshall","id":70921,"avatar_url":"https://avatars.githubusercontent.com/u/70921?v=3","gravatar_id":"","url":"https://api.github.com/users/jmarshall","html_url":"https://github.com/jmarshall","followers_url":"https://api.github.com/users/jmarshall/followers","following_url":"https://api.github.com/users/jmarshall/following{/other_user}","gists_url":"https://api.github.com/users/jmarshall/gists{/gist_id}","starred_url":"https://api.github.com/users/jmarshall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmarshall/subscriptions","organizations_url":"https://api.github.com/users/jmarshall/orgs","repos_url":"https://api.github.com/users/jmarshall/repos","events_url":"https://api.github.com/users/jmarshall/events{/privacy}","received_events_url":"https://api.github.com/users/jmarshall/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":12,"state":"open","created_at":"2015-01-27T14:35:29Z","updated_at":"2015-11-30T11:10:38Z","due_on":null,"closed_at":null},"comments":2,"created_at":"2015-11-24T14:59:08Z","updated_at":"2015-12-03T19:28:57Z","closed_at":"2015-11-30T11:10:38Z","pull_request":{"url":"https://api.github.com/repos/samtools/htslib/pulls/303","html_url":"https://github.com/samtools/htslib/pull/303","diff_url":"https://github.com/samtools/htslib/pull/303.diff","patch_url":"https://github.com/samtools/htslib/pull/303.patch"},"body":"Handles temporary credentials specified in the URL (as `s3://ID:SECRET:TOKEN@bucket/...`), via $AWS_SESSION_TOKEN, or as specified in a configuration file.\r\n\r\nReads credentials from the URL, via the usual environment variables, from [~/.aws/credentials](https://blogs.aws.amazon.com/security/post/Tx3D6U6WSFGOK2H/A-New-and-Standardized-Way-to-Manage-Credentials-in-the-AWS-SDKs), from [~/.s3cfg](http://s3tools.org/kb/item14.htm), or from [~/.awssecret](http://timkay.com/aws/)."},"comment":{"url":"https://api.github.com/repos/samtools/htslib/issues/comments/161754908","html_url":"https://github.com/samtools/htslib/pull/303#issuecomment-161754908","issue_url":"https://api.github.com/repos/samtools/htslib/issues/303","id":161754908,"user":{"login":"obenshaindw","id":5313081,"avatar_url":"https://avatars.githubusercontent.com/u/5313081?v=3","gravatar_id":"","url":"https://api.github.com/users/obenshaindw","html_url":"https://github.com/obenshaindw","followers_url":"https://api.github.com/users/obenshaindw/followers","following_url":"https://api.github.com/users/obenshaindw/following{/other_user}","gists_url":"https://api.github.com/users/obenshaindw/gists{/gist_id}","starred_url":"https://api.github.com/users/obenshaindw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obenshaindw/subscriptions","organizations_url":"https://api.github.com/users/obenshaindw/orgs","repos_url":"https://api.github.com/users/obenshaindw/repos","events_url":"https://api.github.com/users/obenshaindw/events{/privacy}","received_events_url":"https://api.github.com/users/obenshaindw/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T19:28:57Z","updated_at":"2015-12-03T19:28:57Z","body":"@jmarshall and @DonFreed: the lifetime of a session token can be controlled but Don's cited use case for this (National Database for Autism Research) have tokens lasting ~ 24 hours.  You either have a long-term key pair (i.e., key, secret key) or temporary credentials (key, secret key, and token) and the two can't be mixed.\r\n\r\nBoth s3cmd and aws command-line use boto and provide support for using multiple config files or profiles, respectively.  This enables a user to use a set of keys (i.e., their own AWS credentials) for some things and use a different set of credentials for other purposes.  I suppose htslib will just look in the default config/profile, respectively?\r\n\r\n**This may be a corner case for htslib, but I thought it might be worth mentioning**:\r\nIn addition to the use case where a session token is provided as part of a Federated access model, probably the more common use case is for [using IAM roles in combination with EC2 instances](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_switch-role-ec2.html). Briefly, this makes temporary credentials available to the instance at a local IP address obviating the need to ever put long term security credentials on an instance.  [s3cmd](https://github.com/s3tools/s3cmd) supports this method of key delivery and will 'look' for the availability of these keys out of the box."}}