This repository was archived by the owner on Aug 5, 2026. It is now read-only.
test(e2e): real apiRef chain — CDC ↔ authn JWT ↔ snowplow with extras - #8
Merged
Conversation
Adds a kind-based end-to-end test proving the apiRef status source against real
authn and real snowplow (1.1.1), exercising the actual CDC client code:
projected SA token -> authn /serviceaccount/login (TokenReview -> JWT)
-> snowplow /call (Bearer JWT) -> RESTAction resolution
-> request extras echoed back into .api.echo.args
Asserts both static (apiRef.extras: region) and per-instance (compositionName/
Namespace/Id, request-wins) extras round-trip through the authn-issued JWT and
snowplow's resolution. Build-tagged (e2e) so it stays out of the unit suite.
- internal/composition/apiref_kind_e2e_test.go: the env-driven test.
- hack/apiref-e2e/: reproducible harness (run.sh + manifests + README).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
A real, kind-based end-to-end test of the apiRef status source against real authn + real snowplow (1.1.1) — not stubs. It exercises the actual CDC client code (`internal/authn`, `internal/snowplow`, `internal/composition.SnowplowAPIResolver`).
Chain proven
```
projected SA token (file)
─ authn.Client.Token ─▶ authn POST /serviceaccount/login (TokenReview → JWT + clientconfig)
─ snowplow.Client.Resolve(Bearer JWT, extras) ─▶ snowplow GET /call (resolves a RESTAction)
─▶ RESTAction echoes the request extras ─▶ .api.echo.args
```
Assertion
Both static extras (`region`, from `apiRef.extras`) and per-instance extras (`compositionName`/`compositionNamespace`/`compositionId`, injected by the resolver, request-wins) round-trip through the authn-issued JWT and snowplow's RESTAction resolution:
`.api.echo.args == {cn: demo-app, cns: apps, cid: uid-e2e-123, region: eu}`
Evidence (from the passing run)
Layout
Requires docker, kind, kubectl, go, and `../authn` + `../snowplow` checkouts. Run: `hack/apiref-e2e/run.sh`.
🤖 Generated with Claude Code