[!NOTE]
Medium Risk
Changes credential validation on every client init and encode_key path; misconfigured digest or matching logic could block legitimate tokens or miss the retired one.
Overview
Blocks a retired shared API credential before the Python SDK stores or Base64-encodes it, with a fixed user-facing error telling customers to create a new token.
Token resolution moves into select_token, keeping the same behavior: explicit token wins (including empty string), otherwise the first set of the four SOCKET_* env vars. After resolution, reject_retired_token compares a trimmed SHA-256 digest to a baked-in fingerprint (no raw secret in repo or errors). API.encode_key also runs reject_retired_basic_auth_token, checking only the Basic-auth username segment before the first :.
Unit tests cover rejection messaging/redaction, env precedence, whitespace trimming, and non-retired tokens without network calls.
Reviewed by Cursor Bugbot for commit 6ebd180. Configure here.