Module: Aikido::Zen::Sinks::HTTP::Helpers
- Defined in:
- lib/aikido/zen/sinks/http.rb
Class Method Summary collapse
-
.build_outbound(req) ⇒ Aikido::Zen::OutboundConnection
Maps an HTTP Request to an Aikido OutboundConnection.
- .scan(request, connection, operation) ⇒ Object
-
.wrap_request(req) ⇒ Aikido::Zen::Scanners::SSRFScanner::Request
Wraps the HTTP request with an API we can depend on.
- .wrap_response(resp) ⇒ Object
Class Method Details
.build_outbound(req) ⇒ Aikido::Zen::OutboundConnection
Maps an HTTP Request to an Aikido OutboundConnection.
17 18 19 20 21 22 |
# File 'lib/aikido/zen/sinks/http.rb', line 17 def self.build_outbound(req) OutboundConnection.new( host: req.socket_host, port: req.socket_port ) end |
.scan(request, connection, operation) ⇒ Object
43 44 45 46 47 48 49 |
# File 'lib/aikido/zen/sinks/http.rb', line 43 def self.scan(request, connection, operation) SINK.scan( request: request, connection: connection, operation: operation ) end |
.wrap_request(req) ⇒ Aikido::Zen::Scanners::SSRFScanner::Request
Wraps the HTTP request with an API we can depend on.
28 29 30 31 32 33 34 |
# File 'lib/aikido/zen/sinks/http.rb', line 28 def self.wrap_request(req) Scanners::SSRFScanner::Request.new( verb: req.verb, uri: URI(req.uri.to_s), headers: req.headers.to_h ) end |
.wrap_response(resp) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/aikido/zen/sinks/http.rb', line 36 def self.wrap_response(resp) Scanners::SSRFScanner::Response.new( status: resp.status, headers: resp.headers.to_h ) end |