Skip to content

Commit

Permalink
Update more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micolous committed Nov 24, 2023
1 parent 8b5c588 commit 57270cb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 32 deletions.
4 changes: 2 additions & 2 deletions compat_tester/webauthn-rs-demo/src/actors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use webauthn_rs_core::proto::{
};
use webauthn_rs_core::proto::{AuthenticationState, RegistrationState};

use webauthn_rs::{prelude::Uuid, Webauthn, WebauthnBuilder};
use webauthn_rs::{prelude::Uuid, Webauthn, WebauthnBuilder, DEFAULT_AUTHENTICATOR_TIMEOUT};
use webauthn_rs_core::WebauthnCore;
use webauthn_rs_demo_shared::*;

Expand Down Expand Up @@ -61,7 +61,7 @@ impl WebauthnActor {
&rp_name,
&rp_id,
vec![rp_origin.to_owned()],
None,
DEFAULT_AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down
1 change: 1 addition & 0 deletions fido-key-manager/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use std::time::Duration;
use tokio_stream::StreamExt;
#[cfg(feature = "solokey")]
use webauthn_authenticator_rs::ctap2::SoloKeyAuthenticator;
#[cfg(feature = "solokey")]
use webauthn_authenticator_rs::prelude::WebauthnCError;
use webauthn_authenticator_rs::{
ctap2::{
Expand Down
63 changes: 33 additions & 30 deletions webauthn-rs-core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1345,6 +1345,7 @@ mod tests {
use crate::{internals::*, AttestationFormat};
use base64::{engine::general_purpose::STANDARD, Engine};
use base64urlsafedata::Base64UrlSafeData;
use std::time::Duration;
use url::Url;

use webauthn_rs_device_catalog::data::{
Expand All @@ -1355,6 +1356,8 @@ mod tests {
yubico::YUBICO_U2F_ROOT_CA_SERIAL_457200631_PEM,
};

const AUTHENTICATOR_TIMEOUT: Duration = Duration::from_secs(60);

// Test the crypto operations of the webauthn impl

#[test]
Expand All @@ -1364,7 +1367,7 @@ mod tests {
"http://127.0.0.1:8080/auth",
"127.0.0.1",
vec![Url::parse("http://127.0.0.1:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -1415,7 +1418,7 @@ mod tests {
"webauthn.io",
"webauthn.io",
vec![Url::parse("https://webauthn.io").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -1460,7 +1463,7 @@ mod tests {
"localhost:8443/auth",
"localhost",
vec![Url::parse("https://localhost:8443").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -1505,7 +1508,7 @@ mod tests {
"localhost:8080/auth",
"localhost",
vec![Url::parse("http://localhost:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -1550,7 +1553,7 @@ mod tests {
"webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au/compat_test").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -1595,7 +1598,7 @@ mod tests {
"webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au/compat_test").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -1643,7 +1646,7 @@ mod tests {
"localhost:8080/auth",
"localhost",
vec![Url::parse("http://localhost:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -1765,7 +1768,7 @@ mod tests {
"https://testing.local",
"testing.local",
vec![Url::parse("https://testing.local").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -1888,7 +1891,7 @@ mod tests {
"https://172.20.0.141:8443/auth",
"172.20.0.141",
vec![Url::parse("https://172.20.0.141:8443").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -2015,7 +2018,7 @@ mod tests {
"https://etools-dev.example.com:8080/auth",
"etools-dev.example.com",
vec![Url::parse("https://etools-dev.example.com:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -2159,7 +2162,7 @@ mod tests {
"https://etools-dev.example.com:8080/auth",
"etools-dev.example.com",
vec![Url::parse("https://etools-dev.example.com:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -2475,7 +2478,7 @@ mod tests {
"https://etools-dev.example.com:8080/auth",
"etools-dev.example.com",
vec![Url::parse("https://etools-dev.example.com:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -2509,7 +2512,7 @@ mod tests {
"https://spectral.local:8443/auth",
"spectral.local",
vec![Url::parse("https://spectral.local:8443").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -2711,7 +2714,7 @@ mod tests {
"https://spectral.local:8443/auth",
"spectral.local",
vec![Url::parse("https://spectral.local:8443").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -2854,7 +2857,7 @@ mod tests {
"http://127.0.0.1:8080/auth",
"127.0.0.1",
vec![Url::parse("http://127.0.0.1:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3005,7 +3008,7 @@ mod tests {
"rp_name",
"idm.example.com",
vec![Url::parse("https://idm.example.com:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
Some(true),
None,
);
Expand Down Expand Up @@ -3177,7 +3180,7 @@ mod tests {
"http://localhost:8080/auth",
"localhost",
vec![Url::parse("http://localhost:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3221,7 +3224,7 @@ mod tests {
"https://webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3267,7 +3270,7 @@ mod tests {
"https://webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3311,7 +3314,7 @@ mod tests {
"https://webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3353,7 +3356,7 @@ mod tests {
"https://webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3396,7 +3399,7 @@ mod tests {
"https://webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3444,7 +3447,7 @@ mod tests {
"https://webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3491,7 +3494,7 @@ mod tests {
"http://localhost:8080/auth",
"localhost",
vec![Url::parse("http://localhost:8080").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3611,7 +3614,7 @@ mod tests {
"webauthn.io",
"webauthn.io",
vec![Url::parse("https://webauthn.io").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3671,7 +3674,7 @@ mod tests {
"webauthn.io",
"webauthn.io",
vec![Url::parse("https://webauthn.io").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3730,7 +3733,7 @@ mod tests {
"webauthn.org",
"webauthn.org",
vec![Url::parse("https://webauthn.org").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3799,7 +3802,7 @@ mod tests {
"webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3866,7 +3869,7 @@ mod tests {
"webauthn.firstyear.id.au",
"webauthn.firstyear.id.au",
vec![Url::parse("https://webauthn.firstyear.id.au").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down Expand Up @@ -3920,7 +3923,7 @@ mod tests {
"localhost",
"localhost",
vec![Url::parse("http://localhost:8080/").unwrap()],
None,
AUTHENTICATOR_TIMEOUT,
None,
None,
);
Expand Down

0 comments on commit 57270cb

Please sign in to comment.