mirror of
1
Fork 0
forgejo/routers/web/auth
Gusted 1770117178
fix: extend `forgejo_auth_token` table
- Add a `purpose` column, this allows the `forgejo_auth_token` table to
be used by other parts of Forgejo, while still enjoying the
no-compromise architecture.
- Remove the 'roll your own crypto' time limited code functions and
migrate them to the `forgejo_auth_token` table. This migration ensures
generated codes can only be used for their purpose and ensure they are
invalidated after their usage by deleting it from the database, this
also should help making auditing of the security code easier, as we're
no longer trying to stuff a lot of data into a HMAC construction.
-Helper functions are rewritten to ensure a safe-by-design approach to
these tokens.
- Add the `forgejo_auth_token` to dbconsistency doctor and add it to the
`deleteUser` function.
- TODO: Add cron job to delete expired authorization tokens.
- Unit and integration tests added.

(cherry picked from commit 1ce33aa38d)

v9: Removed migration - XORM can handle this case automatically without
migration. Add `DEFAULT 'long_term_authorization'`.
2024-11-15 11:33:17 +01:00
..
2fa.go Move context from modules to services (#29440) 2024-03-06 12:10:43 +08:00
auth.go fix: extend `forgejo_auth_token` table 2024-11-15 11:33:17 +01:00
auth_test.go Make "/user/login" page redirect if the current user has signed in (#29583) 2024-03-11 23:36:58 +07:00
linkaccount.go add CfTurnstileSitekey context data to all captcha templates (#31874) 2024-08-25 10:47:02 +02:00
main_test.go make writing main test easier (#27270) 2023-09-28 01:38:53 +00:00
oauth.go fix: Add server logging for OAuth server errors 2024-10-17 09:47:06 +00:00
oauth_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
openid.go add CfTurnstileSitekey context data to all captcha templates (#31874) 2024-08-25 10:47:02 +02:00
password.go fix: extend `forgejo_auth_token` table 2024-11-15 11:33:17 +01:00
webauthn.go [FEAT] Add support for webauthn credential level 3 2024-08-29 10:05:03 +02:00