From d01d57e62f8efa719dbe6bdc0a6bc789dbb4a092 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Mon, 11 Sep 2023 17:33:33 +0200 Subject: [PATCH] protondrive: handle the empty credential case when reading from the config cache --- backend/protondrive/protondrive.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/backend/protondrive/protondrive.go b/backend/protondrive/protondrive.go index d82575aa6..6cbde1bd3 100644 --- a/backend/protondrive/protondrive.go +++ b/backend/protondrive/protondrive.go @@ -271,18 +271,34 @@ func getConfigMap(m configmap.Mapper) (uid, accessToken, refreshToken, saltedKey if accessToken, ok = m.Get(clientAccessTokenKey); !ok { return } + if len(accessToken) == 0 { + ok = false + return + } if uid, ok = m.Get(clientUIDKey); !ok { return } + if len(uid) == 0 { + ok = false + return + } if refreshToken, ok = m.Get(clientRefreshTokenKey); !ok { return } + if len(refreshToken) == 0 { + ok = false + return + } if saltedKeyPass, ok = m.Get(clientSaltedKeyPassKey); !ok { return } + if len(saltedKeyPass) == 0 { + ok = false + return + } _saltedKeyPass = saltedKeyPass return