Skip to content

Commit db910ef

Browse files
committed
oidc-exchange, twine-upload: remove more OIDC refs
...but not all, since some make sense in a debugging context. Signed-off-by: William Woodruff <[email protected]>
1 parent 4372cb5 commit db910ef

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

oidc-exchange.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# The top-level error message that gets rendered.
1414
# This message wraps one of the other templates/messages defined below.
1515
_ERROR_SUMMARY_MESSAGE = """
16-
Trusted publisher (OIDC) exchange failure:
16+
Trusted publishing exchange failure:
1717
1818
{message}
1919
@@ -28,7 +28,7 @@
2828

2929
# Rendered if OIDC identity token retrieval fails for any reason.
3030
_TOKEN_RETRIEVAL_FAILED_MESSAGE = """
31-
OIDC token retrieval failed: {identity_error}
31+
OpenID Connect token retrieval failed: {identity_error}
3232
3333
This generally indicates a workflow configuration error, such as insufficient
3434
permissions. Make sure that your workflow has `id-token: write` configured
@@ -71,7 +71,7 @@ def die(msg: str) -> NoReturn:
7171
with _GITHUB_STEP_SUMMARY.open("a", encoding="utf-8") as io:
7272
print(_ERROR_SUMMARY_MESSAGE.format(message=msg), file=io)
7373

74-
print(f"::error::OIDC exchange failure: {msg}", file=sys.stderr)
74+
print(f"::error::trusted publishing exchange failure: {msg}", file=sys.stderr)
7575
sys.exit(1)
7676

7777

@@ -94,12 +94,14 @@ def assert_successful_audience_call(resp: requests.Response, domain: str):
9494
case HTTPStatus.FORBIDDEN:
9595
# This index supports OIDC, but forbids the client from using
9696
# it (either because it's disabled, limited to a beta group, etc.)
97-
die(f"audience retrieval failed: repository at {domain} has OIDC disabled")
97+
die(
98+
f"audience retrieval failed: repository at {domain} has trusted publishing disabled"
99+
)
98100
case HTTPStatus.NOT_FOUND:
99101
# This index does not support OIDC.
100102
die(
101103
"audience retrieval failed: repository at "
102-
f"{domain} does not indicate OIDC support",
104+
f"{domain} does not indicate trusted publishing support",
103105
)
104106
case other:
105107
status = HTTPStatus(other)
@@ -124,7 +126,7 @@ def assert_successful_audience_call(resp: requests.Response, domain: str):
124126

125127
oidc_audience = audience_resp.json()["audience"]
126128

127-
debug(f"selected OIDC token exchange endpoint: {token_exchange_url}")
129+
debug(f"selected trusted publishing exchange endpoint: {token_exchange_url}")
128130

129131
try:
130132
oidc_token = id.detect_credential(audience=oidc_audience)

twine-upload.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if [[ "${INPUT_USER}" == "__token__" && -z "${INPUT_PASSWORD}" ]] ; then
4444
# No password supplied by the user implies that we're in the OIDC flow;
4545
# retrieve the OIDC credential and exchange it for a PyPI API token.
4646
echo \
47-
'::notice::Attempting to perform OIDC credential exchange' \
47+
'::notice::Attempting to perform trusted publishing exchange' \
4848
'to retrieve a temporary short-lived API token for authentication' \
4949
"against ${INPUT_REPOSITORY_URL} due to __token__ username with no" \
5050
'supplied password field'

0 commit comments

Comments
 (0)