feat: add external repository credential resolver - #564
Open
jholm117 wants to merge 2 commits into
Open
Conversation
jholm117
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
heerambavi1998,
sr07asthana and
thesujai
as code owners
September 2, 2026 20:55
🦋 Changeset detectedLatest commit: a71e47f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Summary
Adds an opt-in, provider-neutral HTTP adapter for resolving short-lived Git credentials in packaged server deployments.
Depends on #559. Once that PR merges, this diff will contain only the external resolver follow-up.
Closes #562
Changes
How was this tested?
pnpm format:checkpnpm typecheckpnpm lint:cipnpm buildpnpm test(Node 24)Checklist
pnpm build,pnpm test,pnpm typecheck,pnpm lint:ci, andpnpm format:checkpass locally.env.exampleupdated for the new configurationNote
High Risk
Changes span private Git credential handling, external HTTP trust boundaries, and sandbox git exec during session init—security-sensitive paths where misconfiguration or resolver bugs could leak or mishandle credentials.
Overview
Sessions can optionally bind a persistent Git checkout in the sandbox via a new
repositoryfield (HTTPS URL, ref, sandbox path,read_only/read_write, optionalcredential_provider_ref). Checkout metadata is stored on the session; secrets are resolved each turn and are not persisted. Session create/get-or-create APIs acceptrepository, admission requires a configured sandbox provider, and SQLite/Postgres migrations add arepositorycolumn.Sandbox behavior provisions the repo idempotently on init (fetch/update without wiping resumed work), applies read-only push blocking when configured, writes Git credential-store content before checkout, and
TurnResourceResolvercan force a sandbox when a session has a repository even if the agent disables sandbox in spec.TrueForge server adds an optional HTTP repository credential resolver (
REPOSITORY_CREDENTIAL_RESOLVER_*): per turn it POSTs provider ref plus tenant/session/user and repository context, validates bounded Git credential-store responses, and fails closed with redaction-safe errors. When unset, sessions withcredential_provider_refstill reject via the existing injectablerejectUnconfiguredRepositoryCredentialspath. Docs and.env.exampledescribe the protocol.Reviewed by Cursor Bugbot for commit a71e47f. Bugbot is set up for automated code reviews on this repo. Configure here.