grafana/pkg/services/auth/authimpl
Eric Leijonmarck b00f3216c1
Auth: Refactor for revoking user tokens within last hours (#74616)
* fix: revoked tokens within last hours

adds check for unlimited sessions out of index
adds a function for specifing the hours to look back when revoking users tokens, otherwise we "assume" the clean up takes care of them adds a index for the `user_auth_token` - `revoked_at` for faster queries when using `revoked_at`

* fix: sqllite datetime conversion with unixtimestamps

* fix: postgres dialect

* fix: mysql dialect

* fix: mysql dialect missing closing )

* refactor: delete revoked tokens directly

* fix: tests for sqlite

* AuthToken: Simplify DeleteUserRevokedTokens and add test

* fix: linting newline

* Reset get time after test

* fix: test order by revoked

* fix: order by different db

* ascending

* test with seen at

---------

Co-authored-by: Karl Persson <kalle.persson@grafana.com>
2023-09-13 10:24:37 +01:00
..
auth_token_test.go Auth: Refactor for revoking user tokens within last hours (#74616) 2023-09-13 10:24:37 +01:00
auth_token.go Auth: Refactor for revoking user tokens within last hours (#74616) 2023-09-13 10:24:37 +01:00
model.go Auth: Add feature flag to move token rotation to client (#65060) 2023-03-23 14:39:04 +01:00
token_cleanup_test.go Auth: Merge ActiveAuthTokenService into UserAuthTokenService (#59032) 2022-11-22 10:58:59 +01:00
token_cleanup.go Chore: capitalise log message for auth packages (#74332) 2023-09-04 18:49:47 +02:00