blitz_api/app
fusion44 dccaa17a8e
fix(auth): correct JWT expiry unit and use standard exp claim
sign_jwt added JWT_EXPIRY_TIME (seconds) to a milliseconds epoch and
stored it in a custom 'expires' claim, while register_cookie_updater
slept JWT_EXPIRY_TIME as seconds. With the code default (300) tokens
effectively expired almost immediately; with the sampled 3600000 the
cookie-refresh loop slept ~41 days, so the local .cookie held an
expired token nearly always. The custom claim also meant PyJWT never
validated expiry itself.

- issue standard 'iat'/'exp' claims (seconds) and let PyJWT validate,
  requiring 'exp' on decode
- derive the cookie refresh interval from the same unit, guarded
  against tiny/negative values
- default BAPI_JWT_EXPIRY_TIME to 3600s and fix .env_sample (was
  3600000 'milliseconds')

Existing tokens and the local .cookie are invalidated by this change;
clients re-login and the cookie regenerates at startup.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 20:35:34 +02:00
..
api fix(api): catch subprocess timeouts in exec_bash_command 2026-07-03 19:59:57 +02:00
apps fix(apps): don't release another task's app-manage lock 2026-07-03 20:01:54 +02:00
auth fix(auth): correct JWT expiry unit and use standard exp claim 2026-07-03 20:35:34 +02:00
bitcoind chore: small fixes and updates 2025-05-06 09:16:46 +02:00
external feat: update Python and Devenv deps 2026-02-03 11:04:41 +01:00
lightning fix(lightning): prevent shell injection in CLN local calls 2026-07-03 19:58:41 +02:00
setup feat: replace call_script func with better func 2025-05-06 09:16:46 +02:00
system feat: update Python and Devenv deps 2026-02-03 11:04:41 +01:00
__init__.py feat: prepare for release 0.5.1beta 2023-02-05 21:24:31 +01:00
celery_app.py feat: fetch app status via a celery task 2025-05-06 09:16:46 +02:00
logging.py feat: make config loading more flexible 2025-03-23 17:43:39 +01:00
main.py fix: send bitcoin-only warmup app status as app_state_update_message 2026-07-03 15:30:17 +02:00
server.py chore(nix): migrate flake from poetry2nix to uv2nix 2026-07-03 16:00:42 +02:00