Merge branch '5416-arv-git-httpd' refs #5416
[arvados.git] / services / arv-git-httpd / auth_handler.go
index f182bca583cf206480ff9f8256a8ffbb8f22743d..f91ed3f8c087c8cc987a05f2cc6779b8c34255d1 100644 (file)
@@ -13,10 +13,6 @@ import (
 )
 
 func newArvadosClient() interface{} {
-       // MakeArvadosClient returns an error if token is unset (even
-       // though we don't need to do anything requiring
-       // authentication yet).
-       os.Setenv("ARVADOS_API_TOKEN", "xxx")
        arv, err := arvadosclient.MakeArvadosClient()
        if err != nil {
                log.Println("MakeArvadosClient:", err)
@@ -61,7 +57,7 @@ func (h *authHandler) ServeHTTP(wOrig http.ResponseWriter, r *http.Request) {
 
        // HTTP request username is logged, but unused. Password is an
        // Arvados API token.
-       username, password, ok := r.BasicAuth()
+       username, password, ok := BasicAuth(r)
        if !ok || username == "" || password == "" {
                statusCode, statusText = http.StatusUnauthorized, "no credentials provided"
                w.Header().Add("WWW-Authenticate", "basic")