[gerrit_util] Add newauth.py helper
These checks will be needed in git_cl.py and probably other places. Make it easy to change the default to opt-in as some point (and for deletion later). Bug: b/348024314 Change-Id: I768986e47ec2e86604268d74ca2b632458263bba Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641084 Commit-Queue: Allen Li <ayatane@chromium.org> Reviewed-by: Gavin Mak <gavinmak@google.com>changes/84/5641084/7
parent
e5490cc303
commit
fa1bba51d7
@ -0,0 +1,20 @@
|
||||
# Copyright (c) 2024 The Chromium Authors. All rights reserved.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
"""Defines common conditions for the new auth stack migration."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
|
||||
import scm
|
||||
|
||||
|
||||
def Enabled() -> bool:
|
||||
"""Returns True if new auth stack is enabled."""
|
||||
return scm.GIT.GetConfig(os.getcwd(), 'depot-tools.usenewauthstack') == '1'
|
||||
|
||||
|
||||
def SkipSSO() -> bool:
|
||||
"""Returns True if skip SSO is set."""
|
||||
return scm.GIT.GetConfig(os.getcwd(), 'depot-tools.newauthskipsso') == '1'
|
Loading…
Reference in New Issue