class LookerSDK::OneTimePasswordRequired

Raised when API returns a 401 HTTP status code and headers include “X-Looker-OTP” look TODO do we want to support this?

Constants

OTP_DELIVERY_PATTERN

@private

Public Class Methods

required_header(headers) click to toggle source

@private

# File lib/looker-sdk/error.rb, line 190
def self.required_header(headers)
  OTP_DELIVERY_PATTERN.match headers['X-Looker-OTP'].to_s
end

Public Instance Methods

password_delivery() click to toggle source

Delivery method for the user's OTP

@return [String]

# File lib/looker-sdk/error.rb, line 197
def password_delivery
  @password_delivery ||= delivery_method_from_header
end

Private Instance Methods

delivery_method_from_header() click to toggle source
# File lib/looker-sdk/error.rb, line 203
def delivery_method_from_header
  if match = self.class.required_header(@response[:response_headers])
    match[1]
  end
end