feat(federation): add nonceSupported column to federation_peers (FED-008)
Adds nonce_supported INTEGER column to the federation_peers table in both the Drizzle schema definition and via a safe ALTER TABLE migration, enabling the auto-ratchet mechanism for replay attack protection.
This commit is contained in:
@@ -2098,4 +2098,9 @@ function migrateGeneralizeOutbox(db: Database.Database): void {
|
|||||||
db.exec(`PRAGMA foreign_keys = ON`);
|
db.exec(`PRAGMA foreign_keys = ON`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ─── FED-008: Add nonceSupported column for replay attack protection ───────
|
||||||
|
try {
|
||||||
|
db.exec(`ALTER TABLE federation_peers ADD COLUMN nonce_supported INTEGER NOT NULL DEFAULT 0`);
|
||||||
|
} catch { /* column already exists */ }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -319,6 +319,7 @@ export const federationPeers = sqliteTable('federation_peers', {
|
|||||||
consecutiveFailures: integer('consecutive_failures').default(0),
|
consecutiveFailures: integer('consecutive_failures').default(0),
|
||||||
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),
|
||||||
createdAt: integer('created_at').notNull(),
|
createdAt: integer('created_at').notNull(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user