flexmeasures.auth.tokens

JSON API token lifecycle backed by Flask-Security refresh trackers.

Functions

flexmeasures.auth.tokens.exchange_refresh_token(token: str, *, revoke: bool = False) → tuple[dict, int]

Validate, rotate or revoke within one transaction holding the family lock.

flexmeasures.auth.tokens.issue_refresh_token(user) → dict

Caller must hold the user lock and have verified their credentials.

flexmeasures.auth.tokens.token_response(user, refresh_token: str) → dict

Report the effective lifetime, including a deployment’s per-token expiry.