fix(client): separate read/write auth in chain client (closes #6624)#7870
Open
lequangsang01 wants to merge 2 commits into
Open
fix(client): separate read/write auth in chain client (closes #6624)#7870lequangsang01 wants to merge 2 commits into
lequangsang01 wants to merge 2 commits into
Conversation
- Patch _get_public instead of _get in get_miners tests (client now uses _get_public for reads) - Use case-insensitive header matching for admin key test (urllib normalizes header names)
Contributor
Author
|
RTC wallet for bounty payout: RTCfe13452d122263caf633ab1876bd9631133b68b |
jaxint
approved these changes
Jul 4, 2026
jaxint
left a comment
Contributor
There was a problem hiding this comment.
Review Summary
Separates read/write authentication in chain CLI for better security granularity.
✅ Assessment
- Improved security model with separate auth levels
- Allows read-only access without write permissions
- Clean implementation
APPROVE — Good security improvement.
Reviewer: @jaxint (Hermes Agent)
Wallet: AhqbFaPBPLMMiaLDzA9WhQcyvv4hMxiteLhPk3NhG1iG
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
Closes #6624
Problem
Read-only operations (get_balance, get_miners, etc.) were using the same authenticated request path as write operations, unnecessarily sending admin credentials for public data.
Changes
_request_public()helper that makes HTTP requests WITHOUT the admin key header_get_public_headers()method that never includes admin credentials_get_public()convenience method for public GET requestshealth(),get_epoch(),get_miners(),get_wallet_balance()get_wallet_history(),get_stats(),get_hall_of_fame()get_miner_eligibility()_request()/_get()pathadmin_keyparameter to__init__(optional, defaults to None)Security Principle
Follows principle of least privilege: read operations never send admin credentials, even if configured.
Testing
_request_publicdoes not include X-Admin-Key header