Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/services/telegramBridgeService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@ export const relayTelegramMessageToPod = async (opts: {
return { relayed: false };
}

// The gate proves the Telegram sender IS the chat's counterpart. It does NOT
// prove the counterpart is `linkedUserId` — that half is held one layer out,
// by the guard in `routes/integrations.ts` (PATCH /:id), which derives
// `config.linkedUserId` from the authenticated caller when `liveRelay` flips
// on and rejects any client-supplied value. Relax that guard and this gate
// still passes while authoring under an identity the caller chose. No test
// joins the two: both bridge suites hand-build `config`, so a mutation to the
// route guard turns nothing here red.
//
// Attribution gate. Every relayed message is authored as `linkedUserId`, so
// relaying is only honest where Telegram itself guarantees the sender IS that
// person: a `private` chat is 1:1 between the bot and one user. In a group,
Expand Down
Loading