[ARVADOS] updated: 70ddebda3dbe90c8a347c9077397106c6fb949c0
git at public.curoverse.com
git at public.curoverse.com
Mon Aug 10 14:37:29 EDT 2015
Summary of changes:
.../install-crunch-dispatch.html.textile.liquid | 36 +++++++++++-----------
doc/install/install-keepproxy.html.textile.liquid | 11 +++++--
services/arv-git-httpd/auth_handler.go | 8 +++--
services/arv-git-httpd/server_test.go | 6 ++--
4 files changed, 34 insertions(+), 27 deletions(-)
via 70ddebda3dbe90c8a347c9077397106c6fb949c0 (commit)
via a6edcb025f0b659e464fd3e98e59e966ced88afd (commit)
via f618b6517fff37194a1a4183a607658f46952732 (commit)
via 2d9cae58ae387d29d161ea96b6cd704d0764b1d8 (commit)
from ae2478d6d09d2ab2eac1acceab8342f4f900ec8b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 70ddebda3dbe90c8a347c9077397106c6fb949c0
Author: radhika <radhika at curoverse.com>
Date: Mon Aug 10 14:20:25 2015 -0400
6827: set validApiToken flag after ensuring that getting list of repositories work with the given credentials.
diff --git a/services/arv-git-httpd/auth_handler.go b/services/arv-git-httpd/auth_handler.go
index b284f19..89d942a 100644
--- a/services/arv-git-httpd/auth_handler.go
+++ b/services/arv-git-httpd/auth_handler.go
@@ -43,6 +43,7 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
var username, password string
var repoName string
var wroteStatus int
+ var validApiToken bool
w := spyingResponseWriter{wOrig, &wroteStatus}
@@ -53,10 +54,10 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
w.Write([]byte(statusText))
}
- // If the given password is a valid token, log the first 10 characters of the token.
- // Otherwise: log the string <invalid> if a password is given, else an empty string.
+ // If the given password is a valid token, log the first 10 characters of the token.
+ // Otherwise: log the string <invalid> if a password is given, else an empty string.
passwordToLog := ""
- if statusCode == 401 || strings.Contains(statusText, "Unauthorized") {
+ if !validApiToken {
if len(password) > 0 {
passwordToLog = "<invalid>"
}
@@ -102,6 +103,7 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
"filters": [][]string{{"name", "=", repoName}},
}, &reposFound); err != nil {
statusCode, statusText = http.StatusInternalServerError, err.Error()
+ validApiToken = true
return
}
if avail, ok := reposFound["items_available"].(float64); !ok {
diff --git a/services/arv-git-httpd/server_test.go b/services/arv-git-httpd/server_test.go
index 79cb5fc..9d36921 100644
--- a/services/arv-git-httpd/server_test.go
+++ b/services/arv-git-httpd/server_test.go
@@ -81,21 +81,21 @@ func (s *IntegrationSuite) TestExpiredToken(c *check.C) {
func (s *IntegrationSuite) TestInvalidToken(c *check.C) {
for _, repo := range []string{"active/foo.git", "active/foo/.git"} {
err := s.runGit(c, "s3cr3tp at ssw0rd", "fetch", repo)
- c.Assert(err, check.ErrorMatches, `.* 500 while accessing.*`)
+ c.Assert(err, check.ErrorMatches, `.* requested URL returned error.*`)
}
}
func (s *IntegrationSuite) TestShortToken(c *check.C) {
for _, repo := range []string{"active/foo.git", "active/foo/.git"} {
err := s.runGit(c, "s3cr3t", "fetch", repo)
- c.Assert(err, check.ErrorMatches, `.* 500 while accessing.*`)
+ c.Assert(err, check.ErrorMatches, `.* Authentication failed.*`)
}
}
func (s *IntegrationSuite) TestShortTokenBadReq(c *check.C) {
for _, repo := range []string{"bogus"} {
err := s.runGit(c, "s3cr3t", "fetch", repo)
- c.Assert(err, check.ErrorMatches, `.* 500 while accessing.*`)
+ c.Assert(err, check.ErrorMatches, `.* requested URL returned error.*`)
}
}
commit a6edcb025f0b659e464fd3e98e59e966ced88afd
Merge: ae2478d f618b65
Author: radhika <radhika at curoverse.com>
Date: Mon Aug 10 14:19:07 2015 -0400
Merge branch 'master' into 6827-short-token
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list