Skip to content

Commit

Permalink
refactor: fix ruby 2.7 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
grzuy committed Nov 24, 2019
1 parent ae80ad7 commit f561c56
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/webauthn/authenticator_assertion_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def self.from_client(response)
attr_reader :user_handle

def initialize(authenticator_data:, signature:, user_handle: nil, **options)
super(options)
super(**options)

@authenticator_data_bytes = authenticator_data
@signature = signature
Expand Down
2 changes: 1 addition & 1 deletion lib/webauthn/authenticator_attestation_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def self.from_client(response)
attr_reader :attestation_type, :attestation_trust_path

def initialize(attestation_object:, **options)
super(options)
super(**options)

@attestation_object = attestation_object
end
Expand Down
4 changes: 2 additions & 2 deletions lib/webauthn/authenticator_response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ def verify(expected_challenge, expected_origin = nil, user_verification: nil, rp
true
end

def valid?(*args)
verify(*args)
def valid?(*args, **keyword_arguments)
verify(*args, **keyword_arguments)
rescue WebAuthn::VerificationError
false
end
Expand Down
8 changes: 4 additions & 4 deletions lib/webauthn/credential.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

module WebAuthn
module Credential
def self.options_for_create(*args)
WebAuthn::PublicKeyCredential::CreationOptions.new(*args)
def self.options_for_create(**keyword_arguments)
WebAuthn::PublicKeyCredential::CreationOptions.new(**keyword_arguments)
end

def self.options_for_get(*args)
WebAuthn::PublicKeyCredential::RequestOptions.new(*args)
def self.options_for_get(**keyword_arguments)
WebAuthn::PublicKeyCredential::RequestOptions.new(**keyword_arguments)
end

def self.from_create(credential)
Expand Down
4 changes: 2 additions & 2 deletions lib/webauthn/public_key_credential/creation_options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ def initialize(
rp[:name] ||= configuration.rp_name
rp[:id] ||= configuration.rp_id

RPEntity.new(rp)
RPEntity.new(**rp)
else
rp
end

@user =
if user.is_a?(Hash)
UserEntity.new(user)
UserEntity.new(**user)
else
user
end
Expand Down

0 comments on commit f561c56

Please sign in to comment.