Exception: MgmtConsole::OneTimePasswordRequired
- Inherits:
-
ClientError
- Object
- StandardError
- Error
- ClientError
- MgmtConsole::OneTimePasswordRequired
- Defined in:
- lib/mgmt_console/error.rb
Overview
Raised when GitHub returns a 401 HTTP status code and headers include “X-GitHub-OTP”
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_for_401, error_for_403, #errors, from_response, #initialize
Constructor Details
This class inherits a constructor from MgmtConsole::Error
Class Method Details
.required_header(headers) ⇒ Object
163 164 165 |
# File 'lib/mgmt_console/error.rb', line 163 def self.required_header(headers) OTP_DELIVERY_PATTERN.match headers['X-GitHub-OTP'].to_s end |
Instance Method Details
#password_delivery ⇒ String
Delivery method for the user’s OTP
170 171 172 |
# File 'lib/mgmt_console/error.rb', line 170 def password_delivery @password_delivery ||= delivery_method_from_header end |