-
Notifications
You must be signed in to change notification settings - Fork 61
Add proxy support to AppStoreServerAPIClient #196
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
|
Is this not already handled here? #93 |
Thank you for the review! Our production system integrates with multiple payment and service providers. Each provider has different network requirements and often needs to be routed through a dedicated proxy for security auditing, logging, or region-specific routing. The current implementation of AppStoreServerAPIClient relies on global JVM proxy configuration (java.net.ProxySelector or system properties such as https.proxyHost). By adding an optional constructor that accepts a java.net.Proxy, this PR enables: Per-client, per-channel proxy routing. Independent network configurations for different service integrations. Full backward compatibility — the existing constructors and behavior remain unchanged. This change is minimal, safe, and improves flexibility for enterprise or multi-tenant payment systems that interact with the App Store Server API alongside other vendors. |
| * @param environment The environment to target | ||
| * @param proxy Optional HTTP proxy (can be null for direct connection) | ||
| */ | ||
| public AppStoreServerAPIClient(BearerTokenAuthenticatorInterface bearerTokenAuthenticator, |
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.
Can we have the existing constructor delegate to these new constructors with a null proxy please? That should reduce code duplication
| * @param issuerId Your issuer ID from the Keys page in App Store Connect | ||
| * @param bundleId Your app’s bundle ID | ||
| * @param environment The environment to target | ||
| * @param proxy Optional HTTP proxy (can be null for direct connection) |
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.
Could we reword this slightly to HTTP Proxy, use null for direct connections
Summary
This PR adds an optional constructor to AppStoreServerAPIClient that allows users
to provide a custom java.net.Proxy for outbound HTTPS connections.
Motivation
Some developers need to route App Store Server API requests through corporate
proxies or debugging tools (e.g., Charles, Fiddler). This change preserves
backward compatibility while enabling flexible network configuration.
Changes
java.net.Proxy