Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/webauthn/authenticator_assertion_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
end

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

context "when everything's in place" do
Expand Down
28 changes: 14 additions & 14 deletions spec/webauthn/authenticator_attestation_response_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
context "when everything's in place" do
context "when there is a single origin" do
before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

it_behaves_like "a valid attestation response"
Expand Down Expand Up @@ -131,7 +131,7 @@

before do
WebAuthn.configuration.attestation_root_certificates_finders = finder_for('feitian_ft_fido_0200.pem')
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

it_behaves_like "a valid attestation response"
Expand Down Expand Up @@ -209,7 +209,7 @@
end

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

it_behaves_like "a valid attestation response"
Expand Down Expand Up @@ -250,7 +250,7 @@

before do
WebAuthn.configuration.attestation_root_certificates_finders = finder_for('yubico_u2f_root.pem')
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

it_behaves_like "a valid attestation response"
Expand Down Expand Up @@ -286,7 +286,7 @@
end

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
WebAuthn.configure do |config|
config.algorithms.concat(%w(RS1))
end
Expand Down Expand Up @@ -347,7 +347,7 @@
end

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
allow(attestation_response.attestation_statement).to receive(:time).and_return(time)
end

Expand Down Expand Up @@ -391,7 +391,7 @@
let(:origin) { seeds[:android_key_direct][:origin] }

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

it_behaves_like "a valid attestation response"
Expand Down Expand Up @@ -481,7 +481,7 @@
end

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]

# Apple credential certificate expires after 3 days apparently.
# Seed data was obtained 22nd Feb 2021, so we are simulating validation within that 3 day timeframe
Expand All @@ -504,7 +504,7 @@

context "when no client data received" do
before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

it "returns user-friendly error if no client data received" do
Expand Down Expand Up @@ -534,7 +534,7 @@
end

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

context "matches the default one" do
Expand Down Expand Up @@ -610,7 +610,7 @@
let(:client) { WebAuthn::FakeClient.new(origin, token_binding: token_binding, encoding: false) }

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

context "it has stuff" do
Expand Down Expand Up @@ -718,7 +718,7 @@

describe "user verification" do
before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

context "when UV is not set" do
Expand All @@ -738,7 +738,7 @@

describe "attested credential data verification" do
before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

context "when AT is not set" do
Expand Down Expand Up @@ -783,7 +783,7 @@
before do
attestation_response.attestation_statement.instance_variable_get(:@statement)["sig"] =
"corrupted signature".b
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

context "when verification is set to true" do
Expand Down
2 changes: 1 addition & 1 deletion spec/webauthn/credential_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
let(:origin) { fake_origin }

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

describe ".from_create" do
Expand Down
2 changes: 1 addition & 1 deletion spec/webauthn/public_key_credential_with_assertion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
end

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

it "works" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
let(:origin) { fake_origin }

before do
WebAuthn.configuration.origin = origin
WebAuthn.configuration.allowed_origins = [origin]
end

it "works" do
Expand Down
4 changes: 2 additions & 2 deletions spec/webauthn/relying_party_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@

before do
WebAuthn.configure do |config|
config.origin = "https://www.example.com"
config.allowed_origins = ["https://www.example.com"]
config.rp_name = "Example Consumer page"
end
end
Expand Down Expand Up @@ -391,7 +391,7 @@

before do
WebAuthn.configure do |config|
config.origin = "https://www.example.com"
config.allowed_origins = ["https://www.example.com"]
config.rp_name = "Example Consumer page"
end
end
Expand Down