Jira configuration with proxy options
What does this MR do?
This is part of #216912 (closed), allow Jira configuration to have proxy options. No changelog as this is not a customer-facing change. The next merge request will have the announcement of the functionality.
Step | Merge request |
---|---|
Add proxy database columns | !52119 (merged) |
HTTP connection adapter with proxy settings | !55406 (merged) |
Update JiraService to use the proxy options |
<= We are here |
Set proxy options from the UI |
It passes the Jira proxy settings to the Jira client. The Gitlab::Jira::HttpClient
is a subclass of JIRA::HttpClient
that use HTTParty with DNS rebinding protection.
HTTParty
HTTParty gem requires the http_proxyaddr
without the scheme (http://
or https://
):
HTTParty.get('https://wttr.in?0', options.merge(http_proxyaddr: "http://127.0.0.1", http_proxyport: "8080", http_proxyuser: "test", http_proxypass: "test", verify: false))
SocketError: Failed to open TCP connection to http://127.0.0.1:8080 (getaddrinfo: nodename nor servname provided, or not known)
HTTParty.get('https://wttr.in?0', options.merge(http_proxyaddr: "127.0.0.1", http_proxyport: "8080", http_proxyuser: "test", http_proxypass: "test", verify: false))
=> "<html>\n" +
"<head><title>Weather report: London, United Kingdom</title><meta property=\"og:image\" content=\"http://wttr.in/_0_0pq.png\" /><meta property=\"og:site_name\" content=\"wttr.in\" /><meta property=\"og:type\" content=\"profile\" /><meta property=\"og:url\" content=\"http://wttr.in/?0\" />\n" +
Demo
This is a quick demo that I've recorded. I'm testing the proxy options using mitmproxy as a proxy server.
We already have another issue to improve the error messages that we can see in the demo #323304 (closed).
Screen_Recording_2021-03-15_at_13.32.45
Related to #216912 (closed)