Repository navigation
fix(scm): apply GitLab request policy - #8663
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change only adds numeric-selector normalization tests ( Assumptions: Files Reviewed (5 files)
Previous Review Summary (commit 4fd0584)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 4fd0584)Status: No Issues Found | Recommendation: Merge Executive SummaryThe new shared GitLab path evaluator correctly scopes version-2 session capabilities to the configured project's REST and Git/Smart-HTTP/LFS surfaces while keeping origin, base-path, traversal, container, identity, and credential-generation checks intact; I found no defects in the changed code. Assumptions: Files Reviewed (5 files)
Reviewed by deepseek-flash-latest · Input: 71.3K · Output: 5.2K · Cached: 553.3K Review guidance: REVIEW.md from base branch |
Evidence
Evidence: demonstrated — the redemption method ran inside a real Worker runtime on this VM against seeded Postgres credential rows, driven over a real RPC service binding: in-scope requests returned the expected project credential and out-of-scope requests were refused before any credential was resolved, and the managed outbound handler bound to the same service forwarded only in-scope requests.
Change
End-to-end verification
Runtime:
wrangler dev(workerd) forservices/git-token-servicewith the dev Hyperdrive binding pointing at the local Postgres, called over a real RPC service binding byservices/git-token-service/test/test-worker.ts. Credentials were seeded as RSA/AES envelope rows and decrypted by the service during redemption; the upstream responses used by the outbound harness were local fixtures.info/refs,git-upload-pack, LFSobjects/batch, and project REST reads and a note write returned the expected credential header for both the integration source (Bearer) and the project source (PRIVATE-TOKEN), including percent-encoded and lower-case-encoded project selectors and the numeric selector for a project source. Out of scope: another project's REST path, another project's numeric selector, a project path prefix, instance-wide REST (projects,user), GraphQL, another project's Git endpoint, the instance root, and a foreign origin were refused with the existing failure reasons (repository_mismatch,invalid_upstream_request,upstream_origin_not_allowed). A different container id still answerscontainer_mismatch.handleManagedScmOutboundbound to the same service instance. An in-scope project REST request was forwarded with the redeemed Bearer header and an in-scope Gitinfo/refsrequest with Basic auth; out-of-scope REST, GraphQL and Git requests answered 502 without any upstream request being issued.pnpm --filter cloudflare-git-token-service test: 24 files, 727 tests passed. Servicetypecheckpassed andgit diff --checkis clean.Unproven: a real GitLab instance accepting these requests, container provisioning and TLS interception, and the packaged GitLab CLI inside a container. Only loopback and local stub upstreams were contacted. Nonvisual service change; no screenshots.
Production prerequisites
None.
Proxy answers
The owner's proxy gave these answers in the owner's place.
Answer: Project-local REST and Git/LFS
Confidence: 0.80 · Precedent: Autonomy and decisions: make executive decisions yourself with the 'is this reasonable?' test (session 7f3470e0ba6f, 'is this reasonable?' rule). The option matches the brief's stated scope: the recorded project, with numeric IDs only for project sources and the v1 selector rule.