Skip to content

Commit 0bb9481

Browse files
committed
style: fix repo convention violations flagged in PR review
- Replace em dash with plain hyphen in test_mfa_client.py section header - Split semicolon clause-splices into two sentences in MutualTLS.md (x2), server_client.py comment, and MfaVerifyError message - Restructure _resolve_token_endpoint docstring with Returns:/Raises: sections
1 parent 38d5e93 commit 0bb9481

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎examples/MutualTLS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Mutual TLS (mTLS) Client Authentication
22

3-
Authenticate to Auth0 with a TLS client certificate instead of a client secret (RFC 8705). The certificate is presented during the TLS handshake; no credential travels in the request body.
3+
Authenticate to Auth0 with a TLS client certificate instead of a client secret (RFC 8705). The certificate is presented during the TLS handshake. No credential travels in the request body.
44

55
## Prerequisites
66

@@ -53,7 +53,7 @@ The SDK passes `ssl_context` as `verify=ssl_context` to every `httpx.AsyncClient
5353
|-----------|--------|
5454
| `client_secret` | One client-auth method only - Auth0 rejects requests carrying both. |
5555
| `client_assertion_signing_key` | Same - one method only. |
56-
| `dpop_key` (per-call on `signin_with_passkey` / `mfa.verify`) | DPoP binds to its own key (`cnf.jkt`) and suppresses `cnf.x5t#S256`; combining them silently defeats mTLS token binding. |
56+
| `dpop_key` (per-call on `signin_with_passkey` / `mfa.verify`) | DPoP binds to its own key (`cnf.jkt`) and suppresses `cnf.x5t#S256`. Combining them silently defeats mTLS token binding. |
5757

5858
All three raise `ConfigurationError` immediately (constructor for the first two, at the call site for DPoP).
5959

‎src/auth0_server_python/auth_server/server_client.py‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,12 @@ async def _resolve_mfa_token_endpoint(self, store_options) -> str:
298298
def _resolve_token_endpoint(self, metadata: dict) -> Optional[str]:
299299
"""Return the token endpoint, routed to the mTLS alias when mTLS is enabled.
300300
301-
Under mTLS, raises ConfigurationError immediately if the alias is absent.
302-
Under standard auth, returns None if token_endpoint is missing (caller's guard handles it).
301+
Returns:
302+
The token endpoint URL, or None if not present and mTLS is not enabled.
303+
304+
Raises:
305+
ConfigurationError: If mTLS is enabled but the discovery document does not
306+
advertise mtls_endpoint_aliases.token_endpoint.
303307
"""
304308
if self._use_mtls:
305309
aliases = metadata.get("mtls_endpoint_aliases") or {}
@@ -353,7 +357,7 @@ def _apply_client_authentication(
353357

354358
if self._use_mtls:
355359
# The client certificate presented in the TLS handshake is the sole
356-
# credential; no body credential or HTTP basic auth is sent.
360+
# credential. No body credential or HTTP basic auth is sent.
357361
return None
358362

359363
if self._client_assertion_signing_key:
@@ -1084,7 +1088,7 @@ async def _establish_session_from_mfa_verify_response(
10841088
id_token = token_response.get("id_token")
10851089
if not id_token:
10861090
raise MfaVerifyError(
1087-
"MFA verification response did not include an ID token; cannot create a session"
1091+
"MFA verification response did not include an ID token. Cannot create a session."
10881092
)
10891093

10901094
origin_domain = await self._resolve_current_domain(store_options)

‎src/auth0_server_python/tests/test_mfa_client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ async def mock_post(self_client, url, **kwargs):
10971097

10981098

10991099
# ============================================================================
1100-
# mTLS — MfaClient SSLContext threading + DPoP exclusion + endpoint override
1100+
# mTLS - MfaClient SSLContext threading + DPoP exclusion + endpoint override
11011101
# ============================================================================
11021102

11031103

0 commit comments

Comments
 (0)