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
Contributor
|
|
Overall Grade |
Security Reliability Complexity Hygiene |
Code Review Summary
| Analyzer | Status | Updated (UTC) | Details |
|---|---|---|---|
| Go | Nov 12, 2026 3:45p.m. | Review ↗ | |
| Code coverage | Nov 12, 2026 4:15p.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 #217.
SimpleEntityCollectornow reports the list and collection errors it used to only log, so a caller can tell a federation that does not publish its member list from one that has none:SimpleEntityCollector.OnListError func(authority string, err error). It is called, in addition to the existing log line, wherever the collector met an error reading an authority'sfederation_list_endpointor a subordinate'sfederation_collection_endpoint. It may be called concurrently. A nil hook changes nothing.ListRefusedError{Authority, Status}.httpFetchListreturns it:Status0) whenfederation_list_endpoint_auth_methodslacksnoneand no client authentication can satisfy it.private_key_jwtwithDefaultClientAuthset is not a refusal.Tests (
entity_collection_refusal_test.go):The new tests fail to build on
main, because the hook and error type don't exist there, and pass with this change.go test ./...passes.go vetreports the same five copylocks warnings inmock_tm.goandtrustanchor.goas onmain.The changelog entry goes under a new "Features" heading in "Unreleased". #218 builds on this change and is opened as a separate PR.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QYDqsx3UGxpCKvCiUxShZq