Commit ba28f64
fix(backend): widen and encrypt github_installations.githubToken (#2347)
GitHub installation access tokens have grown beyond 255 characters,
overflowing the varchar(255) "githubToken" column and throwing
"value too long for type character varying(255)" on patch.
Widen the column to text and encrypt it at rest (random IV), matching
GithubAccount.accessToken. The Model base is retro-compatible: writes
always encrypt, and reads fall back to plaintext for not-yet-migrated
values, so the migration can deploy before the code. Short-lived tokens
re-encrypt naturally on refresh, so no backfill is needed.
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 93ec04c commit ba28f64
3 files changed
Lines changed: 24 additions & 2 deletions
File tree
- apps/backend
- db
- migrations
- src/database/models
Lines changed: 19 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
947 | | - | |
| 947 | + | |
948 | 948 | | |
949 | 949 | | |
950 | 950 | | |
| |||
5199 | 5199 | | |
5200 | 5200 | | |
5201 | 5201 | | |
5202 | | - | |
| 5202 | + | |
| 5203 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
0 commit comments