Skip to content

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update CHANGELOG.md #829

wants to merge 1 commit into from

Conversation

joshuahamsa
Copy link

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 of xrpl-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 in JSON-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.

Copy link
Contributor

coderabbitai bot commented Apr 10, 2025

Walkthrough

The pull request updates the CHANGELOG.md file to document new functionality. It adds an entry under the "Added" section noting API key support for the base client class (referenced as [#828]). Additionally, it revises an existing entry to indicate that model validation now includes parameter type checking.

Changes

File Change Summary
CHANGELOG.md Added new entry for API key support in the base client class (ref. [#828]); updated model validation entry to include parameter type checking.

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
Loading

Suggested reviewers

  • anissa-ripple
  • justinr1234

Poem

I'm a bunny with a hop and a cheer,
Coding changes that now appear,
API keys shimmer in the light,
Model checks are now just right,
With burrowed joy, I celebrate each line!
🐇✨


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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 base client 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 base client class" or "Added API key and custom header support…") to maintain consistency with the PR summary.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 109c413 and c79d65f.

📒 Files selected for processing (1)
  • CHANGELOG.md (1 hunks)

@mvadari
Copy link
Collaborator

mvadari commented Apr 10, 2025

Why are all of these commits separate PRs?

@joshuahamsa
Copy link
Author

I'm barely learning how to use GitHub properly, I apologize

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants