Skip to content

docs(telegram): the webhook secret is the instance's, and it is required (TASK-141 follow-up) - #1908

Merged
lilyshen0722 merged 1 commit into
mainfrom
kai/telegram-secret-doc
Sep 26, 2026
Merged

lilyshen0722 merged 1 commit into
mainfrom
kai/telegram-secret-doc

Conversation

@lilyshen0722

Copy link
Copy Markdown
Contributor

The Telegram webhook secret is the instance's, and it is required

Docs-only, 2 files, +5/−5. No code path changes.

docs/telegram/README.md told a reader two wrong things, and both fail at deploy time rather than at review time:

  1. "optional" (:5, :22, :27, and docs/integrations/README.md:8). verifyTelegramHeader (backend/routes/webhooks/telegram.ts:65-83) refuses every update while TELEGRAM_SECRET_TOKEN is unset — the only exception is the local-dev TELEGRAM_WEBHOOK_ALLOW_UNVERIFIED=true opt-out, which accepts unverified updates and logs a warning. The route's own deploy note at :60-63 already says it: set the secret and re-register via setWebhook before shipping to an env with a live bridge, or deliveries 401. The docs were the only surface that disagreed.
  2. "Config Fields" (:18). secretToken is not row config. Since fix(integrations): read the verification credentials from the instance, and close the legacy Slack route to inactive rows (TASK-141) #1907 (f43fa404) it is in SERVER_OWNED_CONFIG_KEYS: both mutation paths strip it before the row is saved (routes/integrations.ts:392 create, :700 PATCH), and Vera's re-census at the head found no row-level read of it outside tests. Configure it once per instance.

⚠️ Held until #1907 merged, deliberately. The :18 half describes the post-f43fa404 state — opened before it, the doc would have described a state no reader could see. The branch is rebased onto f43fa404, so the base it lands on contains the merge that makes it true.

Scope

Left alone, deliberately: docs/deployment/DEPLOYMENT.md:78's # Telegram Integration (optional) — I read that "optional" as the connector being optional, not the secret. Flagged to @wren (74298) rather than changed; say the word and it moves.

Evidence

  • Docs-only: no .ts/.js/.sh touched. docReferences.test.js scans code (scripts, backend, cli, frontend) plus root CLAUDE.md and explicitly does not police docs/ prose; the paths this change adds are plain text inside docs/, and there is no markdown linter in the repo.
  • Every claim measured at f43fa404: the route behaviour read in the file, and the strip verified in both mutation paths rather than one.
  • Test & Coverage runs on docs-only PRs in this repo; no expectation of movement.

Gate: @wren (docs shape). Raised by wren 74298.

…red (TASK-141 follow-up)

`docs/telegram/README.md` listed `secretToken` as row config and called the
secret optional in three places, and `docs/integrations/README.md` indexed it the
same way. `routes/webhooks/telegram.ts:65-83` rejects every update while
`TELEGRAM_SECRET_TOKEN` is unset (the only exception is the local-dev
`TELEGRAM_WEBHOOK_ALLOW_UNVERIFIED=true` opt-out), and from #1907 the key is in
`SERVER_OWNED_CONFIG_KEYS`, so a row copy is stripped by the API and read by
nothing. Both halves are now stated where a reader looks.

Opened after #1907 merges: the row-config half describes the post-#1907 state,
and a docs PR merged ahead of it would document a state no reader sees.
@lilyshen0722
lilyshen0722 added this pull request to the merge queue Sep 26, 2026
Merged via the queue into main with commit 66f1f5b Sep 26, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant