Repository navigation
feat: template Slack webhook paths in the URL scrub (v0.1.2) - #3
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…inks and path keys Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A Slack incoming-webhook URL (
https://hooks.slack.com/services/T…/B…/<secret>) carries its secret in the path. The undici instrumentation opens a client span for everyfetch, sourl.full/http.urlwould export it. This adds the Slack webhook shapes toTOKEN_PATH_TEMPLATES, so they are templated like the/apply/<token>paths already are:/services/<a>/<b>/<secret>→/services/[webhook]/triggers/<a>/<b>/<secret>→/triggers/[webhook]/workflows/<a>/<b>/<secret>→/workflows/[webhook]Anchored, case-insensitive, any run of
/, exactly three segments. Mirrored insrc/scrub-contract.json.package.jsongoes to 0.1.2 anddist/is rebuilt (onlyurl-path.js/url-path.d.tschange).Why now: ACP's worker posts to a Slack webhook, and ACP refuses worker telemetry in code until this ships (carbon-acp#158).
Behaviour change to note for the release
The templates are host-agnostic (the contract is path-only, and the agent's layer-2 scrub repeats it). A non-Slack client or unrouted span whose path is
/services|triggers|workflows/a/b/cis templated too. Spans with anhttp.routekeep the route.Known limits (documented in the README)
scrubMessage/scrubErrorText) strips userinfo, query and fragment but does not template token paths. This already held for/apply/<token>. Never log a webhook or token URL. A follow-up needs a layer-2 change as well.redactKeys.%2F, backslashes, dot segments) can leave a trailing segment. URLs from undici arrive normalised.Tests
pnpm typecheck,pnpm test(978 pass) andpnpm buildare clean, and the committeddist/equals a fresh build. New cases coverurl.full,http.url,http.target,url.path, event and link attributes, a query string, doubled slashes, upper case, a trailing path and a scheme-less//host, and check that none of the three segments appears anywhere in the exported span. Negatives:/services,/services/a/b,/servicesX/a/b/c(and the same for the other two). Removing the three entries makes 12 tests fail.After the merge: tag
v0.1.2on the rebased merge SHA after checking its tree equals this head's tree, then update carbon-observability's contract copy and Alloy scrub, then bump ACP's pin.QA Check Report
Risk level: LOW
No escalations: a written spec exists (observability platform plan, Phase 7 handoff), and the touched files are small (url-path.ts 69 lines, the test file 291 lines).
Spec discipline
/triggers/and/workflows/Slack webhook shapes, added after the deploy/PII lens review found them untemplated. Same mechanism, same shape.Complexity
./scrubentry work, not for this feature. The two commits here are the feature and its review fix.Test integrity
Dependency provenance
Validation gaps
/apply/<token>. It is documented in the README, and a follow-up needs a layer-2 Alloy change.%2F, backslashes, dot segments) can leave a trailing segment. Auto-instrumented URLs come from undici already normalised.AI-specific concerns
TOKEN_PATH_TEMPLATESand the contract JSON are written, which the contract test requires to stay in the same order.Contract compliance
Architecture violations
pnpm build(verified twice, by the lens review and by me).Recommended actions
/services|triggers|workflows/<a>/<b>/<c>is templated on any host.