Преглед на файлове

[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 година
родител
ревизия
ea366e35f0
променени са 1 файла, в които са добавени 2 реда и са изтрити 0 реда
  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:
     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')