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

Signing into rubygems is broken #343

Closed
qrush opened this issue Sep 1, 2011 · 8 comments
Closed

Signing into rubygems is broken #343

qrush opened this issue Sep 1, 2011 · 8 comments

Comments

@qrush
Copy link
Member

qrush commented Sep 1, 2011

% gem owner gemcutter
Enter your RubyGems.org credentials.
Don't have an account yet? Create one at http://rubygems.org/sign_up
   Email:   nick@quaran.to
Password:   
Pushing gem to https://rubygems.org...
Signed in.
Pushing gem to https://rubygems.org...
Access Denied. Please sign up for an account at http://rubygems.org

% more ~/.gem/credentials                                 

---
:rubygems_api_key: ! '{"rubygems_api_key":"api key"}'

:(

@gorenje
Copy link

gorenje commented Sep 1, 2011

is this related to rubygems/rubygems#172 ?

@abuiles
Copy link

abuiles commented Sep 1, 2011

@qrush I checked the response from https://rubygems.org/api/v1/api_key and it looks correct, then the problem should be in rubygems and not in gemcutter (as mentioned by @gorenje).

@sferik
Copy link
Member

sferik commented Sep 1, 2011

@gorenje Yes, this is the same issue. It was caused by a refactoring made in 5a067cc.

@abuiles In fact, this is a bug in RubyGems.org (a.k.a Gemcutter) not the rubygems CLI. The problem is that the behavior is non-deterministic, varying based on the client's Accept header. If you request https://rubygems.org/api/v1/api_key in your browser, it will (probably) return just your API key, since your browser (probably) includes text/html in your Accept header. However, if you try making the same request via curl (or via rubygems):

curl -u username:password http://rubygems.org/api/v1/api_key

You'll (probably) get a JSON response.

I'm in the process of reverting 5a067cc now and deploying a hotfix.

@abuiles
Copy link

abuiles commented Sep 1, 2011

@sferik ha indeed with curl I get json ;( . something I can help with?.

@sferik sferik closed this as completed Sep 1, 2011
@sferik
Copy link
Member

sferik commented Sep 1, 2011

@abuiles Thanks for offering to help. I just committed a fix. Working on deploying that to staging now, and then to production.

@abuiles
Copy link

abuiles commented Sep 1, 2011

@sferik actually sounds like a good idea to start using json points explicitly in rubygems CLI, so this kind of stuff won't happen again.

@sferik
Copy link
Member

sferik commented Sep 2, 2011

@abuiles I'd make the case that rubygems should simply use the YAML response format for creating ~/.gem/credentials files. No parsing or mucking required.

It wasn't implemented that way originally is because I only recently added the YAML response format to the API in 0c9fbcb.

@abuiles
Copy link

abuiles commented Sep 2, 2011

@sferik yeap makes sense, my point was about being explicit about the expect format, call it YAML or JSON.

cmeiklejohn pushed a commit to cmeiklejohn/rubygems.org that referenced this issue Sep 6, 2011
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

No branches or pull requests

4 participants