Exception: LookerSDK::OneTimePasswordRequired
- Inherits:
-
ClientError
- Object
- StandardError
- Error
- ClientError
- LookerSDK::OneTimePasswordRequired
- Defined in:
- lib/looker-sdk/error.rb
Overview
Raised when API returns a 401 HTTP status code and headers include “X-Looker-OTP” look TODO do we want to support this?
Constant Summary collapse
- OTP_DELIVERY_PATTERN =
/required; (\w+)/i
Class Method Summary collapse
Instance Method Summary collapse
-
#password_delivery ⇒ String
Delivery method for the user’s OTP.
Methods inherited from Error
#documentation_url, #error_doc_url, #error_docs, error_for_401, error_for_403, #errors, from_response, #initialize, #marshal_dump, #message
Constructor Details
This class inherits a constructor from LookerSDK::Error
Class Method Details
.required_header(headers) ⇒ Object
235 236 237 |
# File 'lib/looker-sdk/error.rb', line 235 def self.required_header(headers) OTP_DELIVERY_PATTERN.match headers['X-Looker-OTP'].to_s end |
Instance Method Details
#password_delivery ⇒ String
Delivery method for the user’s OTP
242 243 244 |
# File 'lib/looker-sdk/error.rb', line 242 def password_delivery @password_delivery ||= delivery_method_from_header end |