Also configure source.developers.google.com
Support both googlesource.com and Google Cloud Source Repositories
as they now both accept tokens from the gerritcodereview scope.
diff --git a/git-cookie-authdaemon b/git-cookie-authdaemon
index 66d7048..9e37004 100755
--- a/git-cookie-authdaemon
+++ b/git-cookie-authdaemon
@@ -52,13 +52,33 @@
def update_cookie(retry):
token = acquire_token(retry)
expires = token['expiresAt']
+ access_token = token['accessToken']
tmp_jar = COOKIE_JAR + '.lock'
cj = cookielib.MozillaCookieJar(tmp_jar)
+
cj.set_cookie(cookielib.Cookie(
version = 0,
name = 'o',
- value = token['accessToken'],
+ value = access_token,
+ port = None,
+ port_specified = False,
+ domain = 'source.developers.google.com',
+ domain_specified = True,
+ domain_initial_dot = False,
+ path = '/',
+ path_specified = True,
+ secure = True,
+ expires = expires,
+ discard = False,
+ comment = None,
+ comment_url = None,
+ rest = None))
+
+ cj.set_cookie(cookielib.Cookie(
+ version = 0,
+ name = 'o',
+ value = access_token,
port = None,
port_specified = False,
domain = '.googlesource.com',
@@ -72,6 +92,7 @@
comment = None,
comment_url = None,
rest = None))
+
cj.save()
os.rename(tmp_jar, COOKIE_JAR)
return expires