Class: TwoFactorAuth::RegistrationRequest
- Inherits:
-
Object
- Object
- TwoFactorAuth::RegistrationRequest
- Includes:
- Adamantium
- Defined in:
- app/models/two_factor_auth/registration_request.rb
Instance Attribute Summary collapse
-
#app_id ⇒ Object
readonly
Returns the value of attribute app_id.
-
#key_handles ⇒ Object
readonly
Returns the value of attribute key_handles.
Instance Method Summary collapse
- #challenge ⇒ Object
-
#initialize(app_id = TwoFactorAuth.trusted_facet_list_url, key_handles = [], challenge = nil) ⇒ RegistrationRequest
constructor
A new instance of RegistrationRequest.
-
#serialized ⇒ Object
this matches te browser’s u2f api.
- #signs ⇒ Object
Constructor Details
#initialize(app_id = TwoFactorAuth.trusted_facet_list_url, key_handles = [], challenge = nil) ⇒ RegistrationRequest
Returns a new instance of RegistrationRequest.
9 10 11 12 13 |
# File 'app/models/two_factor_auth/registration_request.rb', line 9 def initialize app_id=TwoFactorAuth.trusted_facet_list_url, key_handles=[], challenge=nil @app_id = app_id @key_handles = key_handles @challenge = challenge end |
Instance Attribute Details
#app_id ⇒ Object (readonly)
Returns the value of attribute app_id.
7 8 9 |
# File 'app/models/two_factor_auth/registration_request.rb', line 7 def app_id @app_id end |
#key_handles ⇒ Object (readonly)
Returns the value of attribute key_handles.
7 8 9 |
# File 'app/models/two_factor_auth/registration_request.rb', line 7 def key_handles @key_handles end |
Instance Method Details
#challenge ⇒ Object
15 16 17 |
# File 'app/models/two_factor_auth/registration_request.rb', line 15 def challenge @challenge || TwoFactorAuth::random_encoded_challenge end |
#serialized ⇒ Object
this matches te browser’s u2f api
25 26 27 28 29 30 31 |
# File 'app/models/two_factor_auth/registration_request.rb', line 25 def serialized { appId: app_id, challenge: challenge, version: TwoFactorAuth::U2F_VERSION, }.to_json end |
#signs ⇒ Object
20 21 22 |
# File 'app/models/two_factor_auth/registration_request.rb', line 20 def signs [] end |