Bug #6780

[git] "git clone https://..." with a bogus token should respond 4xx, not 5xx

Added by Tom Clegg almost 4 years ago. Updated almost 4 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
Git hosting
Target version:
Start date:
07/28/2015
Due date:
% Done:

0%

Estimated time:
Story points:
0.5

Description

Currently, as verified by tests, arvados-git-httpd returns 500 when the servers are all working perfectly but the client used an invalid token.

Existing test case:

func (s *IntegrationSuite) TestInvalidToken(c *check.C) {
    for _, repo := range []string{"active/foo.git", "active/foo/.git"} {
        err := s.runGit(c, "no-such-token-in-the-system", "fetch", repo)
        c.Assert(err, check.ErrorMatches, `.* 500 while accessing.*`)
    }
}

Observed behavior in production (arvados-git-httpd 0.1.20150714174007.f78434f):

$ git clone http://localhost:9001/foo.git
Cloning into 'foo'...
Username for 'http://localhost:9001': asdf
Password for 'http://asdf@localhost:9001': asdf
fatal: unable to access 'http://localhost:9001/foo.git/': The requested URL returned error: 500

Logged:

2015-07-28_16:05:39.51912 2015/07/28 16:05:39 "[::1]:52434" "asdf" "asdf" 500 "arvados API server error: Not logged in (401: 401 Unauthorized) returned by bogus.arvadosapi.com" "foo" "GET" "/foo.git/info/refs" 
Expected / desired:
  • arv-git-httpd should not return 5xx: this is arv-git-httpd's client's problem to fix, not arv-git-httpd's.
  • Presumably it should pass the 401 status back to the client.
  • The test should be updated to check for a 401 status.

Related issues

Has duplicate Arvados - Bug #6943: [Git hosting] arvados-git-httpd should return 4xx, not 5xx, for authentication errorsDuplicate08/10/2015

History

#1 Updated by Tom Clegg almost 4 years ago

  • Category set to API
  • Target version set to Arvados Future Sprints
  • Story points set to 0.5

#2 Updated by Brett Smith almost 4 years ago

  • Description updated (diff)
  • Category changed from API to Git hosting

Also available in: Atom PDF