[gerrit_util] Use shared SSO logic for SSOAuthenticator

Bug: b/348024314
Change-Id: I1bc9aa297360421fad3fd11b157be3c439f944c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5665454
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
changes/54/5665454/3
Allen Li 1 year ago committed by LUCI CQ
parent ea802a77b7
commit ea366e35f0

@ -344,6 +344,8 @@ class SSOAuthenticator(Authenticator):
def is_applicable(cls, *, conn: Optional[HttpConn] = None) -> bool: def is_applicable(cls, *, conn: Optional[HttpConn] = None) -> bool:
if not cls._resolve_sso_cmd(): if not cls._resolve_sso_cmd():
return False return False
if conn is not None:
return ShouldUseSSO(conn.host)
email = scm.GIT.GetConfig(os.getcwd(), 'user.email', default='') email = scm.GIT.GetConfig(os.getcwd(), 'user.email', default='')
return email.endswith('@google.com') return email.endswith('@google.com')

Loading…
Cancel
Save