-
Notifications
You must be signed in to change notification settings - Fork 106
Update CHANGELOG.md #829
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Update CHANGELOG.md #829
Conversation
WalkthroughThe pull request updates the Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant C as Client
participant S as Server
U->>C: Initialize client with API key
C->>S: Send request with API key
S-->>C: Process and respond
C-->>U: Return response
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
CHANGELOG.md (1)
15-15
: Clarify Feature Description Consistency
The new entry at line 15 adds "API key support to the baseclient
class." However, the PR objectives mention enhancements for incorporating custom HTTP headers for authentication or metadata purposes. Please verify that this changelog entry accurately reflects the implemented changes. If custom HTTP header support is the intended feature, consider rewording the entry (for example, "Custom HTTP header support for the baseclient
class" or "Added API key and custom header support…") to maintain consistency with the PR summary.
Why are all of these commits separate PRs? |
I'm barely learning how to use GitHub properly, I apologize |
This change elevates support for custom HTTP headers to the base
Client
class, allowing all client implementations—HTTP and WebSocket—to access a shared headers attribute for authentication or metadata purposes.• Updated the
Client
constructor to accept an optional headers argument.• The headers attribute is now accessible from all subclasses, enabling future support in WebSocket clients.
• Maintains full backward compatibility with existing clients.
High Level Overview of Change
This PR introduces shared header support in the top-level
Client
class. The constructor now accepts an optional headers dictionary, which can be used to inject custom HTTP headers into XRPL client requests. This enables more flexible integration with infrastructure providers that require authentication tokens, API keys, or session-based headers.The change ensures that any future client—including WebSocket-based ones—can leverage the same shared configuration without duplicating logic in subclasses like
JsonRpcBase
.Context of Change
PR 763 would add header support only in
JsonRpcBase
, making it unavailable to other clients such as WebSocket-based ones. With XRPL infrastructure increasingly relying on authenticated access, this limitation restricted the usefulness ofxrpl-py
in production environments.By moving headers to the abstract base class, this change unifies the configuration mechanism and enables consistent authentication handling across all clients.
Type of Change
[x] New feature (non-breaking change which adds functionality)
Did you update CHANGELOG.md?
[x] Yes
Test Plan
The change can be tested by:
• Instantiating
JsonRpcBase
with a headers dictionary and verifying that headers are properly merged and included inJSON-RPC
requests.• Creating a mock WebSocket client subclass that accesses
self.headers
and verifying shared availability.• Ensuring backward compatibility by initializing clients without the headers argument and observing unchanged behavior.
Future Tasks
Future tasks related to this change could include:
• Updating WebSocketClient to read from
self.headers
and send them during the handshake if supported.• Standardizing authentication strategies across all clients (e.g., Bearer tokens, session headers).
• Adding test coverage for header usage across both sync and async clients.