Skip to content

Commit

Permalink
Add signeture of Faraday::Connection#ssl
Browse files Browse the repository at this point in the history
  • Loading branch information
rhiroe committed Sep 24, 2024
1 parent f7684ee commit acfff54
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gems/faraday/2.5/_test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
faraday.request :url_encoded
faraday.response :logger, bodies: true
faraday.adapter :net_http
faraday.ssl.client_cert = 'client_cert'
faraday.ssl.client_key = 'client_key'
end
conn.post(URI("http://example.com/post"))
response = conn.post('/post') do |req|
Expand Down
18 changes: 18 additions & 0 deletions gems/faraday/2.5/faraday.rbs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ module Faraday
include _BuilderDelegatable

attr_reader headers: Hash[String, String]
attr_reader ssl: SSLOptions

def get: (?String | URI url, ?untyped params, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response
def head: (?String | URI url, ?untyped params, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response
Expand All @@ -122,6 +123,23 @@ module Faraday
def patch: (?String | URI url, ?untyped body, ?untyped headers) ?{ (Faraday::Request) -> void } -> Faraday::Response
end

class SSLOptions
attr_accessor verify: untyped
attr_accessor verify_hostname: untyped
attr_accessor ca_file: untyped
attr_accessor ca_path: untyped
attr_accessor verify_mode: untyped
attr_accessor cert_store: untyped
attr_accessor client_cert: untyped
attr_accessor client_key: untyped
attr_accessor certificate: untyped
attr_accessor private_key: untyped
attr_accessor verify_depth: untyped
attr_accessor version: untyped
attr_accessor min_version: untyped
attr_accessor max_version: untyped
end

class Error < StandardError
attr_reader response: Hash[Symbol, untyped]?
attr_reader wrapped_exception: Exception?
Expand Down

0 comments on commit acfff54

Please sign in to comment.