docs: prepare v0.2.0 release#19
Merged
Merged
Conversation
Bump apiVersion from "0.1.0-dev" to "0.2.0" and rewrite the
README for the Phase 2 release.
Security fix (bundled because it must ship with v0.2.0):
clientIP now prefers the Fly-Client-IP header over
X-Forwarded-For. Fly.io's edge proxy sets Fly-Client-IP with
the real client address and strips any client-supplied value,
so it cannot be forged. The previous implementation keyed the
per-IP rate limiter by the first X-Forwarded-For entry, which
an attacker could rotate to get a fresh rate-limit bucket per
request — completely bypassing the limiter. With this fix the
rate limiter is resistant to XFF spoofing when deployed on
Fly.io. X-Forwarded-For remains the fallback for non-Fly
environments (local dev, other trusted reverse proxies).
New unit tests verify that Fly-Client-IP is preferred over XFF
and RemoteAddr (4 cases). A new E2E chain test
(TestChain_RateLimitResistantToXFFSpoofing) simulates the
attack scenario: same Fly-Client-IP + rotated spoofed XFF
values. The second request is correctly rate-limited (429)
because the limiter keys by Fly-Client-IP, not XFF.
README changes:
- Status: Phase 2 (v0.2.0)
- "Who is this for?" section (multi-language CI/CD, bots,
distribution layer)
- Endpoints table: +2 (POST /v1/analyze, POST /v1/prompt)
- Full request/response examples with curl commands
- Error format section with all 9 error codes
- Configuration table: +4 env vars (MAX_REQUEST_BYTES,
RATE_LIMIT_RPM, RATE_LIMIT_BURST, MAX_CONCURRENT_REQUESTS)
- "Known constraints (v0.2.0)" section: no auth, public repos
only, GitHub 60/hr limit, related_files heuristic, no cache,
rate limit map unbounded
- Removed standalone "Provider Support" section (folded into
known constraints)
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
Final PR before `v0.2.0` tag. Bumps `apiVersion` to `"0.2.0"`, rewrites the README, and fixes a rate-limit bypass vulnerability discovered during the release review.
Security fix: Fly-Client-IP priority for rate limiting
Before: `clientIP()` keyed the per-IP rate limiter by the first `X-Forwarded-For` entry. An attacker could rotate `X-Forwarded-For: fake-ip-N` per request to get unlimited fresh rate-limit buckets, completely bypassing the limiter.
After: `clientIP()` now prefers `Fly-Client-IP` — a header set by Fly.io's edge proxy with the real client address. The client cannot forge this header because Fly strips any client-supplied value. `X-Forwarded-For` remains the fallback for non-Fly environments.
Tests:
README rewrite
apiVersion bump
`internal/httpapi/handler/health.go:12`: `"0.1.0-dev"` → `"0.2.0"`
`/version` now returns `{"api_version":"0.2.0","go_version":"go1.26.2"}`.
Local checks
After merge
Intended to be squash-merged.