GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |
GeezerVison is showing github.com — feat(cache): authenticate remote cache uploads with GitHub Actions OIDC by wan9chi · Pull Request #798 · voidzero-dev/vite-task Conversation
|
fspy benchmarklinuxmacoswindows |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
e00a71b to
0c99de0
Compare
86869ae to
9c13e94
Compare
9c13e94 to
c724b54
Compare
Planning resolves `ResolvedRemoteCacheConfig::auth` to `github-oidc` when `ACTIONS_ID_TOKEN_REQUEST_URL` and `ACTIONS_ID_TOKEN_REQUEST_TOKEN` are set. It holds the request URL, the request token, and the audience, which is the endpoint without a trailing slash. The request token is a `Secret`, which debug output and serialized plans redact. `build_auth` turns it into `vt_remote_cache::auth::GithubOidc`, which adds a GitHub Actions OIDC token to stores only. It requests a token when the first store needs it, reuses it until two minutes before it expires, shares one request between concurrent stores, and remembers a failed request, so later stores fail without another one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
`GithubOidc` keeps its state in one enum, so a token can't stay cached after a failure, and invalid settings start out failed. A token without an `exp` claim is now a malformed response, rather than being used once: the server rejects such tokens anyway. Co-Authored-By: Claude Opus 5.5 <[email protected]>
c724b54 to
238a29c
Compare
There was an error while loading. Please reload this page.
…ons stand-in (#809) ## Motivation [Vite+'s Cloudflare remote cache](https://github.com/voidzero-dev/vite-plus-remote-cache-cloudflare) only accepts uploads with a GitHub Actions OIDC token. The token has to come from a push to the registered repository's main branch, and its audience has to be the endpoint. The file backend accepted any upload, so the e2e cases never sent a token and never exercised the client's OIDC support from #798. ## Changes - **GitHub Actions stand-in.** The backend process stands in for GitHub's token service. `remote-cache-server run --github-actions` runs a command as if in a job with `id-token: write`: it sets `ACTIONS_ID_TOKEN_REQUEST_URL`, and `ACTIONS_ID_TOKEN_REQUEST_TOKEN` defaults to `main-push`. The request token picks the workflow run the token is for: `main-push` or `pull-request`. - **Write policy.** Like the Worker, the file backend checks each store's token: its RS256 signature against the stand-in's key, its time bounds, its audience, and its claims. It answers other stores as the Worker does, with `401 Invalid credentials` or `403 Write not permitted`. - **Uploading steps** run with `--github-actions`. The only snapshot changes are those command lines. Stacked on #808. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Changes are limited to test tooling (`remote-cache-server`) and e2e fixtures; production cache client code is only invoked more realistically in tests. > > **Overview** > Aligns the **remote-cache test backend** with production by requiring a **GitHub Actions OIDC token** on `POST /store` (401/403 otherwise), while **fetch/read stays unauthenticated**. > > A new **`--github-actions`** flag on `remote-cache-server run` simulates a job with `id-token: write` (`ACTIONS_ID_TOKEN_REQUEST_URL` / default `main-push` request token). The daemon’s control server exposes a **`/token`** endpoint that mints RS256 JWTs; **`backend.ts`** verifies signature, time bounds, audience (endpoint), and push-to-`main` claims before accepting stores. E2E **upload steps** and snapshot command lines now pass **`--github-actions`** so tests exercise the client OIDC path. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit a31b6bf. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> Co-authored-by: Claude Opus 5.5 <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.