Repository navigation
feat(cdp): let the attachment upload route through without the internal api secret - #133482
Conversation
…al api secret The upload route checks its own team-scoped token, as the transactional email routes do, so the shared-secret middleware lets exactly that path through. Nothing serves the path until the route itself lands. Refs PostHog/michaelr-context#77 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
😎 This pull request was merged. |
🤖 CI report✅ Trunk lane — non-backend laneThis PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes. ✅ Duplication (Python) — cleanNew Python code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying. ✅ Duplication (TypeScript) — cleanNew TypeScript code duplication introduced by this branch. Fails at 70+ tokens in app code, or 150+ tokens when both copies live in test files. Advisory while the gate proves itself: extract a shared helper instead of copying. |
|
Risk: Low · 1 low This PR exempts exactly one new path ( Sentinel reviewed |
…oad-auth-scope Refs PostHog/michaelr-context#77 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This pull request was merged into |
Deploy status
This table shows the |
Merge gate: passed.
fleet proof gatepasses on ef4c5f1 (live run, review at HEAD, CI green, judge pass). Layer 1 of 4 in the node-store attachment stack: this PR, then #131833, #133495, and #131944. The stack merges from its top PR.Problem
INTERNAL_API_SECRET, so that route could never be reached.Changes
/api/projects/{team_id}/transactional_email/attachments/uploadsthrough, as it already does for the other team-scoped transactional email routes..../uploads/extrastill needs the shared secret.How did you test this code?
Test rationale: the new case drives a real express app through
setupExpressApp. It fails if the pattern is dropped, and also if it widens to sibling paths. Deleting the pattern turned the test red.setupExpressApp: the exempted path answers 404 without the secret, since nothing serves it yet. Its/extrasibling, a trailing slash, and another team route still answer 401.Release status
Docs update
🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Agent: Claude Code, Claude Opus 5.5
Skills:
/writing-tests,/writing-pr-descriptions,/stacking-prsMore context for AI agents
nodejs/src/common/api/middleware/internal-api-auth.ts, the one added pattern.🤖 Generated with Claude Code