-
Notifications
You must be signed in to change notification settings - Fork 129
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
RUMM-1350 let customer set up a Proxy for data upload #582
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.
Looks great!
I've some minor changes to make in the tests implementation: the as AnyHashable
can be removed when setting the proxy parameter keys!
let proxyConfiguration: [AnyHashable: Any] = [ | ||
kCFNetworkProxiesHTTPEnable as AnyHashable: true, | ||
kCFNetworkProxiesHTTPPort as AnyHashable: 123, | ||
kCFNetworkProxiesHTTPProxy as AnyHashable: "www.example.com", | ||
kCFProxyUsernameKey as AnyHashable: "proxyuser", | ||
kCFProxyPasswordKey as AnyHashable: "proxypass", | ||
] |
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.
All casting as AnyHashable
are redundant, it is enforced by the dictionary type.
It also valid for all getter in further assertions.
let proxyConfiguration: [AnyHashable: Any] = [ | |
kCFNetworkProxiesHTTPEnable as AnyHashable: true, | |
kCFNetworkProxiesHTTPPort as AnyHashable: 123, | |
kCFNetworkProxiesHTTPProxy as AnyHashable: "www.example.com", | |
kCFProxyUsernameKey as AnyHashable: "proxyuser", | |
kCFProxyPasswordKey as AnyHashable: "proxypass", | |
] | |
let proxyConfiguration: [AnyHashable: Any] = [ | |
kCFNetworkProxiesHTTPEnable: true, | |
kCFNetworkProxiesHTTPPort: 123, | |
kCFNetworkProxiesHTTPProxy: "www.example.com", | |
kCFProxyUsernameKey: "proxyuser", | |
kCFProxyPasswordKey: "proxypass", | |
] |
] | ||
let configuration = try createConfiguration(proxyConfiguration: proxyConfiguration) | ||
|
||
XCTAssertEqual(configuration.common.proxyConfiguration?[kCFNetworkProxiesHTTPEnable as AnyHashable] as? Bool, true) |
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.
XCTAssertEqual(configuration.common.proxyConfiguration?[kCFNetworkProxiesHTTPEnable as AnyHashable] as? Bool, true) | |
XCTAssertEqual(configuration.common.proxyConfiguration?[kCFNetworkProxiesHTTPEnable] as? Bool, true) |
@@ -180,6 +180,13 @@ class DDConfigurationTests: XCTestCase { | |||
objcBuilder.set(additionalConfiguration: ["foo": 42, "bar": "something"]) | |||
XCTAssertEqual(objcBuilder.build().sdkConfiguration.additionalConfiguration["foo"] as? Int, 42) | |||
XCTAssertEqual(objcBuilder.build().sdkConfiguration.additionalConfiguration["bar"] as? String, "something") | |||
|
|||
objcBuilder.set(proxyConfiguration: [kCFNetworkProxiesHTTPEnable as AnyHashable: true, kCFNetworkProxiesHTTPPort as AnyHashable: 123, kCFNetworkProxiesHTTPProxy as AnyHashable: "www.example.com", kCFProxyUsernameKey as AnyHashable: "proxyuser", kCFProxyPasswordKey as AnyHashable: "proxypass" ]) |
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.
/nit
objcBuilder.set(proxyConfiguration: [kCFNetworkProxiesHTTPEnable as AnyHashable: true, kCFNetworkProxiesHTTPPort as AnyHashable: 123, kCFNetworkProxiesHTTPProxy as AnyHashable: "www.example.com", kCFProxyUsernameKey as AnyHashable: "proxyuser", kCFProxyPasswordKey as AnyHashable: "proxypass" ]) | |
objcBuilder.set(proxyConfiguration: [ | |
kCFNetworkProxiesHTTPEnable: true, | |
kCFNetworkProxiesHTTPPort: 123, | |
kCFNetworkProxiesHTTPProxy: "www.example.com", | |
kCFProxyUsernameKey: "proxyuser", | |
kCFProxyPasswordKey: "proxypass" | |
]) |
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.
👌
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.
Small edit suggestion, otherwise LGTM!
Co-authored-by: Sarina Bloodgood <[email protected]>
226ca52
to
22e44de
Compare
What and why?
Let a customer setup a custom Proxy for data intake.
How?
A new method let's the customer provide the proxy configuration dictionary that will be forwarded to the HttpClient to create the
URLSession
.Review checklist