✨ feat: session_expires_at (x-cwt-token capture) #159
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/session-expires-at"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Despite its name,
x-cwt-tokenis not a token: it carries the session expiry instant (login + exactly 2 h, observed live;docs/energy.comwatt.com/auth.md— format re-confirmed live today,2026-10-27T12:03:42.627Z). Captured on every successful_post_authent— initial login and reactive re-auth alike — and exposed asclient.session_expires_at. Absent/unparseable header is tolerated asNone(authentication itself still succeeded).logout()resets it.Evidence
AttributeError: no attribute 'session_expires_at'; the header was ignored entirely.pytest= 192 passed;mypyclean.Merge Danger
Door: two-way — additive attribute + property; revert restores previous behavior exactly.
Blast Radius: minimal — no existing method signature or request flow changed;
_post_authentonly records extra state.Closes half of #99 (capture + expose); the opt-in proactive re-auth follows as a stacked PR.
WIP: ✨ feat: session_expires_at (x-cwt-token capture)to ✨ feat: session_expires_at (x-cwt-token capture)