feat(git-token-service): add opaque SCM session capabilities#3701
Open
eshurakov wants to merge 3 commits into
Open
feat(git-token-service): add opaque SCM session capabilities#3701eshurakov wants to merge 3 commits into
eshurakov wants to merge 3 commits into
Conversation
Contributor
Code Review SummaryStatus: 1 Issue Remaining | Recommendation: Address before merge Executive SummaryThe Overview
Issue Details (click to expand)WARNING
Resolved Issues
Files Reviewed (29 files)
Fix these issues in Kilo Cloud Reviewed by claude-sonnet-4.6 · 355,238 tokens Review guidance: REVIEW.md from base branch |
748bb09 to
a67a4a8
Compare
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
Why
The staged SCM-containment rollout needs a token-service boundary that can issue short-lived, repository-scoped capabilities without returning raw GitHub or GitLab credentials during session setup. This PR ships that additive Worker slice first so the capability contract can be reviewed and deployed independently before the dependent Cloud Agent caller and outbound broker adopt it.
What was done
outboundContainerIdis supplied while retaining unbound v1 issuance as a temporary compatibility path for older callers.High-level architecture
sequenceDiagram participant Caller as Future SCM session caller<br/>(not in this PR) participant Broker as Future outbound broker<br/>(not in this PR) participant Token as git-token-service RPC participant Store as Authorized integration storage participant SCM as GitHub or GitLab rect rgb(245, 245, 245) Note over Caller,SCM: Capability issuance Caller->>Token: issue...(user, org?, repository, container?) Token->>Store: Resolve authorized SCM source opt Mint or refresh current credential Token->>SCM: Resolve current credential end Token-->>Caller: Opaque capability + non-secret session metadata end rect rgb(245, 245, 245) Note over Caller,SCM: Per-request redemption Broker->>Token: redeem...(capability, container?, method, URL) Token->>Token: Check expiry, binding, origin, repository, and allowlist Token->>Store: Re-read pinned source and verify identity opt Mint or refresh current credential Token->>SCM: Resolve current credential end Token-->>Broker: Credential-bearing header for approved request Broker->>SCM: Forward approved request end Note over Broker,SCM: Broker adoption and redirect re-redemption are follow-up workVerification
POST /getTokenForRepoagainst the live localgit-token-serviceWorker for an active organization-owned GitHub App integration; confirmed a successful standard installation-token lookup with the returned token redacted.git-token-serviceWorker with a throwaway capability key and exercised the local bridge end to end:POST /issueGitHubSessionCapabilityreturned a redacted boundkgh2capability, thenPOST /redeemGitHubSessionCapabilityreturned a redacted authorization header for an allowed Git transport URL.Visual Changes
N/A
Reviewer Notes
SCM_SESSION_CAPABILITY_ENCRYPTION_KEY_PRODbefore deploying the production Worker and the DEV counterpart before deployinggit-token-service-dev; rotating the key invalidates outstanding capabilities.outboundContainerId.