Repository navigation
Conversation
SimpleEntityCollector only logged a failed federation_list_endpoint or
federation_collection_endpoint request, so a caller got an empty or
partial collection whether the federation had no members, refused the
request (401/403, or required client authentication), or was down.
The collector now calls an optional OnListError hook wherever it logged
such an error. Refusals are reported as *ListRefusedError{Authority,
Status}: httpFetchList returns it for a 401 or 403 answer, and without
sending a request (Status 0) when federation_list_endpoint_auth_methods
lacks "none" and no client authentication can satisfy it (private_key_jwt
with DefaultClientAuth set is not a refusal). A failed collection
endpoint is reported only when no list traversal follows it, since a
failing list traversal reports itself. A nil hook changes nothing.
Fixes go-oidfed#217
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QYDqsx3UGxpCKvCiUxShZq
internal/http reports an error response only when its body decodes into an OpenID Federation error object. For any other error answer, such as a reverse proxy's plain-text 401 in front of a private list endpoint or an HTML 502, httpFetchList read the empty result it passed in, so the authority looked as if it had no subordinates and SimpleEntityCollector silently dropped its subtree. httpFetchList now checks resp.IsError() after the error-body check: a 401 or 403 is a *ListRefusedError, any other non-2xx answer an error naming the entity and status. An empty 200 list is still an empty list. Fixes go-oidfed#218 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 3:46p.m. | Review ↗ | |
| Code coverage | Nov 12, 2026 4:16p.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 #218. Builds on #219 (#217): this branch contains that PR's commit, so please merge #219 first. The diff of its own is the second commit.
internal/httpreports an error response only when its body decodes into an OpenID Federation error object. For any other error answer,httpFetchListread the empty result it passed in. That covers a reverse proxy's plain-text 401 in front of a private list endpoint, or an HTML 502. The authority then looked as if it had no subordinates, andSimpleEntityCollectorsilently dropped its subtree.httpFetchListnow checksresp.IsError()after the error-body check:*ListRefusedError;list endpoint of <entity> answered HTTP <status>;Tests (
entity_collection_refusal_test.go):TestCollectorReportsPlainErrorResponses: plain-text and HTML 401/403 and a 502, with httpmock string responders. It fails on Report list endpoint errors from SimpleEntityCollector #219's code and passes with this change.TestCollectorEmptyListIsNotAnError: an empty[]answer with 200 is neither a refusal nor an error.go test ./...passes.As the issue notes, other
GetCtx/PostCtxcallers that pass a result type (resolve, collection) follow the same pattern. This PR leaves them alone.🤖 Generated with Claude Code
https://claude.ai/code/session_01QYDqsx3UGxpCKvCiUxShZq