Flask-Middleware / flask-security

Quick and simple security for Flask applications
MIT License
624 stars 155 forks source link

Change auth_tokens to be versionable, extendable, expirable. #927

Closed jwag956 closed 4 months ago

jwag956 commented 4 months ago

Older auth_token formats still are accepted.

Each auth_token is now versioned and has an optional 'exp' timestamp which will be checked during validity. A new callback SECURITY_TOKEN_EXPIRE_TIMESTAMP can be set to compute whatever the app needs (and it can be per user).

Use freezegun for testing.

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (6d6c15a) 98.44% compared to head (7a7a7e6) 98.44%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #927 +/- ## ======================================= Coverage 98.44% 98.44% ======================================= Files 35 35 Lines 4494 4510 +16 ======================================= + Hits 4424 4440 +16 Misses 70 70 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.