From 9bf0c15afb6617eadb6f36e11d6332a585c37c05 Mon Sep 17 00:00:00 2001 From: Malte Poll <1780588+malt3@users.noreply.github.com> Date: Fri, 3 Jan 2025 09:05:01 +0100 Subject: [PATCH] oci_pull: add setting for disabling token retrieval in rules_oci This is helpful when using an external credential helper (via --credential_helper). --- oci/private/authn.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/oci/private/authn.bzl b/oci/private/authn.bzl index eb01388f..a8c17f03 100644 --- a/oci/private/authn.bzl +++ b/oci/private/authn.bzl @@ -275,6 +275,8 @@ To enable this feature, add `common --repo_env=OCI_ENABLE_OAUTH2_SUPPORT=1` to t """ def _get_token(rctx, state, registry, repository): + if rctx.os.environ.get("OCI_DISABLE_GET_TOKEN"): + return {} pattern = _get_auth(rctx, state, registry) for registry_pattern in _WWW_AUTH.keys():