Repository navigation
Do not redirect or retry POST requests - #213
Merged
zachmann merged 2 commits intoNov 12, 2026
Merged
Conversation
An authenticated federation request (OpenID Federation 1.1 §8.8) is a POST with the client assertion in its form body. The shared client followed up to ten redirects for every method, so a 307 or 308 answer resent the assertion to whatever host the redirect named. It also retried POSTs after a network error, resending the same assertion jti, which a compliant endpoint must refuse as a replay. The redirect policy now refuses every redirect of a POST and keeps the flexible policy for other methods. retryCondition never retries a POST; this has to be decided in the client's condition, because Resty retries when any client or request condition returns true. Fixes go-oidfed#211 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QYDqsx3UGxpCKvCiUxShZq
Contributor
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Go | Nov 12, 2026 8:59a.m. | Review ↗ | |
| Code coverage | Nov 12, 2026 9:29a.m. | Review ↗ |
Important
AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.
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.
Fixes #211.
An authenticated federation request (§8.8) is a POST with the client assertion in its form body. In
internal/http:FlexibleRedirectPolicy(10).retryConditionreturns false for a POST, so a dropped connection doesn't resend the same assertionjti. GETs are retried as before.One detail: Resty retries when any client or request retry condition returns true, so a per-request "no retry" condition can't override the client's
retryCondition. That's why the check sits inretryConditionitself. This covers every POST made through the shared client: the authenticated fetch, list, trust mark and resolve requests,Post/PostCtx, and the key rotation HTTP hook.Tests (
internal/http/http_test.go):Postand throughDo().R().Postasclientauth.gouses it;The new POST tests fail on
mainand pass with this change;go test ./...passes.I added the changelog entry under a new "Unreleased" heading; please move it wherever you prefer.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QYDqsx3UGxpCKvCiUxShZq