Skip to content

Commit 6ac94b8

Browse files
refactor: remove CI/CD environment references from OIDC code
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1531232 commit 6ac94b8

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

cloudsmith_cli/cli/decorators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def resolve_credentials(f):
313313
default=None,
314314
is_flag=True,
315315
envvar="CLOUDSMITH_OIDC_DISCOVERY_DISABLED",
316-
help="Disable OIDC auto-discovery in CI/CD environments.",
316+
help="Disable OIDC auto-discovery.",
317317
)
318318
@click.pass_context
319319
@functools.wraps(f)

cloudsmith_cli/core/credentials/oidc/detectors/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""CI/CD environment detectors for OIDC token retrieval."""
1+
"""Environment detectors for OIDC token retrieval."""
22

33
from __future__ import annotations
44

@@ -27,7 +27,7 @@ def detect_environment(
2727
try:
2828
if detector.detect():
2929
if context.debug:
30-
logger.debug("Detected CI/CD environment: %s", detector.name)
30+
logger.debug("Detected OIDC environment: %s", detector.name)
3131
return detector
3232
except Exception: # pylint: disable=broad-exception-caught
3333
logger.debug(
@@ -38,5 +38,5 @@ def detect_environment(
3838
continue
3939

4040
if context.debug:
41-
logger.debug("No CI/CD environment detected for OIDC")
41+
logger.debug("No supported OIDC environment detected")
4242
return None

cloudsmith_cli/core/credentials/oidc/detectors/base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Base class and utilities for CI/CD environment OIDC detectors."""
1+
"""Base class and utilities for OIDC environment detectors."""
22

33
from __future__ import annotations
44

@@ -9,15 +9,15 @@
99

1010

1111
class EnvironmentDetector:
12-
"""Base class for CI/CD environment detectors."""
12+
"""Base class for OIDC environment detectors."""
1313

1414
name: str = "base"
1515

1616
def __init__(self, context: CredentialContext):
1717
self.context = context
1818

1919
def detect(self) -> bool:
20-
"""Return True if running in this CI/CD environment."""
20+
"""Return True if running in a supported OIDC environment."""
2121
raise NotImplementedError
2222

2323
def get_token(self) -> str:

cloudsmith_cli/core/credentials/oidc/exchange.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Cloudsmith OIDC token exchange.
22
3-
Exchanges a vendor CI/CD OIDC JWT for a short-lived Cloudsmith API token
3+
Exchanges a vendor OIDC JWT for a short-lived Cloudsmith API token
44
via the POST /openid/{org}/ endpoint.
55
66
References:

cloudsmith_cli/core/credentials/providers/oidc_provider.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""OIDC credential provider for CI/CD environments."""
1+
"""OIDC credential provider."""
22

33
from __future__ import annotations
44

@@ -10,11 +10,11 @@
1010

1111

1212
class OidcProvider(CredentialProvider):
13-
"""Resolves credentials via OIDC auto-discovery in CI/CD environments.
13+
"""Resolves credentials via OIDC auto-discovery.
1414
1515
Requires CLOUDSMITH_ORG and CLOUDSMITH_SERVICE_SLUG to be set (via env
16-
vars or click options). Auto-detects the CI/CD environment, fetches the
17-
vendor OIDC JWT, and exchanges it for a short-lived Cloudsmith API token.
16+
vars or click options). Auto-detects the environment, fetches the vendor
17+
OIDC JWT, and exchanges it for a short-lived Cloudsmith API token.
1818
"""
1919

2020
name = "oidc"
@@ -61,7 +61,9 @@ def resolve( # pylint: disable=too-many-return-statements
6161
detector = detect_environment(context=context)
6262
if detector is None:
6363
if context.debug:
64-
logger.debug("OidcProvider: No CI/CD environment detected, skipping")
64+
logger.debug(
65+
"OidcProvider: No supported OIDC environment detected, skipping"
66+
)
6567
return None
6668

6769
try:

0 commit comments

Comments
 (0)