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

Cocoapods Podspec Source HTTP Authentication Support #5055

Closed
cosminstirbu opened this issue Mar 18, 2016 · 6 comments
Closed

Cocoapods Podspec Source HTTP Authentication Support #5055

cosminstirbu opened this issue Mar 18, 2016 · 6 comments
Assignees
Labels
s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it

Comments

@cosminstirbu
Copy link

I am looking into setting up a private repo that allows distributing binary .framework files (so no source code) via Cocoapods.

The actual repo will be hosted on a Git server, just like the Cocoapods page suggests and the actual .framework files will be hosted on a different server that would allow accessing the .framework files via HTTPs.

Let's say I add this in the .podspec file:

spec.source           = { :http => 'https://myhostserver.com/Releases/v1.0.0/MyLibrary.framework.zip' }

From reading the documentation it's not clear to me what kind of authentication does Cocoapods support for referencing the .framework file via HTTPs.

I had a look at both

http://guides.cocoapods.org/making/private-cocoapods.html
https://guides.cocoapods.org/syntax/podspec.html#source

P.S. - I know this is not an Issue but I have already posted on Stackoverflow and also in the Google Groups Forum and I didn't receive a response.
I am just trying to find an answer to this as soon as possible. Sorry if this upsets anyone.

@mrackwitz
Copy link
Member

CocoaPods' Downloader is using CURL for downloading files under the hood. If you want to use HTTP, you can setup your authentication credentials in the ~/.netrc file.

@cosminstirbu
Copy link
Author

Thank you for your reply.

Unfortunately, I receive a 403 event if I have set my credentials in ~/.netrc

I have used the following command

pod repo push MyRepoName MyFramework.podspec --verbose --allow-warnings

And it produces the following error:

$ /usr/bin/curl -f -L -o /var/folders/x1/ld696pnn7bq6nfwnxlrk8gw00000gp/T/d20160323-15247-1ujke37/file.zip http://jenkins:8080/job/MyFramework/job/iOS_Release/7/artifact/Output/MyFramework.zip --create-dirs
     % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                    Dload  Upload   Total   Spent    Left  Speed

     0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (22) The requested URL returned error: 403 Forbidden

[!] Error installing MyFramework

However if I run the above curl command by also adding the -n option (--netrc) it works.
So I think the way Cocoapods calls curl under the hood doesn't work for me :(

The version of Cocoapods that I'm using is 0.39.0
Please help!

@mrackwitz
Copy link
Member

Whoops! It doesn't seem like the downloader actually passed the option -n. I think, it would make sense to do that by default.

@mrackwitz mrackwitz reopened this Mar 24, 2016
@mrackwitz mrackwitz added t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it s2:confirmed Issues that have been confirmed by a CocoaPods contributor labels Mar 24, 2016
@mrackwitz
Copy link
Member

As a workaround for now, you might want to create a .curlrc file where you set the option -n by default.

@cosminstirbu
Copy link
Author

I have ended up creating a separate Git repository and I use as source_url the git repository where I host the .framework and the html documentation as resources.

@segiddins segiddins added s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member and removed s2:confirmed Issues that have been confirmed by a CocoaPods contributor labels Apr 1, 2016
@eugenebiryukov
Copy link

eugenebiryukov commented May 31, 2018

Hello! Is there any way to make cocoapods available to ask for credentials in the installation process, without using the .netrc-file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s4:awaiting validation A Pull Request that is waiting for validation by a CocoaPods Core Team member t1:enhancement Enhancements that have not been picked up yet. Please comment if you plan to work on it
Projects
None yet
Development

No branches or pull requests

4 participants