Module: HTTPX::Plugins::Auth::RequestMethods
- Defined in:
- lib/httpx/plugins/auth.rb,
sig/plugins/auth.rbs
Instance Attribute Summary collapse
-
#auth_token_value ⇒ String?
readonly
Returns the value of attribute auth_token_value.
Instance Method Summary collapse
Instance Attribute Details
#auth_token_value ⇒ String? (readonly)
Returns the value of attribute auth_token_value.
146 147 148 |
# File 'lib/httpx/plugins/auth.rb', line 146 def auth_token_value @auth_token_value end |
Instance Method Details
#authorize(auth_value) ⇒ void
This method returns an undefined value.
165 166 167 168 169 170 171 172 173 174 |
# File 'lib/httpx/plugins/auth.rb', line 165 def (auth_value) @auth_header_value = auth_value if (auth_type = @options.auth_header_type) @auth_header_value = "#{auth_type} #{@auth_header_value}" end @headers.add("authorization", @auth_header_value) @auth_token_value = auth_value end |
#authorized? ⇒ Boolean
153 154 155 |
# File 'lib/httpx/plugins/auth.rb', line 153 def !@auth_token_value.nil? end |
#initialize ⇒ Object
148 149 150 151 |
# File 'lib/httpx/plugins/auth.rb', line 148 def initialize(*) super @auth_token_value = @auth_header_value = nil end |
#unauthorize! ⇒ void
This method returns an undefined value.
157 158 159 160 161 162 163 |
# File 'lib/httpx/plugins/auth.rb', line 157 def return unless (auth_value = @auth_header_value) @headers.get("authorization").delete(auth_value) @auth_token_value = @auth_header_value = nil end |