From 3ab57cd13eac31b9df89114d2cbb7e49dae340aa Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Fri, 13 Dec 2024 13:04:12 -0500 Subject: [PATCH 1/6] chore(CI): Fix cargo deny issues --- Cargo.lock | 349 ++++++++++++++++++++++++++++++++++++++++++++++++----- Cargo.toml | 6 +- deny.toml | 4 +- 3 files changed, 328 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0b1c6e29bf..d894c13e555 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -803,7 +803,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -5500,6 +5500,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -5508,12 +5626,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -6473,9 +6602,9 @@ dependencies = [ "move-core-types", "move-package", "p256 0.13.2", - "passkey-authenticator", + "passkey-authenticator 0.2.0", "passkey-client", - "passkey-types", + "passkey-types 0.3.0", "prometheus", "rand 0.8.5", "serde", @@ -8209,9 +8338,9 @@ dependencies = [ "p256 0.13.2", "packable", "parking_lot 0.12.3", - "passkey-authenticator", + "passkey-authenticator 0.2.0", "passkey-client", - "passkey-types", + "passkey-types 0.3.0", "prometheus", "proptest", "proptest-derive", @@ -8275,7 +8404,7 @@ version = "0.8.0-alpha" dependencies = [ "proc-macro2 1.0.86", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -8972,6 +9101,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "lock_api" version = "0.4.12" @@ -10066,7 +10201,7 @@ dependencies = [ "proc-macro2 1.0.86", "quote 1.0.37", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -11048,21 +11183,33 @@ dependencies = [ "coset", "log", "p256 0.13.2", - "passkey-types", + "passkey-types 0.2.0", + "rand 0.8.5", +] + +[[package]] +name = "passkey-authenticator" +version = "0.4.0" +source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" +dependencies = [ + "async-trait", + "coset", + "log", + "p256 0.13.2", + "passkey-types 0.4.0", "rand 0.8.5", ] [[package]] name = "passkey-client" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f14d42b14749cc7927add34a9932b3b3cc5349a633384850baa67183061439dd" +version = "0.4.0" +source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" dependencies = [ "ciborium", "coset", "idna", - "passkey-authenticator", - "passkey-types", + "passkey-authenticator 0.4.0", + "passkey-types 0.4.0", "public-suffix", "serde", "serde_json", @@ -11089,6 +11236,49 @@ dependencies = [ "typeshare", ] +[[package]] +name = "passkey-types" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b5d3d17d8ad54ba7c7574595f026244ab06ee44f0524379c1575a95aab4c030" +dependencies = [ + "bitflags 2.6.0", + "ciborium", + "coset", + "data-encoding", + "getrandom 0.2.15", + "hmac", + "indexmap 2.5.0", + "rand 0.8.5", + "serde", + "serde_json", + "sha2 0.10.8", + "strum 0.25.0", + "typeshare", + "zeroize", +] + +[[package]] +name = "passkey-types" +version = "0.4.0" +source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" +dependencies = [ + "bitflags 2.6.0", + "ciborium", + "coset", + "data-encoding", + "getrandom 0.2.15", + "hmac", + "indexmap 2.5.0", + "rand 0.8.5", + "serde", + "serde_json", + "sha2 0.10.8", + "strum 0.25.0", + "typeshare", + "zeroize", +] + [[package]] name = "password-hash" version = "0.4.2" @@ -11904,8 +12094,7 @@ dependencies = [ [[package]] name = "public-suffix" version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a59553bc595dc1514e7d713e6167cf1c4d68ef6fcc2d10ad834a97a1ca9bc4" +source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" [[package]] name = "quanta" @@ -14337,6 +14526,17 @@ dependencies = [ "unicode-xid 0.2.6", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + [[package]] name = "sysinfo" version = "0.31.4" @@ -14710,6 +14910,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -15466,12 +15676,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-ident" version = "1.0.13" @@ -15563,9 +15767,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", @@ -15585,6 +15789,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -16218,6 +16434,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "ws_stream_wasm" version = "0.7.4" @@ -16328,6 +16556,30 @@ dependencies = [ "time", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", + "synstructure 0.13.1", +] + [[package]] name = "yup-oauth2" version = "8.3.2" @@ -16376,6 +16628,27 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", + "synstructure 0.13.1", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -16397,6 +16670,28 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 2.0.77", +] + [[package]] name = "zip" version = "0.6.6" diff --git a/Cargo.toml b/Cargo.toml index 277ac3a5492..af88d11a3a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -285,8 +285,10 @@ once_cell = "1.18.0" p256 = { version = "0.13.2", features = ["ecdsa"] } parking_lot = "0.12.1" passkey-authenticator = { version = "0.2.0" } -passkey-client = { version = "0.2.0" } -passkey-types = { version = "0.2.0" } +# TODO: Re-enable when passkey-client 0.4.0 is released +# passkey-client = "0.3.0" +passkey-client = { git = "https://github.com/1Password/passkey-rs", rev = "9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" } +passkey-types = "0.3.0" pretty_assertions = "1.3.0" proc-macro2 = "1.0.47" prometheus = "0.13.3" diff --git a/deny.toml b/deny.toml index 73541741be8..74afba96f66 100644 --- a/deny.toml +++ b/deny.toml @@ -88,6 +88,7 @@ allow = [ "BSL-1.0", "Unicode-DFS-2016", "OpenSSL", + "Unicode-3.0", # "Apache-2.0 WITH LLVM-exception", ] # The confidence threshold for detecting a license from license text. @@ -98,8 +99,6 @@ confidence-threshold = 0.8 # Allow 1 or more licenses on a per-crate basis, so that particular licenses # aren't accepted for every possible crate as with the normal allow list exceptions = [ - { allow = ["GPL-2.0"], name = "mysqlclient-src" }, - # Each entry is the crate and version constraint, and its specific allow # list # { allow = ["Zlib"], name = "adler32", version = "*" }, @@ -238,6 +237,7 @@ allow-git = [ "https://github.com/iotaledger/iota-rust-sdk.git", "https://github.com/bmwill/openapiv3.git", "https://github.com/bmwill/axum-server.git", + "https://github.com/1Password/passkey-rs.git" ] [sources.allow-org] From 364ac0d8dda60e0f2b967a930210d7199e4d2d02 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Fri, 13 Dec 2024 13:20:40 -0500 Subject: [PATCH 2/6] fix errors --- Cargo.lock | 77 ++++--------------- Cargo.toml | 8 +- crates/iota-e2e-tests/Cargo.toml | 4 +- .../iota-e2e-tests/tests/passkey_e2e_tests.rs | 40 ++++++---- crates/iota-types/Cargo.toml | 4 +- .../iota-types/src/passkey_authenticator.rs | 2 +- .../unit_tests/passkey_authenticator_test.rs | 44 ++++++----- 7 files changed, 73 insertions(+), 106 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d894c13e555..006c97f2a20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6602,9 +6602,7 @@ dependencies = [ "move-core-types", "move-package", "p256 0.13.2", - "passkey-authenticator 0.2.0", - "passkey-client", - "passkey-types 0.3.0", + "passkey", "prometheus", "rand 0.8.5", "serde", @@ -8338,9 +8336,7 @@ dependencies = [ "p256 0.13.2", "packable", "parking_lot 0.12.3", - "passkey-authenticator 0.2.0", - "passkey-client", - "passkey-types 0.3.0", + "passkey", "prometheus", "proptest", "proptest-derive", @@ -9005,7 +9001,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -11174,17 +11170,14 @@ dependencies = [ ] [[package]] -name = "passkey-authenticator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017d27e98940a98358b43a3fe19cb3d7b7c821c3b35634d8087230e92445579" +name = "passkey" +version = "0.4.0" +source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" dependencies = [ - "async-trait", - "coset", - "log", - "p256 0.13.2", - "passkey-types 0.2.0", - "rand 0.8.5", + "passkey-authenticator", + "passkey-client", + "passkey-transports", + "passkey-types", ] [[package]] @@ -11196,7 +11189,7 @@ dependencies = [ "coset", "log", "p256 0.13.2", - "passkey-types 0.4.0", + "passkey-types", "rand 0.8.5", ] @@ -11208,8 +11201,8 @@ dependencies = [ "ciborium", "coset", "idna", - "passkey-authenticator 0.4.0", - "passkey-types 0.4.0", + "passkey-authenticator", + "passkey-types", "public-suffix", "serde", "serde_json", @@ -11218,45 +11211,9 @@ dependencies = [ ] [[package]] -name = "passkey-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "499cff8432e71c5f8784d9645aac0f9fca604d67f59b68a606170b5e229c6538" -dependencies = [ - "bitflags 2.6.0", - "ciborium", - "coset", - "data-encoding", - "indexmap 2.5.0", - "rand 0.8.5", - "serde", - "serde_json", - "sha2 0.10.8", - "strum 0.25.0", - "typeshare", -] - -[[package]] -name = "passkey-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5d3d17d8ad54ba7c7574595f026244ab06ee44f0524379c1575a95aab4c030" -dependencies = [ - "bitflags 2.6.0", - "ciborium", - "coset", - "data-encoding", - "getrandom 0.2.15", - "hmac", - "indexmap 2.5.0", - "rand 0.8.5", - "serde", - "serde_json", - "sha2 0.10.8", - "strum 0.25.0", - "typeshare", - "zeroize", -] +name = "passkey-transports" +version = "0.1.0" +source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" [[package]] name = "passkey-types" @@ -15548,7 +15505,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", - "rand 0.8.5", + "rand 0.7.3", "static_assertions", ] diff --git a/Cargo.toml b/Cargo.toml index af88d11a3a3..9afdf5c12de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -284,11 +284,9 @@ object_store = { version = "0.10", features = ["aws", "gcp", "azure", "http"] } once_cell = "1.18.0" p256 = { version = "0.13.2", features = ["ecdsa"] } parking_lot = "0.12.1" -passkey-authenticator = { version = "0.2.0" } -# TODO: Re-enable when passkey-client 0.4.0 is released -# passkey-client = "0.3.0" -passkey-client = { git = "https://github.com/1Password/passkey-rs", rev = "9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" } -passkey-types = "0.3.0" +# TODO: Re-enable when passkey 0.4.0 is released +# passkey = "0.4.0" +passkey = { git = "https://github.com/1Password/passkey-rs", rev = "9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" } pretty_assertions = "1.3.0" proc-macro2 = "1.0.47" prometheus = "0.13.3" diff --git a/crates/iota-e2e-tests/Cargo.toml b/crates/iota-e2e-tests/Cargo.toml index 719e58dac5c..7f7759a497f 100644 --- a/crates/iota-e2e-tests/Cargo.toml +++ b/crates/iota-e2e-tests/Cargo.toml @@ -27,9 +27,7 @@ indexmap.workspace = true insta.workspace = true jsonrpsee.workspace = true p256.workspace = true -passkey-authenticator.workspace = true -passkey-client.workspace = true -passkey-types.workspace = true +passkey.workspace = true prometheus.workspace = true rand.workspace = true serde.workspace = true diff --git a/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs b/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs index 0f7a1cf583a..2a9cef35cc3 100644 --- a/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs +++ b/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs @@ -17,17 +17,19 @@ use iota_types::{ transaction::{Transaction, TransactionData}, }; use p256::pkcs8::DecodePublicKey; -use passkey_authenticator::{Authenticator, UserValidationMethod}; -use passkey_client::Client; -use passkey_types::{ - Bytes, Passkey, - ctap2::Aaguid, - rand::random_vec, - webauthn::{ - AttestationConveyancePreference, CredentialCreationOptions, CredentialRequestOptions, - PublicKeyCredentialCreationOptions, PublicKeyCredentialParameters, - PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, - PublicKeyCredentialUserEntity, UserVerificationRequirement, +use passkey::{ + authenticator::{Authenticator, UserCheck, UserValidationMethod}, + client::Client, + types::{ + Bytes, Passkey, + ctap2::{Aaguid, Ctap2Error}, + rand::random_vec, + webauthn::{ + AttestationConveyancePreference, CredentialCreationOptions, CredentialRequestOptions, + PublicKeyCredentialCreationOptions, PublicKeyCredentialParameters, + PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, + PublicKeyCredentialType, PublicKeyCredentialUserEntity, UserVerificationRequirement, + }, }, }; use shared_crypto::intent::{INTENT_PREFIX_LENGTH, Intent, IntentMessage}; @@ -37,12 +39,18 @@ use url::Url; struct MyUserValidationMethod {} #[async_trait::async_trait] impl UserValidationMethod for MyUserValidationMethod { - async fn check_user_presence(&self) -> bool { - true - } + type PasskeyItem = Passkey; - async fn check_user_verification(&self) -> bool { - true + async fn check_user<'a>( + &self, + _credential: Option<&'a Self::PasskeyItem>, + presence: bool, + verification: bool, + ) -> Result { + Ok(UserCheck { + presence, + verification, + }) } fn is_verification_enabled(&self) -> Option { diff --git a/crates/iota-types/Cargo.toml b/crates/iota-types/Cargo.toml index 9d229d4ed41..7f5b974ac7c 100644 --- a/crates/iota-types/Cargo.toml +++ b/crates/iota-types/Cargo.toml @@ -39,7 +39,7 @@ num_enum.workspace = true once_cell.workspace = true packable = { version = "0.8", default-features = false, features = ["io"] } parking_lot.workspace = true -passkey-types.workspace = true +passkey.workspace = true prometheus.workspace = true proptest = { workspace = true, optional = true } proptest-derive = { workspace = true, optional = true } @@ -87,8 +87,6 @@ coset.workspace = true criterion.workspace = true expect-test.workspace = true p256.workspace = true -passkey-authenticator.workspace = true -passkey-client.workspace = true proptest.workspace = true serde_yaml.workspace = true tokio.workspace = true diff --git a/crates/iota-types/src/passkey_authenticator.rs b/crates/iota-types/src/passkey_authenticator.rs index 6ae521725ff..3404deb6f2a 100644 --- a/crates/iota-types/src/passkey_authenticator.rs +++ b/crates/iota-types/src/passkey_authenticator.rs @@ -15,7 +15,7 @@ use fastcrypto::{ traits::{ToFromBytes, VerifyingKey}, }; use once_cell::sync::OnceCell; -use passkey_types::webauthn::{ClientDataType, CollectedClientData}; +use passkey::types::webauthn::{ClientDataType, CollectedClientData}; use schemars::JsonSchema; use serde::{Deserialize, Deserializer, Serialize}; use shared_crypto::intent::{INTENT_PREFIX_LENGTH, Intent, IntentMessage}; diff --git a/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs b/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs index 5d4f451ebe6..510e407b515 100644 --- a/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs +++ b/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs @@ -11,17 +11,19 @@ use fastcrypto::{ traits::ToFromBytes, }; use p256::pkcs8::DecodePublicKey; -use passkey_authenticator::{Authenticator, UserValidationMethod}; -use passkey_client::Client; -use passkey_types::{ - Bytes, Passkey, - ctap2::Aaguid, - rand::random_vec, - webauthn::{ - AttestationConveyancePreference, CredentialCreationOptions, CredentialRequestOptions, - PublicKeyCredentialCreationOptions, PublicKeyCredentialParameters, - PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, - PublicKeyCredentialUserEntity, UserVerificationRequirement, +use passkey::{ + authenticator::{Authenticator, UserCheck, UserValidationMethod}, + client::Client, + types::{ + Bytes, Passkey, + ctap2::{Aaguid, Ctap2Error}, + rand::random_vec, + webauthn::{ + AttestationConveyancePreference, CredentialCreationOptions, CredentialRequestOptions, + PublicKeyCredentialCreationOptions, PublicKeyCredentialParameters, + PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, + PublicKeyCredentialType, PublicKeyCredentialUserEntity, UserVerificationRequirement, + }, }, }; use shared_crypto::intent::{INTENT_PREFIX_LENGTH, Intent, IntentMessage}; @@ -43,13 +45,7 @@ use crate::{ pub struct MyUserValidationMethod {} #[async_trait::async_trait] impl UserValidationMethod for MyUserValidationMethod { - async fn check_user_presence(&self) -> bool { - true - } - - async fn check_user_verification(&self) -> bool { - true - } + type PasskeyItem = Passkey; fn is_verification_enabled(&self) -> Option { Some(true) @@ -58,6 +54,18 @@ impl UserValidationMethod for MyUserValidationMethod { fn is_presence_enabled(&self) -> bool { true } + + async fn check_user<'a>( + &self, + _credential: Option<&'a Self::PasskeyItem>, + presence: bool, + verification: bool, + ) -> Result { + Ok(UserCheck { + presence, + verification, + }) + } } /// Response with fields from passkey authentication. From c379422983dd18d0f5b7acc280cacf0186b5e4ed Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Fri, 13 Dec 2024 13:21:22 -0500 Subject: [PATCH 3/6] dprint --- deny.toml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deny.toml b/deny.toml index 74afba96f66..65a68f2f153 100644 --- a/deny.toml +++ b/deny.toml @@ -99,6 +99,8 @@ confidence-threshold = 0.8 # Allow 1 or more licenses on a per-crate basis, so that particular licenses # aren't accepted for every possible crate as with the normal allow list exceptions = [ + + # Each entry is the crate and version constraint, and its specific allow # list # { allow = ["Zlib"], name = "adler32", version = "*" }, @@ -237,7 +239,7 @@ allow-git = [ "https://github.com/iotaledger/iota-rust-sdk.git", "https://github.com/bmwill/openapiv3.git", "https://github.com/bmwill/axum-server.git", - "https://github.com/1Password/passkey-rs.git" + "https://github.com/1Password/passkey-rs.git", ] [sources.allow-org] From b73763dc737ed5941529c9c60ff33c119010c8b3 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 17 Dec 2024 10:42:08 -0500 Subject: [PATCH 4/6] use passkey 0.4 --- Cargo.lock | 18 ++++++++++++------ Cargo.toml | 4 +--- deny.toml | 1 - 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 006c97f2a20..c210e3a50fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11172,7 +11172,8 @@ dependencies = [ [[package]] name = "passkey" version = "0.4.0" -source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec76b83e6102fb2aecc24a1afb5be839d1cc84914df003ab564e17fb634cc727" dependencies = [ "passkey-authenticator", "passkey-client", @@ -11183,7 +11184,8 @@ dependencies = [ [[package]] name = "passkey-authenticator" version = "0.4.0" -source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9b065ce31354bcf23a333003c77f0d71f00eb95761b3390a069546e078a7a5b" dependencies = [ "async-trait", "coset", @@ -11196,7 +11198,8 @@ dependencies = [ [[package]] name = "passkey-client" version = "0.4.0" -source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5080bfafe23d139ae8be8b907453aee0b8af3ca7cf25d1f8d7bfcf7b079d3412" dependencies = [ "ciborium", "coset", @@ -11213,12 +11216,14 @@ dependencies = [ [[package]] name = "passkey-transports" version = "0.1.0" -source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04110fadc73577990f04153a2508989242d9c90a645aeaad98ef30e0decfbb" [[package]] name = "passkey-types" version = "0.4.0" -source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77144664f6aac5f629d7efa815f5098a054beeeca6ccafee5ec453fd2b0c53f9" dependencies = [ "bitflags 2.6.0", "ciborium", @@ -12051,7 +12056,8 @@ dependencies = [ [[package]] name = "public-suffix" version = "0.1.2" -source = "git+https://github.com/1Password/passkey-rs?rev=9e34d025f3d302fd9b0fc1b361e19fc78e594a4c#9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a59553bc595dc1514e7d713e6167cf1c4d68ef6fcc2d10ad834a97a1ca9bc4" [[package]] name = "quanta" diff --git a/Cargo.toml b/Cargo.toml index 9afdf5c12de..b58b8b309ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -284,9 +284,7 @@ object_store = { version = "0.10", features = ["aws", "gcp", "azure", "http"] } once_cell = "1.18.0" p256 = { version = "0.13.2", features = ["ecdsa"] } parking_lot = "0.12.1" -# TODO: Re-enable when passkey 0.4.0 is released -# passkey = "0.4.0" -passkey = { git = "https://github.com/1Password/passkey-rs", rev = "9e34d025f3d302fd9b0fc1b361e19fc78e594a4c" } +passkey = "0.4.0" pretty_assertions = "1.3.0" proc-macro2 = "1.0.47" prometheus = "0.13.3" diff --git a/deny.toml b/deny.toml index 65a68f2f153..04e8c2cb6f6 100644 --- a/deny.toml +++ b/deny.toml @@ -239,7 +239,6 @@ allow-git = [ "https://github.com/iotaledger/iota-rust-sdk.git", "https://github.com/bmwill/openapiv3.git", "https://github.com/bmwill/axum-server.git", - "https://github.com/1Password/passkey-rs.git", ] [sources.allow-org] From 0ca3f7172be523a43f30e9d1ddb8323ce1f75da5 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Tue, 17 Dec 2024 10:49:59 -0500 Subject: [PATCH 5/6] revert split crates --- Cargo.lock | 26 +++++-------------- Cargo.toml | 4 ++- crates/iota-e2e-tests/Cargo.toml | 4 ++- .../iota-e2e-tests/tests/passkey_e2e_tests.rs | 24 ++++++++--------- crates/iota-types/Cargo.toml | 4 ++- .../iota-types/src/passkey_authenticator.rs | 2 +- .../unit_tests/passkey_authenticator_test.rs | 24 ++++++++--------- 7 files changed, 38 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c210e3a50fa..550aa462be0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6602,7 +6602,9 @@ dependencies = [ "move-core-types", "move-package", "p256 0.13.2", - "passkey", + "passkey-authenticator", + "passkey-client", + "passkey-types", "prometheus", "rand 0.8.5", "serde", @@ -8336,7 +8338,9 @@ dependencies = [ "p256 0.13.2", "packable", "parking_lot 0.12.3", - "passkey", + "passkey-authenticator", + "passkey-client", + "passkey-types", "prometheus", "proptest", "proptest-derive", @@ -11169,18 +11173,6 @@ dependencies = [ "zstd-sys", ] -[[package]] -name = "passkey" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec76b83e6102fb2aecc24a1afb5be839d1cc84914df003ab564e17fb634cc727" -dependencies = [ - "passkey-authenticator", - "passkey-client", - "passkey-transports", - "passkey-types", -] - [[package]] name = "passkey-authenticator" version = "0.4.0" @@ -11213,12 +11205,6 @@ dependencies = [ "url", ] -[[package]] -name = "passkey-transports" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e04110fadc73577990f04153a2508989242d9c90a645aeaad98ef30e0decfbb" - [[package]] name = "passkey-types" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index b58b8b309ac..9dbfc1385f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -284,7 +284,9 @@ object_store = { version = "0.10", features = ["aws", "gcp", "azure", "http"] } once_cell = "1.18.0" p256 = { version = "0.13.2", features = ["ecdsa"] } parking_lot = "0.12.1" -passkey = "0.4.0" +passkey-authenticator = "0.4.0" +passkey-client = "0.4.0" +passkey-types = "0.4.0" pretty_assertions = "1.3.0" proc-macro2 = "1.0.47" prometheus = "0.13.3" diff --git a/crates/iota-e2e-tests/Cargo.toml b/crates/iota-e2e-tests/Cargo.toml index 7f7759a497f..719e58dac5c 100644 --- a/crates/iota-e2e-tests/Cargo.toml +++ b/crates/iota-e2e-tests/Cargo.toml @@ -27,7 +27,9 @@ indexmap.workspace = true insta.workspace = true jsonrpsee.workspace = true p256.workspace = true -passkey.workspace = true +passkey-authenticator.workspace = true +passkey-client.workspace = true +passkey-types.workspace = true prometheus.workspace = true rand.workspace = true serde.workspace = true diff --git a/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs b/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs index 2a9cef35cc3..649b5a18777 100644 --- a/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs +++ b/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs @@ -17,19 +17,17 @@ use iota_types::{ transaction::{Transaction, TransactionData}, }; use p256::pkcs8::DecodePublicKey; -use passkey::{ - authenticator::{Authenticator, UserCheck, UserValidationMethod}, - client::Client, - types::{ - Bytes, Passkey, - ctap2::{Aaguid, Ctap2Error}, - rand::random_vec, - webauthn::{ - AttestationConveyancePreference, CredentialCreationOptions, CredentialRequestOptions, - PublicKeyCredentialCreationOptions, PublicKeyCredentialParameters, - PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, - PublicKeyCredentialType, PublicKeyCredentialUserEntity, UserVerificationRequirement, - }, +use passkey_authenticator::{Authenticator, UserCheck, UserValidationMethod}; +use passkey_client::Client; +use passkey_types::{ + Bytes, Passkey, + ctap2::{Aaguid, Ctap2Error}, + rand::random_vec, + webauthn::{ + AttestationConveyancePreference, CredentialCreationOptions, CredentialRequestOptions, + PublicKeyCredentialCreationOptions, PublicKeyCredentialParameters, + PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, + PublicKeyCredentialUserEntity, UserVerificationRequirement, }, }; use shared_crypto::intent::{INTENT_PREFIX_LENGTH, Intent, IntentMessage}; diff --git a/crates/iota-types/Cargo.toml b/crates/iota-types/Cargo.toml index 7f5b974ac7c..9d229d4ed41 100644 --- a/crates/iota-types/Cargo.toml +++ b/crates/iota-types/Cargo.toml @@ -39,7 +39,7 @@ num_enum.workspace = true once_cell.workspace = true packable = { version = "0.8", default-features = false, features = ["io"] } parking_lot.workspace = true -passkey.workspace = true +passkey-types.workspace = true prometheus.workspace = true proptest = { workspace = true, optional = true } proptest-derive = { workspace = true, optional = true } @@ -87,6 +87,8 @@ coset.workspace = true criterion.workspace = true expect-test.workspace = true p256.workspace = true +passkey-authenticator.workspace = true +passkey-client.workspace = true proptest.workspace = true serde_yaml.workspace = true tokio.workspace = true diff --git a/crates/iota-types/src/passkey_authenticator.rs b/crates/iota-types/src/passkey_authenticator.rs index 3404deb6f2a..6ae521725ff 100644 --- a/crates/iota-types/src/passkey_authenticator.rs +++ b/crates/iota-types/src/passkey_authenticator.rs @@ -15,7 +15,7 @@ use fastcrypto::{ traits::{ToFromBytes, VerifyingKey}, }; use once_cell::sync::OnceCell; -use passkey::types::webauthn::{ClientDataType, CollectedClientData}; +use passkey_types::webauthn::{ClientDataType, CollectedClientData}; use schemars::JsonSchema; use serde::{Deserialize, Deserializer, Serialize}; use shared_crypto::intent::{INTENT_PREFIX_LENGTH, Intent, IntentMessage}; diff --git a/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs b/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs index 510e407b515..0783ce8820a 100644 --- a/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs +++ b/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs @@ -11,19 +11,17 @@ use fastcrypto::{ traits::ToFromBytes, }; use p256::pkcs8::DecodePublicKey; -use passkey::{ - authenticator::{Authenticator, UserCheck, UserValidationMethod}, - client::Client, - types::{ - Bytes, Passkey, - ctap2::{Aaguid, Ctap2Error}, - rand::random_vec, - webauthn::{ - AttestationConveyancePreference, CredentialCreationOptions, CredentialRequestOptions, - PublicKeyCredentialCreationOptions, PublicKeyCredentialParameters, - PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, - PublicKeyCredentialType, PublicKeyCredentialUserEntity, UserVerificationRequirement, - }, +use passkey_authenticator::{Authenticator, UserCheck, UserValidationMethod}; +use passkey_client::Client; +use passkey_types::{ + Bytes, Passkey, + ctap2::{Aaguid, Ctap2Error}, + rand::random_vec, + webauthn::{ + AttestationConveyancePreference, CredentialCreationOptions, CredentialRequestOptions, + PublicKeyCredentialCreationOptions, PublicKeyCredentialParameters, + PublicKeyCredentialRequestOptions, PublicKeyCredentialRpEntity, PublicKeyCredentialType, + PublicKeyCredentialUserEntity, UserVerificationRequirement, }, }; use shared_crypto::intent::{INTENT_PREFIX_LENGTH, Intent, IntentMessage}; From de787a9efd9e80973f8cfdcefe8a21df55410956 Mon Sep 17 00:00:00 2001 From: Chloe Martin Date: Wed, 18 Dec 2024 09:04:10 -0500 Subject: [PATCH 6/6] more clear test impls --- crates/iota-e2e-tests/tests/passkey_e2e_tests.rs | 9 +++++---- .../src/unit_tests/passkey_authenticator_test.rs | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs b/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs index 649b5a18777..82c9c4a9d91 100644 --- a/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs +++ b/crates/iota-e2e-tests/tests/passkey_e2e_tests.rs @@ -35,6 +35,7 @@ use test_cluster::{TestCluster, TestClusterBuilder}; use url::Url; struct MyUserValidationMethod {} + #[async_trait::async_trait] impl UserValidationMethod for MyUserValidationMethod { type PasskeyItem = Passkey; @@ -42,12 +43,12 @@ impl UserValidationMethod for MyUserValidationMethod { async fn check_user<'a>( &self, _credential: Option<&'a Self::PasskeyItem>, - presence: bool, - verification: bool, + _presence: bool, + _verification: bool, ) -> Result { Ok(UserCheck { - presence, - verification, + presence: true, + verification: true, }) } diff --git a/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs b/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs index 0783ce8820a..41645f17c22 100644 --- a/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs +++ b/crates/iota-types/src/unit_tests/passkey_authenticator_test.rs @@ -41,6 +41,7 @@ use crate::{ /// Helper struct to initialize passkey client. pub struct MyUserValidationMethod {} + #[async_trait::async_trait] impl UserValidationMethod for MyUserValidationMethod { type PasskeyItem = Passkey; @@ -56,12 +57,12 @@ impl UserValidationMethod for MyUserValidationMethod { async fn check_user<'a>( &self, _credential: Option<&'a Self::PasskeyItem>, - presence: bool, - verification: bool, + _presence: bool, + _verification: bool, ) -> Result { Ok(UserCheck { - presence, - verification, + presence: true, + verification: true, }) } }