Browse Source

[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>
Allen Li 1 năm trước cách đây
mục cha
commit
ea366e35f0
1 tập tin đã thay đổi với 2 bổ sung0 xóa
  1. 2 0
      gerrit_util.py

+ 2 - 0
gerrit_util.py

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