Signing into rubygems is broken #343

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

Comments

Projects
None yet
4 participants
Owner

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 commented Sep 1, 2011

is this related to rubygems/rubygems#172 ?

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).

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 commented Sep 1, 2011

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

@sferik sferik closed this Sep 1, 2011

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 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.

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 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