Skip to content

Commit

Permalink
chore(gcp): update docstring of ADC credentials (#5879)
Browse files Browse the repository at this point in the history
Co-authored-by: Sergio Garcia <hello@mistercloudsec.com>
  • Loading branch information
prowler-bot and MrCloudSec authored Nov 25, 2024
1 parent 3ce785a commit 94b6fbd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions prowler/providers/gcp/gcp_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,17 +417,17 @@ def test_connection(
GCPTestConnectionError if an error occurs during the test connection
Usage:
- Using static credentials:
- Using ADC credentials from `/Users/<user>/.config/gcloud/application_default_credentials.json`:
>>> GcpProvider.test_connection(
... client_id="client_id",
... client_secret="client_secret",
... refresh_token="refresh_token"
... )
- Using a credentials file:
- Using a Service Account credentials file path:
>>> GcpProvider.test_connection(
... credentials_file="credentials_file"
... )
- Using a service account to impersonate, authentication is required to impersonate a service account:
- Using ADC credentials with a Service Account to impersonate:
>>> GcpProvider.test_connection(
... client_id="client_id",
... client_secret="client_secret",
Expand All @@ -436,7 +436,7 @@ def test_connection(
... )
"""
try:
# Set the GCP credentials using the provided client_id, client_secret and refresh_token
# Set the GCP credentials using the provided client_id, client_secret and refresh_token from ADC
gcp_credentials = None
if any([client_id, client_secret, refresh_token]):
gcp_credentials = GcpProvider.validate_static_arguments(
Expand Down Expand Up @@ -738,7 +738,7 @@ def validate_static_arguments(
client_id: str = None, client_secret: str = None, refresh_token: str = None
) -> dict:
"""
Validate the static arguments client_id, client_secret and refresh_token
Validate the static arguments client_id, client_secret and refresh_token of ADC credentials
Args:
client_id: str
Expand All @@ -749,7 +749,7 @@ def validate_static_arguments(
dict
Raises:
GCPStaticCredentialsError if any of the static arguments is missing
GCPStaticCredentialsError if any of the static arguments is missing from the ADC credentials
Usage:
>>> GcpProvider.validate_static_arguments(client_id, client_secret, refresh_token)
Expand Down

0 comments on commit 94b6fbd

Please # to comment.