[ARVADOS] updated: 2.1.0-110-g17ef0d07a

Git user git at public.arvados.org
Tue Dec 1 17:32:36 UTC 2020


Summary of changes:
 lib/controller/federation/conn.go | 2 +-
 lib/controller/federation_test.go | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

       via  17ef0d07a7671fb3dab8ee9b40b945ac035f89b8 (commit)
      from  53a45d3d128d86828d76ef95a0877a93d837a209 (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 17ef0d07a7671fb3dab8ee9b40b945ac035f89b8
Author: Tom Clegg <tom at tomclegg.ca>
Date:   Tue Dec 1 12:14:16 2020 -0500

    17014: Add mock response to users/current.
    
    Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom at tomclegg.ca>

diff --git a/lib/controller/federation/conn.go b/lib/controller/federation/conn.go
index 7cbf4f8eb..e99afc251 100644
--- a/lib/controller/federation/conn.go
+++ b/lib/controller/federation/conn.go
@@ -360,7 +360,7 @@ func (conn *Conn) ContainerRequestCreate(ctx context.Context, options arvados.Cr
 		if err != nil {
 			return arvados.ContainerRequest{}, err
 		}
-		if len(aca.Scopes) != 0 || aca.Scopes[0] != "all" {
+		if len(aca.Scopes) == 0 || aca.Scopes[0] != "all" {
 			return arvados.ContainerRequest{}, httpErrorf(http.StatusForbidden, "token scope is not [all]")
 		}
 		if strings.HasPrefix(aca.UUID, conn.cluster.ClusterID) {
diff --git a/lib/controller/federation_test.go b/lib/controller/federation_test.go
index aa37e3328..9cc9859b6 100644
--- a/lib/controller/federation_test.go
+++ b/lib/controller/federation_test.go
@@ -352,7 +352,13 @@ func (s *FederationSuite) localServiceReturns404(c *check.C) *httpserver.Server
 	return s.localServiceHandler(c, http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
 		if req.URL.Path == "/arvados/v1/api_client_authorizations/current" {
 			if req.Header.Get("Authorization") == "Bearer "+arvadostest.ActiveToken {
-				json.NewEncoder(w).Encode(arvados.APIClientAuthorization{UUID: arvadostest.ActiveTokenUUID, APIToken: arvadostest.ActiveToken})
+				json.NewEncoder(w).Encode(arvados.APIClientAuthorization{UUID: arvadostest.ActiveTokenUUID, APIToken: arvadostest.ActiveToken, Scopes: []string{"all"}})
+			} else {
+				w.WriteHeader(http.StatusUnauthorized)
+			}
+		} else if req.URL.Path == "/arvados/v1/users/current" {
+			if req.Header.Get("Authorization") == "Bearer "+arvadostest.ActiveToken {
+				json.NewEncoder(w).Encode(arvados.User{UUID: arvadostest.ActiveUserUUID})
 			} else {
 				w.WriteHeader(http.StatusUnauthorized)
 			}

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list