forgejo/services/mailer
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
..
incoming style: reenable switch check 2024-08-18 15:19:01 +02:00
token Improve usage of HMAC output for mailer tokens 2024-11-15 11:33:08 +01:00
mail.go fix: extend forgejo_auth_token table 2024-11-15 11:33:17 +01:00
mail_admin_new_user.go Enable unparam linter (#31277) 2024-06-16 13:42:58 +02:00
mail_admin_new_user_test.go chore: remove extra go-sqlite3 imports 2024-09-06 09:36:08 +00:00
mail_auth_test.go [MAIL] Use correct function in mail footer 2024-07-26 15:16:54 +02:00
mail_comment.go
mail_issue.go Clean up template locale usage (#27856) 2023-10-31 22:11:48 +08:00
mail_release.go Add option to change mail from user display name (#31528) 2024-07-22 15:44:13 +02:00
mail_repo.go Add option to change mail from user display name (#31528) 2024-07-22 15:44:13 +02:00
mail_team_invite.go Refactor locale&string&template related code (#29165) 2024-02-16 15:20:52 +01:00
mail_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
mailer.go Add option for mailer to override mail headers (#27860) 2024-06-09 11:13:39 +02:00
mailer_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
main_test.go [SECURITY] Notify users about account security changes 2024-07-23 18:31:47 +02:00
notify.go [GITEA] notifies admins on new user registration 2024-02-05 16:09:28 +01:00