3 Commits
Author SHA1 Message Date
SmartUp DeveloperandClaude Opus 4.8 2262b6a564 feat: proactive Bearer token refresh with unified fallback
- Parse JWT 'exp' claim to track token expiry (token_expires_at)
- Proactively refresh Bearer tokens 1 hour before expiry in
  ensure_authenticated()
- Refresh response without expires_in now falls back to JWT exp for
  expiry derivation
- Support custom refresh_path via bearer auth_config whitelist
- Unify 401 fallback: all bearer types (including Sub2API) now go
  through _refresh_bearer_token() instead of separate old path
- Remove dead _is_sub2api_bearer() / _refresh_sub2api_bearer_token()
- Add 2 new tests: refresh_path override + JWT exp backfill

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-06 10:31:29 +08:00
SmartUp DeveloperandClaude Sonnet 4.6 a296525d4e fix: 将 refresh_path 加入 login_password auth_config 白名单
自定义 refresh 路径会被 normalize_auth_config 丢弃,导致只有默认
/auth/refresh 生效。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-02 09:34:53 +08:00
liumangmang c5bb63cf82 feat: support upstream token refresh 2026-06-30 14:34:40 +08:00