From ee52ff0c7b47f310ea0d7f865d03ae7c7f4c8ad7 Mon Sep 17 00:00:00 2001 From: Jannis Braun <151788261+TheZwiss@users.noreply.github.com> Date: Thu, 2 Jul 2026 01:43:12 +0200 Subject: [PATCH] feat(federation): expose needsAttentionReason on peer API --- packages/server/src/routes/federation.ts | 2 ++ packages/shared/src/types.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/server/src/routes/federation.ts b/packages/server/src/routes/federation.ts index de102c51..cb5f9dfa 100644 --- a/packages/server/src/routes/federation.ts +++ b/packages/server/src/routes/federation.ts @@ -40,6 +40,7 @@ interface SanitizedPeer { rotationInProgress: boolean; secretRotatedAt: number | null; autoRotateIntervalDays: number; + needsAttentionReason: string | null; } function sanitizePeer(row: typeof schema.federationPeers.$inferSelect): SanitizedPeer { @@ -56,6 +57,7 @@ function sanitizePeer(row: typeof schema.federationPeers.$inferSelect): Sanitize rotationInProgress: row.pendingHmacSecret !== null, secretRotatedAt: row.secretRotatedAt, autoRotateIntervalDays: row.autoRotateIntervalDays, + needsAttentionReason: row.needsAttentionReason, }; } diff --git a/packages/shared/src/types.ts b/packages/shared/src/types.ts index 066157ea..11e20997 100644 --- a/packages/shared/src/types.ts +++ b/packages/shared/src/types.ts @@ -1188,6 +1188,7 @@ export interface FederationPeer { secretRotatedAt: number | null; rotationInProgress: boolean; createdAt: number; + needsAttentionReason: 'auth_failures' | 'peer_reset_detected' | null; } // ─── Outbound peering gate ──────────────────────────────────────────────────