Address S113 @ `oidc-exchange.py`

This commit is contained in:
Sviatoslav Sydorenko (Святослав Сидоренко) 2024-05-16 17:38:05 +02:00 committed by GitHub
parent fa6d770e70
commit 411815e640
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -209,7 +209,7 @@ token_exchange_url = f'https://{repository_domain}/_/oidc/mint-token'
# Indices are expected to support `https://{domain}/_/oidc/audience`, # Indices are expected to support `https://{domain}/_/oidc/audience`,
# which tells OIDC exchange clients which audience to use. # which tells OIDC exchange clients which audience to use.
audience_url = f'https://{repository_domain}/_/oidc/audience' audience_url = f'https://{repository_domain}/_/oidc/audience'
audience_resp = requests.get(audience_url) audience_resp = requests.get(audience_url, timeout=5) # S113 wants a timeout
assert_successful_audience_call(audience_resp, repository_domain) assert_successful_audience_call(audience_resp, repository_domain)
oidc_audience = audience_resp.json()['audience'] oidc_audience = audience_resp.json()['audience']
@ -230,6 +230,7 @@ except id.IdentityError as identity_error:
mint_token_resp = requests.post( mint_token_resp = requests.post(
token_exchange_url, token_exchange_url,
json={'token': oidc_token}, json={'token': oidc_token},
timeout=5, # S113 wants a timeout
) )
try: try: