-
Notifications
You must be signed in to change notification settings - Fork 0
Add support for aggregator API keys #17
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?
Conversation
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.
Pull Request Overview
This PR adds support for sending API keys to the subscription proxy of aggregators, enabling authentication for protected endpoints. It also introduces new exception types for handling authorization and rate limiting errors.
Key changes:
- Adds API key support to AggregatorClient with optional authentication
- Introduces UnauthorizedException and RateLimitExceededException for error handling
- Updates JsonRpcHttpTransport to handle API key headers and HTTP error responses
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
TestApiKeyIntegration.java | Comprehensive test suite for API key authentication scenarios |
MockAggregatorServer.java | Test mock server with API key validation and rate limiting simulation |
UnauthorizedException.java | New exception for HTTP 401 unauthorized errors |
RateLimitExceededException.java | New exception for HTTP 429 rate limit errors with retry information |
JsonRpcHttpTransport.java | Enhanced transport layer with API key support and error handling |
AggregatorClient.java | Updated client with optional API key constructor and authentication |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
src/main/java/org/unicitylabs/sdk/jsonrpc/RateLimitExceededException.java
Outdated
Show resolved
Hide resolved
src/main/java/org/unicitylabs/sdk/jsonrpc/JsonRpcHttpTransport.java
Outdated
Show resolved
Hide resolved
…eption.java Co-authored-by: Copilot <[email protected]>
…etwork/java-state-transition-sdk into aggregator-subscription-support
…like specific HTTP header names
This adds support for sending API keys to the subscription proxy of aggregators. It also adds a couple of exceptions for error cases.