Class: Aptible::CLI::Helpers::SecurityKey::AuthenticatorParameters
- Inherits:
-
Object
- Object
- Aptible::CLI::Helpers::SecurityKey::AuthenticatorParameters
- Defined in:
- lib/aptible/cli/helpers/security_key.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#assert_str ⇒ Object
readonly
Returns the value of attribute assert_str.
-
#challenge ⇒ Object
readonly
Returns the value of attribute challenge.
-
#client_data ⇒ Object
readonly
Returns the value of attribute client_data.
-
#device_location ⇒ Object
readonly
Returns the value of attribute device_location.
-
#key_handle ⇒ Object
readonly
Returns the value of attribute key_handle.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#rp_id ⇒ Object
readonly
Returns the value of attribute rp_id.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(origin, challenge, app_id, device, device_location) ⇒ AuthenticatorParameters
constructor
A new instance of AuthenticatorParameters.
Constructor Details
#initialize(origin, challenge, app_id, device, device_location) ⇒ AuthenticatorParameters
Returns a new instance of AuthenticatorParameters.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 17 def initialize(origin, challenge, app_id, device, device_location) @origin = origin @challenge = challenge @app_id = app_id @version = device.version @key_handle = device.key_handle @rp_id = device.rp_id @version = device.version @device_location = device_location @client_data = { type: 'webauthn.get', challenge: challenge, origin: origin, crossOrigin: false }.to_json key_handle = Base64.strict_encode64( Base64.urlsafe_decode64(device.key_handle) ) client_data_hash = Digest::SHA256.base64digest(@client_data) in_str = "#{client_data_hash}\n" \ "#{device.rp_id}\n" \ "#{key_handle}" @assert_str = in_str end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
13 14 15 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 13 def app_id @app_id end |
#assert_str ⇒ Object (readonly)
Returns the value of attribute assert_str.
15 16 17 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 15 def assert_str @assert_str end |
#challenge ⇒ Object (readonly)
Returns the value of attribute challenge.
13 14 15 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 13 def challenge @challenge end |
#client_data ⇒ Object (readonly)
Returns the value of attribute client_data.
15 16 17 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 15 def client_data @client_data end |
#device_location ⇒ Object (readonly)
Returns the value of attribute device_location.
14 15 16 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 14 def device_location @device_location end |
#key_handle ⇒ Object (readonly)
Returns the value of attribute key_handle.
13 14 15 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 13 def key_handle @key_handle end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
13 14 15 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 13 def origin @origin end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
14 15 16 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 14 def request @request end |
#rp_id ⇒ Object (readonly)
Returns the value of attribute rp_id.
14 15 16 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 14 def rp_id @rp_id end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
13 14 15 |
# File 'lib/aptible/cli/helpers/security_key.rb', line 13 def version @version end |