Exception: LookerSDK::OneTimePasswordRequired

Inherits:
ClientError show all
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

Methods inherited from Error

#documentation_url, #error_doc_url, #error_docs, error_for_401, error_for_403, #errors, from_response, #initialize, #message

Constructor Details

This class inherits a constructor from LookerSDK::Error

Class Method Details

.required_header(headers) ⇒ Object



229
230
231
# File 'lib/looker-sdk/error.rb', line 229

def self.required_header(headers)
  OTP_DELIVERY_PATTERN.match headers['X-Looker-OTP'].to_s
end

Instance Method Details

#password_deliveryString

Delivery method for the user’s OTP

Returns:

  • (String)


236
237
238
# File 'lib/looker-sdk/error.rb', line 236

def password_delivery
  @password_delivery ||= delivery_method_from_header
end