mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-05-12 22:10:25 +00:00
feat: use keying for webhook secrets (#10059)
- Follow up of forgejo/forgejo!5041, forgejo/forgejo!6074, forgejo/forgejo!8692, forgejo/forgejo!9923 - The `webhook` table contains a encrypted header authorization. - Use `keying` to safely store this secret and bound them to the table, column and row id - The migration isn't spectacular but does closely follow what we learned in the previous three migrations: use a transaction and delete records when you can't decrypt them. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10059 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org> Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org> Co-authored-by: Gusted <postmaster@gusted.xyz> Co-committed-by: Gusted <postmaster@gusted.xyz>
This commit is contained in:
parent
aa4a597b21
commit
4e83f85b75
11 changed files with 258 additions and 57 deletions
|
|
@ -39,6 +39,8 @@ var (
|
|||
ActionSecret = deriveKey("action_secret")
|
||||
// Used for the `task` table where type == TaskTypeMigrateRepo.
|
||||
MigrateTask = deriveKey("migrate_repo_task")
|
||||
// Used for the `webhook` table.
|
||||
Webhook = deriveKey("webhook")
|
||||
)
|
||||
|
||||
var (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue