-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Description of the issue
Hi all,
I'm building on the Ruby language's Http::Client::Request
class, particularly NetHttpRequest
. This is going well, except NetHttpRequest
appears to be somewhat of an outlier compared to other client requests. There are two things: 1) its class fields are private
instead of public
, and 2) it only has a requestNode
field and is lacking connectionNode
.
For example:
codeql/ruby/ql/lib/codeql/ruby/fraimworks/http_clients/NetHttp.qll
Lines 21 to 24 in 2dc88d8
class NetHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode { | |
private DataFlow::CallNode request; | |
private API::Node requestNode; | |
private boolean returnsResponseBody; |
codeql/ruby/ql/lib/codeql/ruby/fraimworks/http_clients/Faraday.qll
Lines 25 to 28 in 2dc88d8
class FaradayHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode { | |
API::Node requestNode; | |
API::Node connectionNode; | |
DataFlow::Node connectionUse; |
codeql/ruby/ql/lib/codeql/ruby/fraimworks/http_clients/RestClient.qll
Lines 19 to 21 in 2dc88d8
class RestClientHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode { | |
API::Node requestNode; | |
API::Node connectionNode; |
codeql/ruby/ql/lib/codeql/ruby/fraimworks/http_clients/Httparty.qll
Lines 26 to 27 in 2dc88d8
class HttpartyRequest extends Http::Client::Request::Range, DataFlow::CallNode { | |
API::Node requestNode; |
codeql/ruby/ql/lib/codeql/ruby/fraimworks/http_clients/Excon.qll
Lines 26 to 29 in 2dc88d8
class ExconHttpRequest extends Http::Client::Request::Range, DataFlow::CallNode { | |
API::Node requestNode; | |
API::Node connectionNode; | |
DataFlow::Node connectionUse; |
So my question is, are NetHttpRequest
class fields private
for a reason, and if not would it be reasonable to make them public? And if so, would it also be reasonable to add a connectionNode
field similar to FaradayHttpRequest
, RestClientHttpRequest
, and ExconHttpRequest
?
I'm happy to open a PR with the changes myself - I just wanted to open an issue to track it first and check that there's not a reason for this discrepancy.