GML-2090 Fix authentication for password-only connections to REST++ Auth#287
Conversation
…instances - Password-only connections automatically mint a token and retry when the server signals that a token is required. - getToken() correctly stores the token string on the connection; every subsequent request now authenticates as expected. - refreshToken() correctly applies the refreshed token to the connection. - Token mint requests prefer the modern endpoint, falling back to the legacy one only on failure.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
- Auto-mint a token on auth failure only when the connection's
credentials are library-managed; surface the error when the user
supplied an explicit token, instead of silently replacing it.
- Detect auth failure from both REST++ (REST-10016) and GSQL
("Authentication failed.") response bodies, in addition to HTTP 401.
- Fall back from the modern token endpoint to the legacy one only when
the modern endpoint is genuinely absent (HTTP 404 or REST-1000
"Endpoint is not found"); preserve the original error otherwise.
User description
…instances
PR Type
Bug fix, Documentation
Description
Fix password-only REST++ authentication
Retry requests on token-required errors
Persist minted and refreshed tokens
Document 2.0.4 authentication fixes
Diagram Walkthrough
File Walkthrough
pyTigerGraphAuth.py
Fix sync token minting and connection statepyTigerGraph/pyTigerGraphAuth.py
apiTokengetToken()andrefreshToken()pyTigerGraphBase.py
Add sync auto-token retry handlingpyTigerGraph/pyTigerGraphBase.py
401andREST-10016retry triggerspyTigerGraphAuth.py
Fix async token persistence and headerspyTigerGraph/pytgasync/pyTigerGraphAuth.py
apiTokenauthHeaderafter token mint and refreshpyTigerGraphBase.py
Add async automatic token retrypyTigerGraph/pytgasync/pyTigerGraphBase.py
401andREST-10016before retryingCHANGELOG.md
Document 2.0.4 authentication bug fixesCHANGELOG.md
2.0.4release notesgetToken()andrefreshToken()behavior