Skip to content

Commit c931998

Browse files
feat: register GCPDetector in the OIDC detector chain
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2150dac commit c931998

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
from .aws import AWSDetector
99
from .base import EnvironmentDetector
10+
from .gcp import GCPDetector
1011
from .generic import GenericDetector
1112

1213
if TYPE_CHECKING:
@@ -16,6 +17,7 @@
1617

1718
_DETECTORS: list[type[EnvironmentDetector]] = [
1819
AWSDetector,
20+
GCPDetector,
1921
GenericDetector,
2022
]
2123

cloudsmith_cli/core/tests/test_gcp_detector.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,3 +159,14 @@ def test_raises_when_adc_has_no_id_token(self):
159159
get.side_effect = requests.exceptions.ConnectionError()
160160
with pytest.raises(ValueError):
161161
make_detector().get_token()
162+
163+
164+
class TestRegistration:
165+
def test_registered_between_aws_and_generic(self):
166+
from cloudsmith_cli.core.credentials.oidc.detectors import (
167+
_DETECTORS,
168+
AWSDetector,
169+
GenericDetector,
170+
)
171+
172+
assert _DETECTORS == [AWSDetector, GCPDetector, GenericDetector]

0 commit comments

Comments
 (0)