feat(federation): add secret rotation columns to federation_peers (FED-011)

This commit is contained in:
Jannis Braun
2026-03-31 20:40:06 +02:00
parent 720a5de945
commit 0ac140bf51
2 changed files with 13 additions and 0 deletions
+9
View File
@@ -215,6 +215,15 @@ export function runMigrations(db: Database.Database): void {
{ name: 'federation_relay_ttl_days', type: 'INTEGER NOT NULL DEFAULT 30' }, { name: 'federation_relay_ttl_days', type: 'INTEGER NOT NULL DEFAULT 30' },
] ]
}, },
{
name: 'federation_peers',
columns: [
{ name: 'pending_hmac_secret', type: 'TEXT' },
{ name: 'secret_rotation_at', type: 'INTEGER' },
{ name: 'secret_rotated_at', type: 'INTEGER' },
{ name: 'auto_rotate_interval_days', type: 'INTEGER NOT NULL DEFAULT 90' },
]
},
]; ];
for (const table of tables) { for (const table of tables) {
+4
View File
@@ -320,6 +320,10 @@ export const federationPeers = sqliteTable('federation_peers', {
lastSyncedAt: integer('last_synced_at').default(0), lastSyncedAt: integer('last_synced_at').default(0),
remoteMaxUploadSize: integer('remote_max_upload_size'), remoteMaxUploadSize: integer('remote_max_upload_size'),
nonceSupported: integer('nonce_supported').notNull().default(0), nonceSupported: integer('nonce_supported').notNull().default(0),
pendingHmacSecret: text('pending_hmac_secret'),
secretRotationAt: integer('secret_rotation_at'),
secretRotatedAt: integer('secret_rotated_at'),
autoRotateIntervalDays: integer('auto_rotate_interval_days').notNull().default(90),
createdAt: integer('created_at').notNull(), createdAt: integer('created_at').notNull(),
}); });