Repository navigation
Add workload identity federation support - #297
Conversation
This comment has been minimized.
This comment has been minimized.
emcfarlane
left a comment
There was a problem hiding this comment.
Awesome, small comments.
| // A GitHub OIDC token with a decodable payload, so tests can check that debug | ||
| // output reports claims without ever reproducing the token or its segments. |
There was a problem hiding this comment.
Have limited unit tests as most of the complication occurs with the interactions in GitHub and ensuring everything still runs. Maybe this would be better as a full e2e example in ci.yaml to avoid having to spin up a test repo.
There was a problem hiding this comment.
Sounds good! Let me drop this and then add an e2e test as a follow-up since we need to get it rolled out on buf.build/configured there for that
Rename the "username" input to "bot_username". The registry accepts only machine users for this exchange, and the old "username" input meant something different before it was dropped, so reusing the name would change the behaviour of workflows that still carry it. Fail the action when a static token and a bot username are both set. A silent precedence rule leaves the author believing they authenticate by federation while a stored secret is what grants access. Link the BSR authentication docs from both inputs, and move the debug logging notes into the existing Debugging section.
Group the federation troubleshooting table with the debug logging notes, so everything needed when a run misbehaves sits in one place. Drop the note that setting both credentials fails. The error says so when it happens, and the inputs do not need to document every combination that is refused.
The exchange only breaks where the action meets GitHub, and the unit tests stub exactly that out, so they cannot catch a regression in it. The end-to-end jobs cover it on a real runner instead. Revert the test runner, the Makefile target, and the tsconfig options that existed only to run this file.
The exchange options took an injectable fetch, sleep, and @actions/core surface so the unit tests could stub them. Nothing injects them now, so call the real ones directly.
| - uses: bufbuild/buf-action@v1 | ||
| with: | ||
| # The bot user to authenticate as. Used instead of "token". | ||
| bot_username: my-bot-user |
There was a problem hiding this comment.
There was a problem hiding this comment.
Maybe? 😅 I used underscores since all our other inputs seem to use them, but maybe not ideal naming
Line 45 in d7b686c
| The BSR checks that against a trust credential you configure on the bot user and hands back a short-lived token. | ||
| The action revokes that token when the job finishes. | ||
|
|
||
| Set `bot_username` instead of [`token`](https://buf.build/docs/bsr/authentication/), and grant the job `id-token: write` so GitHub will sign a token for it: |
There was a problem hiding this comment.
This docs page will contain instructions for WIF as well once before we merge
## What's Changed * Update GHA examples by @pkwarren in #286 * Default push and archive to skip on forked repositories by @emcfarlane in #296 * Add workload identity federation support by @DMarby in #297 * Add end-to-end tests for workload identity federation by @DMarby in #298 ## New Contributors * @pkwarren made their first contribution in #286 * @DMarby made their first contribution in #297 **Full Changelog**: v1.5.0...v1.6.0
## What's Changed * Update GHA examples by @pkwarren in bufbuild/buf-action#286 * Default push and archive to skip on forked repositories by @emcfarlane in bufbuild/buf-action#296 * Add workload identity federation support by @DMarby in bufbuild/buf-action#297 * Add end-to-end tests for workload identity federation by @DMarby in bufbuild/buf-action#298 ## New Contributors * @pkwarren made their first contribution in bufbuild/buf-action#286 * @DMarby made their first contribution in bufbuild/buf-action#297 **Full Changelog**: bufbuild/buf-action@v1.5.0...v1.6.0
## What's Changed * Update GHA examples by @pkwarren in bufbuild/buf-action#286 * Default push and archive to skip on forked repositories by @emcfarlane in bufbuild/buf-action#296 * Add workload identity federation support by @DMarby in bufbuild/buf-action#297 * Add end-to-end tests for workload identity federation by @DMarby in bufbuild/buf-action#298 ## New Contributors * @pkwarren made their first contribution in bufbuild/buf-action#286 * @DMarby made their first contribution in bufbuild/buf-action#297 **Full Changelog**: bufbuild/buf-action@v1.5.0...v1.6.0
No description provided.