CocoaPods / cocoapods-downloader

A small library that provides downloaders for various source types (HTTP/SVN/Git/Mercurial)
MIT License
84 stars 71 forks source link

Download file from a private S3 bucket #63

Open azalan opened 7 years ago

azalan commented 7 years ago

We have private pods which references to vendored_frameworks stored on a private Amazon S3 bucket. We do not want to make these files public, so we have to provide the necessary authentication information to Amazon.

Currently curl does not support Amazon authentication (.netrc seems to be insufficient for this) and they do not plan to add support for it. Amazon has an authentication tool for curl, which is a Perl wrapper around curl and cannot be applied to our scenario. We could also add the necessary information as url query parameters in the podspec, but it is not an option as well.

Based on the amazon docs, support requires to add a per-request Authorization header (it contains the request hash signed with the AWS secret).

What would be the best way to add support for this?

benasher44 commented 7 years ago

I would probably start with a plugin, since you'll probably want to use some kind of gem to help with the S3 legwork. https://github.com/CocoaPods/cocoapods-plugins

sealz commented 7 years ago

@azalan Any luck with this? I am facing the same problem and based on this thread will look into a plugin that builds the authorization header given supplied AWS credentials.

Edit: @benasher44 After looking into the plugin option I'm a bit confused as to how a plugin could be used here.

The plugin could handle downloading the source from the private s3 bucket using AWS credentials, but what then? What is different about running pod install after having done that? What else does the plugin need to do other than just download the source from the private s3 bucket?

Ultimately I would love to be able to use source files in a private s3 bucket and just type pod install (or very similar.)

Thanks!

samuelabreu commented 4 years ago

To everyone landing here, I did a plug-in to this scenario: https://github.com/samuelabreu/cocoapods-s3-download