From a8caa6e1b359893e99226a8b21f356eee6edd529 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Wed, 28 Oct 2015 11:37:47 -0400 Subject: [PATCH] 5824: Rename cookie to arvados_api_token. --- sdk/go/auth/auth.go | 2 +- services/keep-web/handler.go | 2 +- services/keep-web/handler_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/go/auth/auth.go b/sdk/go/auth/auth.go index 71f4c480f8..ca4eb948b1 100644 --- a/sdk/go/auth/auth.go +++ b/sdk/go/auth/auth.go @@ -68,7 +68,7 @@ func (a *Credentials) LoadTokensFromHTTPRequest(r *http.Request) { } func (a *Credentials) loadTokenFromCookie(r *http.Request) { - cookie, err := r.Cookie("api_token") + cookie, err := r.Cookie("arvados_api_token") if err != nil || len(cookie.Value) == 0 { return } diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go index 9751cd1813..5f546ced69 100644 --- a/services/keep-web/handler.go +++ b/services/keep-web/handler.go @@ -178,7 +178,7 @@ func (h *handler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) { // resulting page. http.SetCookie(w, &http.Cookie{ - Name: "api_token", + Name: "arvados_api_token", Value: auth.EncodeTokenCookie([]byte(t)), Path: "/", Expires: time.Now().AddDate(10, 0, 0), diff --git a/services/keep-web/handler_test.go b/services/keep-web/handler_test.go index 9b5ab2a418..5b2a8256a2 100644 --- a/services/keep-web/handler_test.go +++ b/services/keep-web/handler_test.go @@ -61,7 +61,7 @@ func (s *IntegrationSuite) TestVhostViaCookieValue(c *check.C) { } func authzViaCookieValue(r *http.Request, tok string) int { r.AddCookie(&http.Cookie{ - Name: "api_token", + Name: "arvados_api_token", Value: auth.EncodeTokenCookie([]byte(tok)), }) return http.StatusUnauthorized -- 2.30.2