[ARVADOS] updated: 2.1.0-540-ge4749e741

Git user git at public.arvados.org
Fri Apr 2 14:44:50 UTC 2021


Summary of changes:
 lib/controller/localdb/login_testuser.go | 6 +++++-
 lib/controller/localdb/logout.go         | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

       via  e4749e7414f47464218fddc2315c21250efee634 (commit)
      from  64e4f759884fadc7fb3b984eb773a1dd89b7848f (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 e4749e7414f47464218fddc2315c21250efee634
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Fri Apr 2 11:44:14 2021 -0300

    16159: Adds error logging on token expiration failure. Fixes SQL query.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/lib/controller/localdb/login_testuser.go b/lib/controller/localdb/login_testuser.go
index e2f38f35b..7bb620baa 100644
--- a/lib/controller/localdb/login_testuser.go
+++ b/lib/controller/localdb/login_testuser.go
@@ -7,12 +7,15 @@ package localdb
 import (
 	"bytes"
 	"context"
+	"errors"
 	"fmt"
 	"html/template"
+	"net/http"
 
 	"git.arvados.org/arvados.git/lib/controller/rpc"
 	"git.arvados.org/arvados.git/sdk/go/arvados"
 	"git.arvados.org/arvados.git/sdk/go/ctxlog"
+	"git.arvados.org/arvados.git/sdk/go/httpserver"
 	"github.com/sirupsen/logrus"
 )
 
@@ -24,7 +27,8 @@ type testLoginController struct {
 func (ctrl *testLoginController) Logout(ctx context.Context, opts arvados.LogoutOptions) (arvados.LogoutResponse, error) {
 	err := ctrl.Parent.expireAPIClientAuthorization(ctx)
 	if err != nil {
-		return arvados.LogoutResponse{}, err
+		ctxlog.FromContext(ctx).Errorf("attempting to expire token on logout: %q", err)
+		return arvados.LogoutResponse{}, httpserver.ErrorWithStatus(errors.New("could not expire token on logout"), http.StatusInternalServerError)
 	}
 	return noopLogout(ctrl.Cluster, opts)
 }
diff --git a/lib/controller/localdb/logout.go b/lib/controller/localdb/logout.go
index 66089539c..e6b6f6c58 100644
--- a/lib/controller/localdb/logout.go
+++ b/lib/controller/localdb/logout.go
@@ -58,7 +58,7 @@ func (conn *Conn) expireAPIClientAuthorization(ctx context.Context) error {
 		return nil
 	}
 
-	res, err := tx.ExecContext(ctx, "UPDATE api_client_authorizations SET expires_at=current_timestamp AT TIME ZONE 'UTC' WHERE (expires_at IS NULL OR expires_at > current_timestamp AT TIME ZONE 'UTC' AND api_token=$1)", tokenSecret)
+	res, err := tx.ExecContext(ctx, "UPDATE api_client_authorizations SET expires_at=current_timestamp AT TIME ZONE 'UTC' WHERE api_token=$1 AND (expires_at IS NULL OR expires_at > current_timestamp AT TIME ZONE 'UTC')", tokenSecret)
 	if err != nil {
 		return err
 	}

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list