- src/webhook.ts: routes exactly /telegram/webhook (grammY cloudflare-mod adapter, constant-time secret-token auth against env.WEBHOOK_SECRET) and POST /api/session (validateInitData → 401 category-only rejections → mintSession one-time token; single mint path, no extra branch — T-02-01/02/06) - D-14: the only log statement is '[initdata] rejected: <category>' — no payload, ids, or timestamps - scripts/set-webhook.mjs: setWebhook with secret_token + allowed_updates [message], secrets read from gitignored .dev.vars, token never echoed - bot deploy script chains wrangler deploy + set-webhook; wrangler.jsonc gains workers_dev (webhook URL target); KV id stays placeholder for the deploy checkpoint - verified: 27/27 tests, typecheck clean, wrangler deploy --dry-run exit 0
11 lines
459 B
JSON
11 lines
459 B
JSON
{
|
|
// KV namespace id is filled in plan 03 task 1 after `npx wrangler kv namespace create chat_sessions`
|
|
"name": "araharah-bot",
|
|
"main": "src/webhook.ts",
|
|
"compatibility_date": "2026-10-22",
|
|
// workers_dev: serve on the <name>.<account>.workers.dev URL — the WEBHOOK_URL
|
|
// target for this phase (Phase 3's custom route/domain may supersede)
|
|
"workers_dev": true,
|
|
"kv_namespaces": [{ "binding": "chat_sessions", "id": "KV_ID_PLACEHOLDER" }]
|
|
}
|