Skip to content

fix(worker): do not fire webhook for unregistered tokens#33

Merged
peg merged 3 commits intomainfrom
fix/worker-unregistered-token
Mar 25, 2026
Merged

fix(worker): do not fire webhook for unregistered tokens#33
peg merged 3 commits intomainfrom
fix/worker-unregistered-token

Conversation

@peg
Copy link
Copy Markdown
Owner

@peg peg commented Mar 24, 2026

Fixes the same issue as #23/#24 but in the Cloudflare Worker.

Unregistered tokens were falling through to env.WEBHOOK_URLS (global fallback) and firing alerts for any valid-format token URL, including partial tokens like /c/agent-01-. This caused the repeated false alerts from Tencent Cloud probing the demo token URL.

resolveWebhooks() now returns a registered boolean; processAlert() returns early if the token has no KV registration.

clap [bot] added 3 commits March 19, 2026 21:29
Mirrors the fix applied to the Go server in #24. When a token hits
/c/{token} but has no KV registration, the global WEBHOOK_URLS
fallback was still firing — causing false alerts from probe traffic
hitting partial URLs like /c/agent-01-.

resolveWebhooks() now returns a 'registered' flag; processAlert()
returns early for unregistered tokens (except snare-test-* tokens
which are exempt by design).
- Update alert footer to 'IP, UA, timestamp only — no request body'
- Log test callbacks as CANARY_TEST vs CANARY_FIRED
- Add missing canary types: huggingface, azure, git, terraform
- Add v0.1.4 CHANGELOG entry
@peg peg merged commit 8282dc9 into main Mar 25, 2026
1 check 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