mirror of
https://github.com/HoneyryderChuck/httpx.git
synced 2025-10-05 00:02:38 -04:00
also adding some checks on code, in order for steep to stop complaining about potential nil returns.
47 lines
1.2 KiB
Plaintext
47 lines
1.2 KiB
Plaintext
module HTTPX
|
|
class HTTPProxyError < Error
|
|
end
|
|
|
|
module Plugins
|
|
module Proxy
|
|
Error: singleton(HTTPProxyError)
|
|
PROXY_ERRORS: Array[singleton(StandardError)]
|
|
|
|
class Parameters
|
|
attr_reader uri: URI::Generic
|
|
attr_reader username: String?
|
|
attr_reader password: String?
|
|
|
|
def authenticated?: () -> boolish
|
|
def token_authentication: () -> String?
|
|
|
|
def ==: (untyped) -> bool
|
|
|
|
private
|
|
|
|
def initialize: (uri: generic_uri, ?username: String, ?password: String) -> untyped
|
|
end
|
|
|
|
def self.configure: (singleton(Session)) -> void
|
|
|
|
type proxyParam = Parameters | Hash[Symbol, untyped]
|
|
|
|
interface _ProxyOptions
|
|
def proxy: () -> proxyParam?
|
|
end
|
|
|
|
def self.extra_options: (Options) -> (Options & _ProxyOptions)
|
|
|
|
module InstanceMethods
|
|
private
|
|
|
|
def proxy_uris: (generic_uri, Options & _ProxyOptions) -> { uri: generic_uri, username: String, password: String }
|
|
| (generic_uri, Options & _ProxyOptions) -> { uri: generic_uri }
|
|
| (generic_uri, Options & _ProxyOptions) -> nil
|
|
end
|
|
end
|
|
|
|
type sessionProxy = Session & Proxy::InstanceMethods
|
|
end
|
|
end
|