Issues: Issue with Session IDs

 

What to Improve

Here’s how to “productionize” further:

  1. Fix DeprecationWarnings:

    python
    from datetime import timezone exp_str = datetime.fromtimestamp(exp, tz=timezone.utc).isoformat() + "Z" iat_str = datetime.fromtimestamp(iat, tz=timezone.utc).isoformat() + "Z" if iat else "(unknown)" msg = f"Token expired at {exp_str}, issued at {iat_str}, now={datetime.fromtimestamp(now, tz=timezone.utc).isoformat()}Z (sub={sub}, TokenHash={token_hash})"
  2. Session IDs:
    Your log shows session_id=no-session-id.

    • Flask doesn’t set a session id by default—consider generating your own trace ID or using something like request.cookies.get('session', '-') for traceability.

  3. Audit Log Format:

    • If you want even richer logs, consider JSON log lines or structured logging for ingestion by a tool like ELK, Datadog, or CloudWatch.

  4. Performance:

    • In your log, JWT verification took 2.0242s. For local dev this is fine, but in prod, it should be <50ms. Double-check for unnecessary slowdowns (likely dev-mode).

Comments

Popular posts from this blog

Feature: Audit log for one login, and identity service

Getting started - Build your data science lab environment

QA - Run #1 - Results