diff --git a/.env.example b/.env.example index 982a2495..aab847b3 100644 --- a/.env.example +++ b/.env.example @@ -31,6 +31,7 @@ TELEMETRY_PROMETHEUS_PORT=3001 # FCM FCM_API_KEY= +FCM_V1_CREDENTIALS= # APNS APNS_CERTIFICATE= # base64 encoded .p12 APNS Certificate diff --git a/.env.single-tenant-example b/.env.single-tenant-example index 3f8fb3a1..9d9a936f 100644 --- a/.env.single-tenant-example +++ b/.env.single-tenant-example @@ -18,8 +18,9 @@ TELEMETRY_PROMETHEUS_PORT=3001 # FCM FCM_API_KEY= # Firebase Cloud Messaging Server Key +FCM_V1_CREDENTIALS= # Firebase Cloud Messaging Service Account Credentials # APNS APNS_CERTIFICATE= # base64 encoded .p12 APNS Certificate APNS_CERTIFICATE_PASSWORD= # Password for provided certificate -APNS_TOPIC= # bundle ID/app ID \ No newline at end of file +APNS_TOPIC= # bundle ID/app ID diff --git a/.github/SECRETS.md b/.github/SECRETS.md new file mode 100644 index 00000000..fbca417a --- /dev/null +++ b/.github/SECRETS.md @@ -0,0 +1,17 @@ +## `PROD_JWT_SECRET` & `STAGING_JWT_SECRET` + +From 1Password: `cloud/push-server-jwt/prod` and `cloud/push-server-jwt/staging` + +Generated randomly and used by Cloud app to sign JWTs. + +## `ECHO_TEST_FCM_V1_CREDENTIALS` + +From 1Password: `Firebase Push Server Tests Service Account` + +FCM v1 service account credentials for test cases. + +Setup: +- Go to the Push Server Tests Firebase project: https://console.firebase.google.com/project/push-server-tests-cc0f7/settings/cloudmessaging +- On Cloud Messaging tab, under the "Firebase Cloud Messaging API (V1)" header, click the "Manage Service Accounts" link +- Select the service account and click "Manage keys" +- Click "Add key" and select "Create new key" and pick JSON diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3eee4105..dcad3c73 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -81,7 +81,7 @@ jobs: id: tf-apply uses: WalletConnect/actions/terraform/apply/@1.0.3 env: - GRAFANA_AUTH: ${{ steps.grafana-get-key.outputs.key }} + TF_VAR_grafana_auth: ${{ steps.grafana-get-key.outputs.key }} TF_VAR_grafana_endpoint: ${{ steps.grafana-get-details.outputs.endpoint }} TF_VAR_jwt_secret: ${{ secrets.STAGING_JWT_SECRET }} TF_VAR_image_version: ${{ inputs.image_tag }} @@ -151,7 +151,7 @@ jobs: id: tf-apply uses: WalletConnect/actions/terraform/apply/@1.0.3 env: - GRAFANA_AUTH: ${{ steps.grafana-get-key.outputs.key }} + TF_VAR_grafana_auth: ${{ steps.grafana-get-key.outputs.key }} TF_VAR_grafana_endpoint: ${{ steps.grafana-get-details.outputs.endpoint }} TF_VAR_jwt_secret: ${{ secrets.PROD_JWT_SECRET }} TF_VAR_image_version: ${{ inputs.image_tag }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82c658b3..fafbaf4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,7 +75,7 @@ jobs: rustc: stable - name: "Clippy all features" cmd: clippy - args: --all-features --tests -- -D warnings + args: --all-features --all-targets -- -D warnings cache: {} rustc: stable - name: "Formatting" @@ -85,7 +85,7 @@ jobs: rustc: nightly - name: "Unit Tests" cmd: test - args: --features multitenant,analytics,geoblock,functional_tests + args: --features multitenant,analytics,geoblock,functional_tests,apns_tests,fcm_tests,fcmv1_tests cache: { sharedKey: "tests" } rustc: stable - name: "Single-tenant functional tests" @@ -170,6 +170,7 @@ jobs: args: ${{ matrix.cargo.args }} env: ECHO_TEST_FCM_KEY: ${{ secrets.ECHO_TEST_FCM_KEY }} + ECHO_TEST_FCM_V1_CREDENTIALS: ${{ secrets.ECHO_TEST_FCM_V1_CREDENTIALS }} ECHO_TEST_APNS_P8_KEY_ID: ${{ secrets.ECHO_TEST_APNS_P8_KEY_ID }} ECHO_TEST_APNS_P8_TEAM_ID: ${{ secrets.ECHO_TEST_APNS_P8_TEAM_ID }} ECHO_TEST_APNS_P8_PEM: ${{ secrets.ECHO_TEST_APNS_P8_PEM }} diff --git a/.github/workflows/ci_terraform.yml b/.github/workflows/ci_terraform.yml index f7e4df99..1295ff4b 100644 --- a/.github/workflows/ci_terraform.yml +++ b/.github/workflows/ci_terraform.yml @@ -122,7 +122,7 @@ jobs: id: tf-plan-staging uses: WalletConnect/actions/terraform/plan/@1.0.3 env: - GRAFANA_AUTH: ${{ steps.grafana-get-key.outputs.key }} + TF_VAR_grafana_auth: ${{ steps.grafana-get-key.outputs.key }} TF_VAR_grafana_endpoint: ${{ steps.grafana-get-details.outputs.endpoint }} TF_VAR_jwt_secret: ${{ secrets.JWT_SECRET }} TF_VAR_relay_public_key: ${{ secrets.RELAY_PUBLIC_KEY }} diff --git a/Cargo.lock b/Cargo.lock index b45f7e17..6266bce3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,17 +8,17 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f279fc8b1f1a64138f0f4b9cda9be488ae35bc2f8556c7ffe60730f1c07d005a" dependencies = [ - "base64 0.21.4", - "erased-serde", + "base64 0.21.7", + "erased-serde 0.3.31", "http 1.1.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-rustls 0.26.0", "hyper-util", "openssl", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rustls 0.22.4", - "rustls-pemfile 2.1.1", + "rustls-pemfile 2.1.2", "serde", "serde_json", "thiserror", @@ -43,9 +43,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", @@ -68,9 +68,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea5d730647d4fadd988536d06fecce94b7b4f2a7efdae548f1cf4b63205518ab" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -92,9 +92,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "analytics" @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "assert-json-diff" @@ -148,11 +148,13 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.8.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener", + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -174,18 +176,18 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] @@ -210,15 +212,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "aws-config" -version = "1.1.9" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297b64446175a73987cedc3c438d79b2a654d0fff96f65ff530fbe039347644c" +checksum = "40ddbfb5db93d62521f47b3f223da0884a2f02741ff54cb9cda192a0e73ba08b" dependencies = [ "aws-credential-types", "aws-runtime", @@ -233,10 +235,10 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.0.1", + "fastrand 2.1.0", "hex", - "http 0.2.9", - "hyper 0.14.27", + "http 0.2.12", + "hyper 0.14.28", "ring 0.17.8", "time", "tokio", @@ -247,9 +249,9 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.1.8" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa8587ae17c8e967e4b05a62d495be2fb7701bec52a97f7acfe8a29f938384c8" +checksum = "e16838e6c9e12125face1c1eff1343c75e3ff540de98ff7ebd61874a89bcfeb9" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -259,9 +261,9 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.1.8" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b13dc54b4b49f8288532334bba8f87386a40571c47c37b1304979b556dc613c8" +checksum = "75588e7ee5e8496eed939adac2035a6dbab9f7eb2acdd9ab2d31856dab6f3955" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -272,9 +274,9 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "fastrand 2.0.1", - "http 0.2.9", - "http-body 0.4.5", + "fastrand 2.1.0", + "http 0.2.12", + "http-body 0.4.6", "percent-encoding", "pin-project-lite", "tracing", @@ -283,9 +285,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.21.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc075ffee2a40cb1590bed35d7ec953589a564e768fa91947c565425cd569269" +checksum = "91303c2fed0fc851059edd5a3c69cc139197bf41accbaab9cfd60b2410647a0e" dependencies = [ "ahash 0.8.11", "aws-credential-types", @@ -302,11 +304,11 @@ dependencies = [ "aws-smithy-xml", "aws-types", "bytes", - "fastrand 2.0.1", + "fastrand 2.1.0", "hex", "hmac", - "http 0.2.9", - "http-body 0.4.5", + "http 0.2.12", + "http-body 0.4.6", "lru", "once_cell", "percent-encoding", @@ -318,9 +320,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.18.0" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "019a07902c43b03167ea5df0182f0cb63fae89f9a9682c44d18cf2e4a042cb34" +checksum = "5fd6a9b38fe2dcaa2422b42e2c667112872d03a83522533f8b4165fd2d9d4bd1" dependencies = [ "aws-credential-types", "aws-runtime", @@ -332,7 +334,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http 0.2.9", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -340,9 +342,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.18.0" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c46ee08a48a7f4eaa4ad201dcc1dd537b49c50859d14d4510e00ad9d3f9af2" +checksum = "c99f342a364c8490b7715387244d2f7ebfc05f07bb6a0fc6e70b8e62b7078d06" dependencies = [ "aws-credential-types", "aws-runtime", @@ -354,7 +356,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http 0.2.9", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -362,9 +364,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.18.0" +version = "1.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f752ac730125ca6017f72f9db5ec1772c9ecc664f87aa7507a7d81b023c23713" +checksum = "7207ca62206c93e470457babf0512d7b6b97170fdba929a2a2f5682f9f68407c" dependencies = [ "aws-credential-types", "aws-runtime", @@ -377,7 +379,7 @@ dependencies = [ "aws-smithy-types", "aws-smithy-xml", "aws-types", - "http 0.2.9", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -385,9 +387,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d6f29688a4be9895c0ba8bef861ad0c0dac5c15e9618b9b7a6c233990fc263" +checksum = "58b56f1cbe6fd4d0c2573df72868f20ab1c125ca9c9dbce17927a463433a2e57" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -399,7 +401,7 @@ dependencies = [ "form_urlencoded", "hex", "hmac", - "http 0.2.9", + "http 0.2.12", "http 1.1.0", "once_cell", "p256", @@ -435,8 +437,8 @@ dependencies = [ "crc32c", "crc32fast", "hex", - "http 0.2.9", - "http-body 0.4.5", + "http 0.2.12", + "http-body 0.4.6", "md-5", "pin-project-lite", "sha1", @@ -457,9 +459,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.7" +version = "0.60.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f10fa66956f01540051b0aa7ad54574640f748f9839e843442d99b970d3aff9" +checksum = "4a7de001a1b9a25601016d8057ea16e31a45fdca3751304c8edf4ad72e706c08" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -467,8 +469,8 @@ dependencies = [ "bytes", "bytes-utils", "futures-core", - "http 0.2.9", - "http-body 0.4.5", + "http 0.2.12", + "http-body 0.4.6", "once_cell", "percent-encoding", "pin-project-lite", @@ -497,40 +499,40 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.2.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53572b4cd934ee5e8461ad53caa36e9d246aaef42166e3ac539e206a925d330" +checksum = "c9ac79e9f3a4d576f3cd4a470a0275b138d9e7b11b1cd514a6858ae0a79dd5bb" dependencies = [ "aws-smithy-async", "aws-smithy-http", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", - "fastrand 2.0.1", - "h2 0.3.21", - "http 0.2.9", - "http-body 0.4.5", + "fastrand 2.1.0", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", "http-body 1.0.0", - "hyper 0.14.27", - "hyper-rustls 0.24.1", + "hyper 0.14.28", + "hyper-rustls 0.24.2", "once_cell", "pin-project-lite", "pin-utils", - "rustls 0.21.10", + "rustls 0.21.12", "tokio", "tracing", ] [[package]] name = "aws-smithy-runtime-api" -version = "1.3.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb2b3a7030dc9a3c9a08ce0b25decea5130e9db19619d4dffbbff34f75fe850" +checksum = "04ec42c2f5c0e7796a2848dde4d9f3bf8ce12ccbb3d5aa40c52fa0cdd61a1c47" dependencies = [ "aws-smithy-async", "aws-smithy-types", "bytes", - "http 0.2.9", + "http 0.2.12", "http 1.1.0", "pin-project-lite", "tokio", @@ -540,17 +542,17 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe14dceea1e70101d38fbf2a99e6a34159477c0fb95e68e05c66bd7ae4c3729" +checksum = "baf98d97bba6ddaba180f1b1147e202d8fe04940403a95a3f826c790f931bbd1" dependencies = [ "base64-simd", "bytes", "bytes-utils", "futures-core", - "http 0.2.9", + "http 0.2.12", "http 1.1.0", - "http-body 0.4.5", + "http-body 0.4.6", "http-body 1.0.0", "http-body-util", "itoa", @@ -566,24 +568,24 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.7" +version = "0.60.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "872c68cf019c0e4afc5de7753c4f7288ce4b71663212771bf5e4542eb9346ca9" +checksum = "d123fbc2a4adc3c301652ba8e149bf4bc1d1725affb9784eb20c953ace06bf55" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "1.1.8" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dbf2f3da841a8930f159163175cf6a3d16ddde517c1b0fba7aa776822800f40" +checksum = "a807d90cd50a969b3d95e4e7ad1491fcae13c6e83948d8728363ecc09d66343a" dependencies = [ "aws-credential-types", "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "http 0.2.9", + "http 0.2.12", "rustc_version", "tracing", ] @@ -599,9 +601,9 @@ dependencies = [ "bitflags 1.3.2", "bytes", "futures-util", - "http 0.2.9", - "http-body 0.4.5", - "hyper 0.14.27", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "itoa", "matchit", "memchr", @@ -629,7 +631,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "itoa", "matchit", @@ -643,7 +645,7 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper 1.0.0", + "sync_wrapper 1.0.1", "tokio", "tower", "tower-layer", @@ -671,8 +673,8 @@ dependencies = [ "async-trait", "bytes", "futures-util", - "http 0.2.9", - "http-body 0.4.5", + "http 0.2.12", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", @@ -702,9 +704,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -729,15 +731,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64-simd" @@ -772,9 +774,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -793,39 +795,40 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "build-info" -version = "0.0.33" +version = "0.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1add148a02352a8149c1ae42528988427aeb0438f808df66f393cb9948006ec" +checksum = "bc978ce446e6cd132434049d6a3e9b92982228fd27e0ae11437b8e121b50e7e4" dependencies = [ + "bincode", "build-info-common", "build-info-proc", ] [[package]] name = "build-info-build" -version = "0.0.33" +version = "0.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9cddd0655ecb60d7a500f30d3ae4e69b798026d76c3d16b2f464a72913066e" +checksum = "02216ebb53a94c78f65d93293607c5bb1b3e9c156c456791c4aabf45a7d9d55d" dependencies = [ "anyhow", - "base64 0.21.4", + "base64 0.21.7", "bincode", "build-info-common", - "cargo_metadata 0.18.0", + "cargo_metadata", "chrono", "git2", "glob", "pretty_assertions", "rustc_version", "serde_json", - "xz2", + "zstd", ] [[package]] name = "build-info-common" -version = "0.0.33" +version = "0.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3b772d111f4cc62aa9018ba5cad5a1748a6d9a286d91a69b748cd233e43cdbd" +checksum = "c212154d5082e4f891f6750a791f83731bdbf706c97f8e0c3d16c53723e4881e" dependencies = [ "chrono", "derive_more", @@ -835,12 +838,12 @@ dependencies = [ [[package]] name = "build-info-proc" -version = "0.0.33" +version = "0.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39fc1a191a93dd7d72c21007a3d65cbfd88204bc744ecccac21858812bc06988" +checksum = "9ff68aa3f555464fa21e676884d6ef00c1f97ce5b42e65ae9b49f9cacdb87ae3" dependencies = [ "anyhow", - "base64 0.21.4", + "base64 0.21.7", "bincode", "build-info-common", "chrono", @@ -850,39 +853,33 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.37", - "xz2", + "syn 2.0.61", + "zstd", ] [[package]] name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytecount" -version = "0.6.7" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "bytes-utils" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e47d3a8076e283f3acd27400535992edb3ba4b5bb72f8891ad8fbe7932a7d4b9" +checksum = "7dafe3a8757b027e2be6e4e5601ed563c55989fcf1546e933c66c8eb3a058d35" dependencies = [ "bytes", "either", @@ -899,31 +896,18 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.3" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfa25e60aea747ec7e1124f238816749faa93759c6ff5b31f1ccdda137f4479" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb9ac64500cc83ce4b9f8dafa78186aa008c8dea77a09b94cd307fd0cd5022a8" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", @@ -935,12 +919,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -951,9 +936,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -961,7 +946,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -971,9 +956,9 @@ source = "git+https://github.com/WalletConnect/utils-rs.git?tag=v0.11.1#ec503450 [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "futures-core", @@ -983,11 +968,20 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const-random" @@ -1026,9 +1020,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -1036,33 +1030,33 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] [[package]] name = "crc" -version = "3.0.1" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" dependencies = [ "crc-catalog", ] [[package]] name = "crc-catalog" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cace84e55f07e7301bae1c519df89cdad8cc3cd868413d3fdbdeca9ff3db484" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] name = "crc32c" @@ -1075,54 +1069,45 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", - "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -1164,9 +1149,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ "cfg-if", "cpufeatures", @@ -1181,13 +1166,13 @@ dependencies = [ [[package]] name = "curve25519-dalek-derive" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] @@ -1197,17 +1182,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.1", + "hashbrown 0.14.5", "lock_api", "once_cell", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.10", ] [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "deadpool" @@ -1233,9 +1218,9 @@ dependencies = [ [[package]] name = "deadpool-runtime" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63dfa964fe2a66f3fde91fc70b267fe193d822c7e603e2a675a49a7f46ad3f49" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" dependencies = [ "tokio", ] @@ -1252,9 +1237,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" dependencies = [ "const-oid", "zeroize", @@ -1262,9 +1247,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] [[package]] name = "derive_more" @@ -1288,7 +1276,7 @@ dependencies = [ "lazy_static", "libc", "mintex", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "rustc-hash", "serde", "serde_json", @@ -1321,7 +1309,16 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys 0.4.1", ] [[package]] @@ -1335,6 +1332,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "dotenv" version = "0.15.0" @@ -1370,7 +1379,7 @@ dependencies = [ "aws-sdk-s3", "axum 0.7.5", "axum-client-ip", - "base64 0.21.4", + "base64 0.21.7", "build-info", "build-info-build", "chrono", @@ -1378,13 +1387,15 @@ dependencies = [ "dotenv", "ed25519-dalek", "envy", - "fcm", + "fcm 0.10.0", + "fcm 0.9.2", "futures-util", "hex", - "hyper 1.2.0", + "hyper 1.3.1", "ipnet", "is-variant-derive", "jsonwebtoken", + "moka", "once_cell", "opentelemetry 0.18.0", "opentelemetry-otlp", @@ -1396,7 +1407,7 @@ dependencies = [ "rand", "random-string", "relay_rpc", - "reqwest 0.12.3", + "reqwest 0.12.4", "serde", "serde_json", "serial_test", @@ -1418,12 +1429,12 @@ dependencies = [ [[package]] name = "ed25519" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8 0.10.2", - "signature 2.1.0", + "signature 2.2.0", ] [[package]] @@ -1443,9 +1454,9 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "elliptic-curve" @@ -1469,9 +1480,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1501,40 +1512,61 @@ dependencies = [ ] [[package]] -name = "errno" -version = "0.3.3" +name = "erased-serde" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", + "serde", ] [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "errno" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ - "cc", "libc", + "windows-sys 0.52.0", ] [[package]] -name = "error-chain" -version = "0.12.4" +name = "event-listener" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "event-listener" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ - "version_check", + "concurrent-queue", + "parking", + "pin-project-lite", ] [[package]] name = "event-listener" -version = "2.5.3" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] [[package]] name = "fastrand" @@ -1547,9 +1579,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fcm" @@ -1558,11 +1590,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d8d0da8a6bd63bdec888b6d7a87c5698230005c1800823d28ddd5adb6f2550f" dependencies = [ "chrono", - "erased-serde", + "erased-serde 0.3.31", + "log", + "reqwest 0.11.27", + "serde", + "serde_json", +] + +[[package]] +name = "fcm" +version = "0.10.0" +source = "git+https://github.com/WalletConnect/fcm-rust.git?branch=feat/key-not-from-file#39d3533af00460041999afc2e94b8bb39ecea081" +dependencies = [ + "chrono", + "erased-serde 0.4.4", + "gauth", "log", - "reqwest 0.11.20", + "reqwest 0.12.4", "serde", "serde_json", + "thiserror", ] [[package]] @@ -1577,9 +1624,9 @@ dependencies = [ [[package]] name = "fiat-crypto" -version = "0.2.1" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0870c84016d4b481be5c9f323c24f65e31e901ae618f0e80f4308fb00de1d2d" +checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" [[package]] name = "finl_unicode" @@ -1595,9 +1642,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "miniz_oxide", @@ -1626,9 +1673,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -1657,9 +1704,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1688,9 +1735,9 @@ checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1722,7 +1769,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] @@ -1755,6 +1802,25 @@ dependencies = [ "slab", ] +[[package]] +name = "gauth" +version = "0.9.0" +source = "git+https://github.com/WalletConnect/gauth-rs.git?branch=feat/key-not-from-file#126269c6ed7a53784dd6e14ea8530fab9e14941f" +dependencies = [ + "anyhow", + "base64 0.21.7", + "chrono", + "dirs 5.0.1", + "reqwest 0.12.4", + "ring 0.16.20", + "serde", + "serde_derive", + "serde_json", + "thiserror", + "tokio", + "url", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1772,11 +1838,11 @@ source = "git+https://github.com/WalletConnect/utils-rs.git?tag=v0.11.1#ec503450 dependencies = [ "aws-sdk-s3", "axum-client-ip", - "bitflags 2.4.0", + "bitflags 2.5.0", "bytes", "futures", "http-body 1.0.0", - "hyper 1.2.0", + "hyper 1.3.1", "maxminddb", "thiserror", "tower", @@ -1786,9 +1852,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1797,17 +1863,17 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "git2" -version = "0.18.1" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbf97ba92db08df386e10c8ede66a2a0369bd277090afd8710e19e38de9ec0cd" +checksum = "232e6a7bfe35766bf715e55a88b39a700596c0ccfd88cd3680b4cdb40d66ef70" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "libc", "libgit2-sys", "log", @@ -1833,17 +1899,17 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.9", - "indexmap 1.9.3", + "http 0.2.12", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1862,7 +1928,7 @@ dependencies = [ "futures-sink", "futures-util", "http 1.1.0", - "indexmap 2.0.1", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1877,9 +1943,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash 0.8.11", "allocator-api2", @@ -1891,7 +1957,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.1", + "hashbrown 0.14.5", ] [[package]] @@ -1914,9 +1980,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -1926,9 +1992,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] @@ -1944,11 +2010,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1957,16 +2023,16 @@ version = "0.1.0" source = "git+https://github.com/WalletConnect/utils-rs.git?tag=v0.11.1#ec503450d9671a5546bf8887f17723b9a02e0d36" dependencies = [ "future", - "hyper 1.2.0", + "hyper 1.3.1", "metrics", "tokio", ] [[package]] name = "http" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -1986,12 +2052,12 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.9", + "http 0.2.12", "pin-project-lite", ] @@ -2032,22 +2098,22 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2 0.3.21", - "http 0.2.9", - "http-body 0.4.5", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2", "tokio", "tower-service", "tracing", @@ -2056,9 +2122,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", @@ -2077,15 +2143,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.9", - "hyper 0.14.27", + "http 0.2.12", + "hyper 0.14.28", "log", - "rustls 0.21.10", + "rustls 0.21.12", "rustls-native-certs", "tokio", "tokio-rustls 0.24.1", @@ -2099,7 +2165,7 @@ checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "rustls 0.22.4", "rustls-pki-types", @@ -2115,7 +2181,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.27", + "hyper 0.14.28", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -2128,7 +2194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.27", + "hyper 0.14.28", "native-tls", "tokio", "tokio-native-tls", @@ -2142,7 +2208,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "native-tls", "tokio", @@ -2161,9 +2227,9 @@ dependencies = [ "futures-util", "http 1.1.0", "http-body 1.0.0", - "hyper 1.2.0", + "hyper 1.3.1", "pin-project-lite", - "socket2 0.5.4", + "socket2", "tokio", "tower", "tower-service", @@ -2172,16 +2238,16 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.57" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows-core", ] [[package]] @@ -2195,9 +2261,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2215,12 +2281,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.1" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.5", ] [[package]] @@ -2240,9 +2306,9 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "ipnetwork" @@ -2283,33 +2349,33 @@ dependencies = [ [[package]] name = "itertools" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -2320,7 +2386,7 @@ version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "pem", "ring 0.16.20", "serde", @@ -2336,15 +2402,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.148" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libgit2-sys" -version = "0.16.1+1.7.1" +version = "0.16.2+1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2a2bb3680b094add03bb3732ec520ece34da31a8cd2d633d1389d0f0fb60d0c" +checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8" dependencies = [ "cc", "libc", @@ -2352,11 +2418,21 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", +] + [[package]] name = "libz-sys" -version = "1.1.12" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d97137b25e321a73eef1418d1d5d2eda4d77e12813f8e6dead84bc52c5870a7b" +checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" dependencies = [ "cc", "libc", @@ -2366,15 +2442,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2382,9 +2458,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru" @@ -2392,18 +2468,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ - "hashbrown 0.14.1", -] - -[[package]] -name = "lzma-sys" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" -dependencies = [ - "cc", - "libc", - "pkg-config", + "hashbrown 0.14.5", ] [[package]] @@ -2445,18 +2510,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.3" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" - -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "metrics" @@ -2496,9 +2552,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -2511,9 +2567,9 @@ checksum = "9bec4598fddb13cc7b528819e697852653252b760f1228b7642679bf2ff2cd07" [[package]] name = "mio" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -2522,21 +2578,21 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" +checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" dependencies = [ "async-lock", "async-trait", "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", + "event-listener 5.3.0", "futures-util", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "quanta", "rustc_version", - "skeptic", "smallvec", "tagptr", "thiserror", @@ -2546,16 +2602,15 @@ dependencies = [ [[package]] name = "multer" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15d522be0a9c3e46fd2632e272d178f56387bdb5c9fbb3a36c649062e9b5219" +checksum = "83e87776546dc87511aa5ee218730c92b666d7264ab6ed41f9d215af9cd5224b" dependencies = [ "bytes", "encoding_rs", "futures-util", "http 1.1.0", "httparse", - "log", "memchr", "mime", "spin 0.9.8", @@ -2620,9 +2675,9 @@ dependencies = [ [[package]] name = "num" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +checksum = "3135b08af27d103b0a51f2ae0f8632117b7b185ccf931445affa8df530576a41" dependencies = [ "num-complex", "num-integer", @@ -2633,39 +2688,43 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-complex" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-iter" -version = "0.1.43" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" dependencies = [ "autocfg", "num-integer", @@ -2674,20 +2733,19 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-integer", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -2698,32 +2756,32 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -2740,7 +2798,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] @@ -2751,9 +2809,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -2795,7 +2853,7 @@ dependencies = [ "async-trait", "futures", "futures-util", - "http 0.2.9", + "http 0.2.12", "opentelemetry 0.18.0", "opentelemetry-proto", "prost", @@ -2902,11 +2960,17 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "ordered-float" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7940cf2ca942593318d07fcf2596cdca60a85c9e7fab408a5e21a4f9dcd40d87" +checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" dependencies = [ "num-traits", ] @@ -2943,6 +3007,12 @@ dependencies = [ "sha2", ] +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.11.2" @@ -2956,12 +3026,12 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", - "parking_lot_core 0.9.8", + "parking_lot_core 0.9.10", ] [[package]] @@ -2980,15 +3050,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -3000,7 +3070,7 @@ dependencies = [ "bytes", "chrono", "flate2", - "hashbrown 0.14.1", + "hashbrown 0.14.5", "num", "num-bigint", "paste", @@ -3017,14 +3087,14 @@ dependencies = [ "parquet", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pem" @@ -3037,45 +3107,45 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.0.1", + "indexmap 2.2.6", ] [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3099,21 +3169,21 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.8", - "spki 0.7.2", + "der 0.7.9", + "spki 0.7.3", ] [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "platforms" -version = "3.1.2" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4503fa043bf02cee09a9582e9554b4c6403b2ef55e4612e96561d294419429f8" +checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" [[package]] name = "pnet_base" @@ -3147,6 +3217,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3199,24 +3275,24 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", "lazy_static", "memchr", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "protobuf", "thiserror", ] @@ -3281,17 +3357,6 @@ version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" -[[package]] -name = "pulldown-cmark" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" -dependencies = [ - "bitflags 2.4.0", - "memchr", - "unicase", -] - [[package]] name = "quanta" version = "0.12.3" @@ -3309,9 +3374,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3348,9 +3413,9 @@ dependencies = [ [[package]] name = "random-string" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4e63111ec5292d8af9c220f06fe3bb87991cc78b6f1f7e291d1ae6b8a60817" +checksum = "f70fd13c3024ae3f17381bb5c4d409c6dc9ea6895c08fa2147aba305bea3c4af" dependencies = [ "fastrand 1.9.0", ] @@ -3372,11 +3437,11 @@ dependencies = [ [[package]] name = "raw-cpuid" -version = "11.0.1" +version = "11.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" +checksum = "e29830cbb1290e404f24c73af91c5d8d631ce7e128691e9477556b540cd01ecd" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", ] [[package]] @@ -3410,34 +3475,43 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] [[package]] name = "regex" -version = "1.9.5" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.3.8", - "regex-syntax 0.7.5", + "regex-automata 0.4.6", + "regex-syntax 0.8.3", ] [[package]] @@ -3451,13 +3525,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.7.5", + "regex-syntax 0.8.3", ] [[package]] @@ -3474,9 +3548,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "relay_rpc" @@ -3503,19 +3577,19 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.20" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2 0.3.21", - "http 0.2.9", - "http-body 0.4.5", - "hyper 0.14.27", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -3525,9 +3599,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", "tokio", "tokio-native-tls", "tower-service", @@ -3540,11 +3617,11 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "bytes", "encoding_rs", "futures-core", @@ -3553,7 +3630,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -3565,7 +3642,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.1", + "rustls-pemfile 2.1.2", "serde", "serde_json", "serde_urlencoded", @@ -3624,9 +3701,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -3645,22 +3722,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.14" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -3689,35 +3766,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.3", + "rustls-pemfile 1.0.4", "schannel", "security-framework", ] [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", ] [[package]] name = "rustls-pemfile" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.21.4", + "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" @@ -3742,32 +3819,23 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3778,12 +3846,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -3802,11 +3870,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -3815,9 +3883,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -3825,9 +3893,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -3840,18 +3908,18 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] [[package]] name = "serde-aux" -version = "4.2.0" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3dfe1b7eb6f9dcf011bd6fad169cdeaae75eda0d61b1a99a3f015b41b0cae39" +checksum = "0d2e8bfba469d06512e11e3311d4d051a4a387a5b42d010404fecf3200321c95" dependencies = [ "serde", "serde_json", @@ -3859,21 +3927,22 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -3881,9 +3950,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.14" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4beec8bce849d58d06238cb50db2e1c417cfeafa4c63f692b15c82b7c80f8335" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -3911,7 +3980,7 @@ dependencies = [ "futures", "lazy_static", "log", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "serial_test_derive", ] @@ -3956,18 +4025,18 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3984,9 +4053,12 @@ dependencies = [ [[package]] name = "signature" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core", +] [[package]] name = "simple_asn1" @@ -4000,21 +4072,6 @@ dependencies = [ "time", ] -[[package]] -name = "skeptic" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" -dependencies = [ - "bytecount", - "cargo_metadata 0.14.2", - "error-chain", - "glob", - "pulldown-cmark", - "tempfile", - "walkdir", -] - [[package]] name = "slab" version = "0.4.9" @@ -4032,22 +4089,12 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4074,21 +4121,21 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.8", + "der 0.7.9", ] [[package]] name = "sqlformat" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" +checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" dependencies = [ - "itertools 0.11.0", + "itertools 0.12.1", "nom", "unicode_categories", ] @@ -4109,7 +4156,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa8241483a83a3f33aa5fff7e7d9def398ff9990b2752b6c6112b83c6d246029" dependencies = [ - "ahash 0.7.6", + "ahash 0.7.8", "atoi", "base64 0.13.1", "bitflags 1.3.2", @@ -4118,10 +4165,10 @@ dependencies = [ "chrono", "crc", "crossbeam-queue", - "dirs", + "dirs 4.0.0", "dotenvy", "either", - "event-listener", + "event-listener 2.5.3", "futures-channel", "futures-core", "futures-intrusive", @@ -4222,7 +4269,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] @@ -4244,9 +4291,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", @@ -4261,9 +4308,9 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sync_wrapper" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384595c11a4e2969895cad5a8c4029115f5ab956a9e5ef4de79d11a426e5f20c" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "system-configuration" @@ -4300,22 +4347,21 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", - "redox_syscall 0.3.5", + "fastrand 2.1.0", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "test-context" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055831a02a4f5aa28fede67f2902014273eb8c21b958ac5ebbd59b71ef30dbc3" +checksum = "b7b6965c21232186af0092233c18030fe607cfc3960dbabb209325272458eeea" dependencies = [ "async-trait", "futures", @@ -4324,32 +4370,32 @@ dependencies = [ [[package]] name = "test-context-macros" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901a55b0a7a06ebc4a674dcca925170da8e613fa3b163a1df804ed10afb154d" +checksum = "d506c7664333e246f564949bee4ed39062aa0f11918e6f5a95f553cdad65c274" dependencies = [ "quote", - "syn 1.0.109", + "syn 2.0.61", ] [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] @@ -4360,9 +4406,9 @@ checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -4376,7 +4422,7 @@ checksum = "7e54bc85fc7faa8bc175c4bab5b92ba8d9a3ce893d0e9f42cc455c8ab16a9e09" dependencies = [ "byteorder", "integer-encoding", - "ordered-float 2.10.0", + "ordered-float 2.10.1", ] [[package]] @@ -4412,12 +4458,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.29" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "num-conv", + "powerfmt", "serde", "time-core", "time-macros", @@ -4431,10 +4479,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ + "num-conv", "time-core", ] @@ -4464,19 +4513,19 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.4", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -4493,13 +4542,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] @@ -4518,7 +4567,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.12", "tokio", ] @@ -4535,9 +4584,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -4546,16 +4595,15 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -4571,10 +4619,10 @@ dependencies = [ "bytes", "futures-core", "futures-util", - "h2 0.3.21", - "http 0.2.9", - "http-body 0.4.5", - "hyper 0.14.27", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", "hyper-timeout", "percent-encoding", "pin-project", @@ -4629,7 +4677,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.5.0", "bytes", "futures-util", "http 1.1.0", @@ -4657,11 +4705,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -4670,31 +4717,32 @@ dependencies = [ [[package]] name = "tracing-appender" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" dependencies = [ "crossbeam-channel", + "thiserror", "time", "tracing-subscriber", ] [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -4712,12 +4760,23 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" dependencies = [ - "lazy_static", "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", "tracing-core", ] @@ -4731,27 +4790,27 @@ dependencies = [ "opentelemetry 0.18.0", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.1.4", "tracing-subscriber", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "parking_lot 0.12.1", + "parking_lot 0.12.2", "regex", "sharded-slab", "smallvec", "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.2.0", ] [[package]] @@ -4762,9 +4821,9 @@ checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "twox-hash" @@ -4793,9 +4852,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -4805,18 +4864,18 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode_categories" @@ -4838,9 +4897,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -4855,9 +4914,9 @@ checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] name = "uuid" -version = "1.4.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "getrandom", ] @@ -4886,16 +4945,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" -[[package]] -name = "walkdir" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "want" version = "0.3.1" @@ -4911,11 +4960,17 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4923,24 +4978,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4950,9 +5005,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4960,22 +5015,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wc" @@ -4994,9 +5049,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -5025,11 +5080,12 @@ dependencies = [ [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ - "wasm-bindgen", + "redox_syscall 0.4.1", + "wasite", "web-sys", ] @@ -5049,15 +5105,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -5065,12 +5112,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows" -version = "0.48.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -5088,7 +5135,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -5108,17 +5155,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -5129,9 +5177,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -5141,9 +5189,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -5153,9 +5201,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -5165,9 +5219,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -5177,9 +5231,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -5189,9 +5243,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -5201,9 +5255,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" @@ -5233,12 +5287,12 @@ checksum = "ec874e1eef0df2dcac546057fe5e29186f09c378181cd7b635b4b7bcc98e9d81" dependencies = [ "assert-json-diff", "async-trait", - "base64 0.21.4", + "base64 0.21.7", "deadpool", "futures", "http 1.1.0", "http-body-util", - "hyper 1.2.0", + "hyper 1.3.1", "hyper-util", "log", "once_cell", @@ -5251,18 +5305,9 @@ dependencies = [ [[package]] name = "xmlparser" -version = "0.13.5" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d25c75bf9ea12c4040a97f829154768bbbce366287e2dc044af160cd79a13fd" - -[[package]] -name = "xz2" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" -dependencies = [ - "lzma-sys", -] +checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" [[package]] name = "yansi" @@ -5272,26 +5317,54 @@ checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.61", ] [[package]] name = "zeroize" -version = "1.6.0" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + +[[package]] +name = "zstd" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.10+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index 76ac96cb..65dcdbf0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ build = "build.rs" resolver = "2" [features] -full = ["functional_tests", "multitenant", "analytics", "geoblock", "cloud"] +full = ["functional_tests", "multitenant", "analytics", "geoblock", "cloud", "apns_tests", "fcm_tests", "fcmv1_tests"] # Used to enable functional tests functional_tests = [] # Multi-tenancy mode @@ -20,6 +20,9 @@ analytics = [] geoblock = [] # Enable cloud app validations cloud = [] +apns_tests = [] +fcm_tests = [] +fcmv1_tests = [] [dependencies] wc = { git = "https://github.com/WalletConnect/utils-rs.git", tag = "v0.11.1", features = ["full"] } @@ -61,6 +64,8 @@ atty = "0.2" # Push a2 = { version = "0.10.0", features = ["tracing", "openssl"] } fcm = "0.9" +# fcm_v1 = { git = "https://github.com/rj76/fcm-rust.git", package = "fcm" } +fcm_v1 = { git = "https://github.com/WalletConnect/fcm-rust.git", package = "fcm", branch = "feat/key-not-from-file", default-features = false, features = ["native-tls"] } # TODO use above version once released # Signature validation ed25519-dalek = "2.1.1" @@ -77,7 +82,7 @@ parquet = { git = "https://github.com/WalletConnect/arrow-rs.git", rev = "99a1cc parquet_derive = { git = "https://github.com/WalletConnect/arrow-rs.git", rev = "99a1cc3" } # Misc -reqwest = { version = "0.12.2", features = ["multipart", "json"] } +reqwest = { version = "0.12.4", features = ["multipart", "json"] } async-trait = "0.1" thiserror = "1.0" hex = "0.4" @@ -90,6 +95,7 @@ pnet_datalink = "0.31" ipnet = "2.5" tap = "1.0.1" wiremock = "0.6.0" +moka = { version = "0.12", features = ["future"] } [dev-dependencies] serial_test = "1.0" @@ -101,3 +107,9 @@ ed25519-dalek = { version = "2.1.1", features = ["rand_core"] } [build-dependencies] build-info-build = "0.0" + +# [patch.'https://github.com/WalletConnect/fcm-rust.git'] +# fcm = { path = "../fcm-rust" } + +# [patch.'https://github.com/WalletConnect/gauth-rs.git'] +# gauth = { path = "../gauth-rs" } diff --git a/README.md b/README.md index 30afdfdc..fbe6d04e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,10 @@ -# Echo Server -Push server for the WalletConnect v2 Protocol - -> **Note** This is only available for WalletConnect v2 and is a breaking change from the Push supported in v1. +# Push Server +Push server for the WalletConnect V2 Protocol ## Notification Providers This list contains both supported and potentially planned providers - [x] FCM (API Key) -- [ ] FCM (Google Services) +- [x] FCM V1 (Google Service Accounts) - [x] APNS (Certificate Based) - [x] APNS (Token Based) - [ ] Web Push @@ -30,7 +28,7 @@ You also have to register the device with the instance of Echo Server once when generated. By sending a POST request to `/clients` as per the [spec](./spec/spec.md). ## Multi-tenancy -Echo Server supports multi-tenancy. To enable multi-tenancy you need to specify a `TENANT_DATABASE_URL` which will then disable +Echo Server supports multi-tenancy. To enable multi-tenancy you need to specify a `TENANT_DATABASE_URL` which will then disable the single-tenant endpoints in favour of endpoints with a `/:tenant_id` prefix e.g. `/:tenant_id/client/:id` > **Warning** @@ -39,12 +37,8 @@ the single-tenant endpoints in favour of endpoints with a `/:tenant_id` prefix e ## Running locally ``` -# Run a postgres db for functional tests -# This will be removed in future revisions -# such that you can run functional tests without -# any prerequisites -docker run -p 5432:5432 --name some-postgres2 -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres -cargo test +docker compose -f docker-compose.storage.yml up -d +just test-all ``` ## Running tests locally @@ -71,7 +65,7 @@ If you wish to integrate Push functionality into your Wallet (only available on ## Contributing To get started with contributing to Echo Server, look at the [open issues](https://github.com/WalletConnect/echo-server/issues?q=is:issue+is:open+label:%22help+wanted%22). -New contributors can also look at the [issues labeled with "good first issue"](https://github.com/WalletConnect/echo-server/issues?q=is:issue+is:open+label:%22good+first+issue%22) +New contributors can also look at the [issues labeled with "good first issue"](https://github.com/WalletConnect/echo-server/issues?q=is:issue+is:open+label:%22good+first+issue%22) as they should be suitable to people who are looking at the project for the first time. ## License diff --git a/docker-compose.storage.yml b/docker-compose.storage.yml new file mode 100644 index 00000000..e1f8570d --- /dev/null +++ b/docker-compose.storage.yml @@ -0,0 +1,16 @@ +version: '3.9' +services: + + postgres: + image: postgres + environment: + - POSTGRES_PASSWORD=root + ports: + - "5432:5432" + + postgres-tenant: + image: postgres + environment: + - POSTGRES_PASSWORD=root + ports: + - "5433:5432" diff --git a/justfile b/justfile index 7cb353cc..caa1ad82 100644 --- a/justfile +++ b/justfile @@ -1,3 +1,5 @@ +set dotenv-load + lint: clippy fmt unit: lint test test-all test-single-tenant lint-tf @@ -7,10 +9,13 @@ devloop: unit fmt-imports test := "" test: - RUST_BACKTRACE=1 cargo test --lib --bins -- {{test}} + RUST_BACKTRACE=1 cargo test --all-targets -- {{test}} test-all: - RUST_BACKTRACE=1 cargo test --all-features --lib --bins -- {{test}} + RUST_BACKTRACE=1 cargo test --all-targets --features=multitenant,analytics,geoblock,functional_tests -- {{test}} + +test-all-providers: + RUST_BACKTRACE=1 cargo test --all-targets --features=multitenant,analytics,geoblock,functional_tests,apns_tests,fcm_tests,fcmv1_tests -- {{test}} test-single-tenant: RUST_BACKTRACE=1 cargo test --features=functional_tests -- {{test}} diff --git a/migrations/README.md b/migrations/README.md index fc7e1fda..4936e71a 100644 --- a/migrations/README.md +++ b/migrations/README.md @@ -8,4 +8,4 @@ This folder contains migrations for Echo Server and they are automatically calle ``` ## Contributors -To create a new migration run `./new.sh [description]` to make a new migration \ No newline at end of file +To create a new migration run `./new.sh [description]` to make a new migration diff --git a/src/blob.rs b/src/blob.rs index 0ae8a250..aca129e5 100644 --- a/src/blob.rs +++ b/src/blob.rs @@ -1,5 +1,5 @@ use { - crate::error::Result, + crate::error::{Error, Result}, base64::Engine as _, serde::{Deserialize, Serialize}, }; @@ -16,12 +16,10 @@ pub struct DecryptedPayloadBlob { } impl DecryptedPayloadBlob { - pub fn from_json_string(blob_string: String) -> Result { - Ok(serde_json::from_str(&blob_string)?) - } - pub fn from_base64_encoded(blob_string: &str) -> Result { - let blob_decoded = base64::engine::general_purpose::STANDARD.decode(blob_string)?; - Ok(serde_json::from_slice(&blob_decoded)?) + let blob_decoded = base64::engine::general_purpose::STANDARD + .decode(blob_string) + .map_err(Error::DecryptedNotificationDecode)?; + serde_json::from_slice(&blob_decoded).map_err(Error::DecryptedNotificationParse) } } diff --git a/src/config.rs b/src/config.rs index 5779c709..b49446a7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -61,6 +61,8 @@ pub struct Config { // FCM #[cfg(not(feature = "multitenant"))] pub fcm_api_key: Option, + #[cfg(not(feature = "multitenant"))] + pub fcm_v1_credentials: Option, // Multi-tenancy pub tenant_database_url: String, @@ -122,7 +124,7 @@ impl Config { supported.push(ProviderKind::ApnsSandbox); } - if self.fcm_api_key.is_some() { + if self.fcm_api_key.is_some() || self.fcm_v1_credentials.is_some() { supported.push(ProviderKind::Fcm); } diff --git a/src/error.rs b/src/error.rs index ac19613e..888e8174 100644 --- a/src/error.rs +++ b/src/error.rs @@ -37,9 +37,15 @@ pub enum Error { #[error(transparent)] Fcm(#[from] fcm::FcmError), + #[error(transparent)] + FcmV1(#[from] fcm_v1::SendError), + #[error("FCM Responded with an error")] FcmResponse(fcm::ErrorReason), + #[error("FCM v1 Responded with an error")] + FcmV1Response(fcm_v1::ErrorReason), + #[error(transparent)] Io(#[from] std::io::Error), @@ -47,7 +53,7 @@ pub enum Error { Database(#[from] sqlx::Error), #[error(transparent)] - Hex(#[from] hex::FromHexError), + Hex(hex::FromHexError), #[error(transparent)] Ed25519(#[from] ed25519_dalek::ed25519::Error), @@ -58,8 +64,20 @@ pub enum Error { #[error(transparent)] Base64Decode(#[from] base64::DecodeError), - #[error(transparent)] - Json(#[from] serde_json::Error), + #[error("Failed to decode legacy decrypted message: {0}")] + DecryptedNotificationDecode(base64::DecodeError), + + #[error("Failed to parse legacy decrypted message as JSON: {0}")] + DecryptedNotificationParse(serde_json::Error), + + #[error("Invalid ServiceServiceAccount key: {0}")] + FcmV1InvalidServiceAccountKey(serde_json::Error), + + #[error("Internal: Invalid ServiceServiceAccount key: {0}")] + InternalFcmV1InvalidServiceAccountKey(serde_json::Error), + + #[error("Failed to perform internal serialization: {0}")] + InternalSerializationError(serde_json::Error), #[error(transparent)] Store(#[from] StoreError), @@ -166,6 +184,9 @@ pub enum Error { #[error("Invalid FCM API key")] BadFcmApiKey, + #[error("Invalid FCM v1 credentials")] + BadFcmV1Credentials, + #[error("Invalid APNs creds")] BadApnsCredentials, @@ -236,6 +257,30 @@ impl IntoResponse for Error { location: ErrorLocation::Body, } ]), + Error::FcmV1InvalidServiceAccountKey(e) => crate::handlers::Response::new_failure(StatusCode::BAD_REQUEST, vec![ + ResponseError { + name: "fcm_v1_invalid_service_account_key".to_string(), + message: format!("The provided Service Account Key was not valid: {e}"), + } + ], vec![ + ErrorField { + field: "fcm_v1_credentials".to_string(), + description: "FCM V1 credentials".to_string(), + location: ErrorLocation::Body, + } + ]), + Error::BadFcmV1Credentials => crate::handlers::Response::new_failure(StatusCode::BAD_REQUEST, vec![ + ResponseError { + name: "bad_fcm_v1_credentials".to_string(), + message: "The provided credentials were not valid".to_string(), + } + ], vec![ + ErrorField { + field: "fcm_v1_credentials".to_string(), + description: "FCM V1 credentials".to_string(), + location: ErrorLocation::Body, + } + ]), Error::Database(e) => crate::handlers::Response::new_failure(StatusCode::INTERNAL_SERVER_ERROR, vec![ ResponseError { name: "sqlx".to_string(), @@ -422,10 +467,16 @@ impl IntoResponse for Error { message: "failed to perform io task, this should not have occurred, please report at: https://github.com/walletconnect/echo-server".to_string(), }, ], vec![]), - Error::Json(_) => crate::handlers::Response::new_failure(StatusCode::BAD_REQUEST, vec![ + Error::DecryptedNotificationDecode(_) => crate::handlers::Response::new_failure(StatusCode::ACCEPTED, vec![ + ResponseError { + name: "json".to_string(), + message: "Decrypted notification does not decode as base64".to_string(), + }, + ], vec![]), + Error::DecryptedNotificationParse(_) => crate::handlers::Response::new_failure(StatusCode::ACCEPTED, vec![ ResponseError { name: "json".to_string(), - message: "received invalid json payload, please ensure all fields that contain json are valid".to_string(), + message: "Decrypted notification does not parse as JSON".to_string(), }, ], vec![]), Error::ToStr(_) => crate::handlers::Response::new_failure(StatusCode::INTERNAL_SERVER_ERROR, vec![ diff --git a/src/handlers/create_tenant.rs b/src/handlers/create_tenant.rs index cb91656d..dfce4539 100644 --- a/src/handlers/create_tenant.rs +++ b/src/handlers/create_tenant.rs @@ -28,8 +28,7 @@ pub async fn handler( Json(body): Json, ) -> Result, Error> { #[cfg(feature = "cloud")] - if let Err(e) = - validate_tenant_request(&state.jwt_validation_client, &headers, body.id.clone()).await + if let Err(e) = validate_tenant_request(&state.jwt_validation_client, &headers, &body.id).await { error!( tenant_id = %body.id, diff --git a/src/handlers/delete_tenant.rs b/src/handlers/delete_tenant.rs index 3cdb885d..fcb96ab7 100644 --- a/src/handlers/delete_tenant.rs +++ b/src/handlers/delete_tenant.rs @@ -26,7 +26,7 @@ pub async fn handler( ) -> Result, Error> { #[cfg(feature = "cloud")] let verification_res = - validate_tenant_request(&state.jwt_validation_client, &headers, id.clone()).await; + validate_tenant_request(&state.jwt_validation_client, &headers, &id).await; #[cfg(not(feature = "cloud"))] let verification_res = validate_tenant_request(&state.jwt_validation_client, &headers); diff --git a/src/handlers/get_tenant.rs b/src/handlers/get_tenant.rs index 2a4df361..2361315c 100644 --- a/src/handlers/get_tenant.rs +++ b/src/handlers/get_tenant.rs @@ -1,7 +1,11 @@ use { crate::{ - error::Error, handlers::validate_tenant_request, log::prelude::*, providers::ProviderKind, - state::AppState, stores::tenant::ApnsType, + error::Error, + handlers::validate_tenant_request, + log::prelude::*, + providers::{ProviderKind, PROVIDER_FCM_V1}, + state::AppState, + stores::tenant::ApnsType, }, axum::{ extract::{Path, State}, @@ -13,14 +17,14 @@ use { tracing::instrument, }; -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Debug)] pub struct GetTenantResponse { - url: String, - enabled_providers: Vec, - apns_topic: Option, - apns_type: Option, - suspended: bool, - suspended_reason: Option, + pub url: String, + pub enabled_providers: Vec, + pub apns_topic: Option, + pub apns_type: Option, + pub suspended: bool, + pub suspended_reason: Option, } #[instrument(skip_all, name = "get_tenant_handler")] @@ -31,7 +35,7 @@ pub async fn handler( ) -> Result, Error> { #[cfg(feature = "cloud")] let verification_res = - validate_tenant_request(&state.jwt_validation_client, &headers, id.clone()).await; + validate_tenant_request(&state.jwt_validation_client, &headers, &id).await; #[cfg(not(feature = "cloud"))] let verification_res = validate_tenant_request(&state.jwt_validation_client, &headers); @@ -51,7 +55,17 @@ pub async fn handler( let mut res = GetTenantResponse { url: format!("{}/{}", state.config.public_url, tenant.id), - enabled_providers: tenant.providers().iter().map(Into::into).collect(), + enabled_providers: tenant + .providers() + .iter() + .map(Into::into) + // Special case on fcm_v1 for credentials because providers() is also used for token management (of which FCM and FCM V1 tokens are the same) + .chain(if tenant.fcm_v1_credentials.is_some() { + vec![PROVIDER_FCM_V1.to_string()] + } else { + vec![] + }) + .collect(), apns_topic: None, apns_type: None, suspended: tenant.suspended, diff --git a/src/handlers/mod.rs b/src/handlers/mod.rs index 52dea63f..573491e5 100644 --- a/src/handlers/mod.rs +++ b/src/handlers/mod.rs @@ -37,6 +37,8 @@ pub mod health; pub mod update_apns; #[cfg(feature = "multitenant")] pub mod update_fcm; +#[cfg(feature = "multitenant")] +pub mod update_fcm_v1; pub const DECENTRALIZED_IDENTIFIER_PREFIX: &str = "did:key:"; @@ -158,7 +160,7 @@ impl Default for Response { pub async fn validate_tenant_request( jwt_validation_client: &JwtValidationClient, headers: &HeaderMap, - project_id: String, + project_id: &str, ) -> Result { if let Some(token_value) = headers.get(AUTHORIZATION) { Ok(match jwt_validation_client @@ -191,6 +193,7 @@ pub fn validate_tenant_request( headers: &HeaderMap, ) -> Result { if let Some(token_data) = headers.get(AUTHORIZATION) { + // TODO Clients should always use `Bearer`, migrate them (if not already) and remove this optionality if jwt_validation_client .is_valid_token(token_data.to_str()?.to_string().replace("Bearer ", "")) .is_ok() diff --git a/src/handlers/push_message.rs b/src/handlers/push_message.rs index 86d092b1..596b0314 100644 --- a/src/handlers/push_message.rs +++ b/src/handlers/push_message.rs @@ -364,8 +364,13 @@ pub async fn handler_internal( return Err((Error::TenantSuspended, analytics.clone())); } - let mut provider = tenant - .provider(&client.push_type) + let provider = tenant + .provider( + &client.push_type, + state.http_client.clone(), + &state.provider_cache, + ) + .await .tap_err(|e| warn!("error fetching provider: {e:?}")) .map_err(|e| (e, analytics.clone()))?; debug!( @@ -463,6 +468,7 @@ pub async fn handler_internal( // Provider specific metrics match provider { Provider::Fcm(_) => increment_counter!(state.metrics, sent_fcm_notifications), + Provider::FcmV1(_) => increment_counter!(state.metrics, sent_fcm_v1_notifications), Provider::Apns(_) => increment_counter!(state.metrics, sent_apns_notifications), #[cfg(any(debug_assertions, test))] Provider::Noop(_) => {} diff --git a/src/handlers/update_apns.rs b/src/handlers/update_apns.rs index d4951d37..fd7042bd 100644 --- a/src/handlers/update_apns.rs +++ b/src/handlers/update_apns.rs @@ -127,7 +127,7 @@ pub async fn handler( // JWT verification #[cfg(feature = "cloud")] let jwt_verification_result = - validate_tenant_request(&state.jwt_validation_client, &headers, id.clone()).await; + validate_tenant_request(&state.jwt_validation_client, &headers, &id).await; #[cfg(not(feature = "cloud"))] let jwt_verification_result = validate_tenant_request(&state.jwt_validation_client, &headers); diff --git a/src/handlers/update_fcm.rs b/src/handlers/update_fcm.rs index f373a269..b8837bdf 100644 --- a/src/handlers/update_fcm.rs +++ b/src/handlers/update_fcm.rs @@ -41,7 +41,7 @@ pub async fn handler( // JWT token verification #[cfg(feature = "cloud")] let jwt_verification_result = - validate_tenant_request(&state.jwt_validation_client, &headers, id.clone()).await; + validate_tenant_request(&state.jwt_validation_client, &headers, &id).await; #[cfg(not(feature = "cloud"))] let jwt_verification_result = validate_tenant_request(&state.jwt_validation_client, &headers); diff --git a/src/handlers/update_fcm_v1.rs b/src/handlers/update_fcm_v1.rs new file mode 100644 index 00000000..3a8ddd3e --- /dev/null +++ b/src/handlers/update_fcm_v1.rs @@ -0,0 +1,104 @@ +use { + crate::{ + error::{Error, Error::InvalidMultipartBody}, + handlers::validate_tenant_request, + increment_counter, + state::AppState, + stores::tenant::TenantFcmV1UpdateParams, + }, + axum::{ + extract::{Multipart, Path, State}, + http::HeaderMap, + Json, + }, + serde::Serialize, + std::sync::Arc, + tracing::{debug, error, instrument}, +}; + +pub struct FcmV1UpdateBody { + credentials: String, + /// Used to ensure that at least one value has changed + value_changed_: bool, +} + +#[derive(Serialize)] +pub struct UpdateTenantFcmV1Response { + success: bool, +} + +#[instrument(skip_all, name = "update_fcm_v1_handler")] +pub async fn handler( + State(state): State>, + Path(id): Path, + headers: HeaderMap, + mut form_body: Multipart, +) -> Result, Error> { + // JWT token verification + #[cfg(feature = "cloud")] + let jwt_verification_result = + validate_tenant_request(&state.jwt_validation_client, &headers, &id).await; + + // -- check if tenant is real + let _existing_tenant = state.tenant_store.get_tenant(&id).await?; + + #[cfg(not(feature = "cloud"))] + let jwt_verification_result = validate_tenant_request(&state.jwt_validation_client, &headers); + + if let Err(e) = jwt_verification_result { + error!( + tenant_id = %id, + err = ?e, + "JWT verification failed" + ); + return Err(e); + } + + // ---- retrieve body from form + let mut body = FcmV1UpdateBody { + credentials: Default::default(), + value_changed_: false, + }; + while let Some(field) = form_body.next_field().await? { + let name = field.name().unwrap_or("unknown").to_string(); + let data = field.text().await?; + + if name.to_lowercase().as_str() == "credentials" { + body.credentials = data; + body.value_changed_ = true; + }; + } + if !body.value_changed_ { + return Err(InvalidMultipartBody); + } + + // Client will validate the key on startup + fcm_v1::Client::from_key( + serde_json::from_str(&body.credentials).map_err(Error::FcmV1InvalidServiceAccountKey)?, + ) + .await + .map_err(|e| { + debug!("Failed credential validation: {e}"); + Error::BadFcmV1Credentials + })?; + + // ---- handler + let update_body = TenantFcmV1UpdateParams { + fcm_v1_credentials: body.credentials, + }; + + let new_tenant = state + .tenant_store + .update_tenant_fcm_v1(&id, update_body) + .await?; + + if new_tenant.suspended { + // If suspended, it can be restored now because valid credentials have been + // provided + state.tenant_store.unsuspend_tenant(&new_tenant.id).await?; + } + + increment_counter!(state.metrics, tenant_fcm_v1_updates); + + Ok(Json(UpdateTenantFcmV1Response { success: true })) +} diff --git a/src/lib.rs b/src/lib.rs index d7b60f46..c338dd84 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -217,6 +217,7 @@ pub async fn bootstap(mut shutdown: broadcast::Receiver<()>, config: Config) -> get(handlers::get_tenant::handler).delete(handlers::delete_tenant::handler), ) .route("/:id/fcm", post(handlers::update_fcm::handler)) + .route("/:id/fcm_v1", post(handlers::update_fcm_v1::handler)) .route("/:id/apns", post(handlers::update_apns::handler)) .layer( global_middleware.clone().layer( diff --git a/src/metrics/mod.rs b/src/metrics/mod.rs index 1703fd26..1deda837 100644 --- a/src/metrics/mod.rs +++ b/src/metrics/mod.rs @@ -19,6 +19,7 @@ pub struct Metrics { pub received_notifications: Counter, pub sent_fcm_notifications: Counter, + pub sent_fcm_v1_notifications: Counter, pub sent_apns_notifications: Counter, pub registered_clients: UpDownCounter, @@ -26,6 +27,7 @@ pub struct Metrics { pub tenant_apns_updates: Counter, pub tenant_fcm_updates: Counter, + pub tenant_fcm_v1_updates: Counter, pub tenant_suspensions: Counter, pub client_suspensions: Counter, @@ -71,6 +73,11 @@ impl Metrics { .with_description("The number of notifications sent to FCM") .init(); + let sent_fcm_v1_notification_counter = meter + .u64_counter("sent_fcm_v1_notifications") + .with_description("The number of notifications sent to FCM") + .init(); + let sent_apns_notification_counter = meter .u64_counter("sent_apns_notifications") .with_description("The number of notifications sent to APNS") @@ -86,6 +93,11 @@ impl Metrics { .with_description("The number of times tenants have updated their FCM") .init(); + let tenant_fcm_v1_updates_counter = meter + .u64_counter("tenant_fcm_v1_updates") + .with_description("The number of times tenants have updated their FCM") + .init(); + let tenant_suspensions_counter = meter .u64_counter("tenant_suspensions") .with_description("The number of tenants that have been suspended") @@ -101,10 +113,12 @@ impl Metrics { registered_clients: clients_counter, received_notifications: received_notification_counter, sent_fcm_notifications: sent_fcm_notification_counter, + sent_fcm_v1_notifications: sent_fcm_v1_notification_counter, sent_apns_notifications: sent_apns_notification_counter, registered_tenants: tenants_counter, tenant_apns_updates: tenant_apns_updates_counter, tenant_fcm_updates: tenant_fcm_updates_counter, + tenant_fcm_v1_updates: tenant_fcm_v1_updates_counter, tenant_suspensions: tenant_suspensions_counter, client_suspensions: client_suspensions_counter, }) diff --git a/src/middleware/validate_signature.rs b/src/middleware/validate_signature.rs index 5957bbba..2a63be94 100644 --- a/src/middleware/validate_signature.rs +++ b/src/middleware/validate_signature.rs @@ -84,7 +84,7 @@ pub async fn signature_is_valid( ) -> Result { let sig_body = format!("{}.{}.{}", timestamp, body.len(), body); - let sig_bytes = hex::decode(signature)?; + let sig_bytes = hex::decode(signature).map_err(crate::error::Error::Hex)?; let sig = Signature::try_from(sig_bytes.as_slice())?; Ok(public_key.verify_strict(sig_body.as_bytes(), &sig).is_ok()) diff --git a/src/providers/apns.rs b/src/providers/apns.rs index 9dadffbd..683cf295 100644 --- a/src/providers/apns.rs +++ b/src/providers/apns.rs @@ -50,7 +50,7 @@ impl ApnsProvider { impl PushProvider for ApnsProvider { #[instrument(name = "send_apns_notification")] async fn send_notification( - &mut self, + &self, token: String, body: PushMessage, ) -> crate::error::Result<()> { diff --git a/src/providers/fcm.rs b/src/providers/fcm.rs index f5e89d8e..2512c723 100644 --- a/src/providers/fcm.rs +++ b/src/providers/fcm.rs @@ -25,7 +25,7 @@ impl FcmProvider { impl PushProvider for FcmProvider { #[instrument(name = "send_fcm_notification")] async fn send_notification( - &mut self, + &self, token: String, body: PushMessage, ) -> crate::error::Result<()> { @@ -35,7 +35,9 @@ impl PushProvider for FcmProvider { PushMessage::RawPushMessage(message) => { // Sending `always_raw` encrypted message debug!("Sending raw encrypted message"); - message_builder.data(&message)?; + message_builder + .data(&message) + .map_err(Error::InternalSerializationError)?; set_message_priority_high(&mut message_builder); let fcm_message = message_builder.finalize(); self.client.send(fcm_message).await @@ -43,7 +45,9 @@ impl PushProvider for FcmProvider { PushMessage::LegacyPushMessage(LegacyPushMessage { id: _, payload }) => { if payload.is_encrypted() { debug!("Sending legacy `is_encrypted` message"); - message_builder.data(&payload)?; + message_builder + .data(&payload) + .map_err(Error::InternalSerializationError)?; set_message_priority_high(&mut message_builder); let fcm_message = message_builder.finalize(); self.client.send(fcm_message).await @@ -57,7 +61,9 @@ impl PushProvider for FcmProvider { let notification = notification_builder.finalize(); message_builder.notification(notification); - message_builder.data(&payload.to_owned())?; + message_builder + .data(&payload.to_owned()) + .map_err(Error::InternalSerializationError)?; let fcm_message = message_builder.finalize(); self.client.send(fcm_message).await } diff --git a/src/providers/fcm_v1.rs b/src/providers/fcm_v1.rs new file mode 100644 index 00000000..ad6f1b44 --- /dev/null +++ b/src/providers/fcm_v1.rs @@ -0,0 +1,200 @@ +use { + super::{LegacyPushMessage, PushMessage}, + crate::{blob::DecryptedPayloadBlob, error::Error, providers::PushProvider}, + async_trait::async_trait, + fcm_v1::{ + gauth::serv_account::ServiceAccountKey, AndroidConfig, AndroidMessagePriority, + AndroidNotification, Client, ClientBuildError, ErrorReason, Message, Notification, + Response, Target, WebpushConfig, + }, + tracing::{debug, instrument}, +}; + +#[derive(Debug, Clone)] +pub struct FcmV1Provider { + client: Client, +} + +impl FcmV1Provider { + pub async fn new( + credentials: ServiceAccountKey, + http_client: reqwest::Client, + ) -> Result { + let client = Client::builder() + .http_client(http_client) + .build(credentials) + .await?; + Ok(Self { client }) + } +} + +#[async_trait] +impl PushProvider for FcmV1Provider { + #[instrument(name = "send_fcm_v1_notification", skip_all)] + async fn send_notification( + &self, + token: String, + body: PushMessage, + ) -> crate::error::Result<()> { + let result = match body { + PushMessage::RawPushMessage(message) => { + // Sending `always_raw` encrypted message + debug!("Sending raw encrypted message"); + let message = Message { + data: Some( + serde_json::to_value(message).map_err(Error::InternalSerializationError)?, + ), + notification: None, + target: Target::Token(token), + android: Some(AndroidConfig { + priority: Some(AndroidMessagePriority::High), + collapse_key: None, + ttl: None, + restricted_package_name: None, + data: None, + notification: None, + fcm_options: None, + direct_boot_ok: None, + }), + // TODO + webpush: Some(WebpushConfig { + headers: None, + data: None, + notification: None, + fcm_options: None, + }), + // TODO do we need to set this for iOS React Native? We are missing content_available equivalent + apns: None, + fcm_options: None, + }; + self.client.send(message).await + } + PushMessage::LegacyPushMessage(LegacyPushMessage { id: _, payload }) => { + if payload.is_encrypted() { + debug!("Sending legacy `is_encrypted` message"); + let message = Message { + data: Some( + serde_json::to_value(payload) + .map_err(Error::InternalSerializationError)?, + ), + notification: None, + target: Target::Token(token), + android: Some(AndroidConfig { + priority: Some(AndroidMessagePriority::High), + collapse_key: None, + ttl: None, + restricted_package_name: None, + data: None, + notification: None, + fcm_options: None, + direct_boot_ok: None, + }), + // TODO + webpush: Some(WebpushConfig { + headers: None, + data: None, + notification: None, + fcm_options: None, + }), + // TODO do we need to set this for iOS React Native? We are missing content_available equivalent + apns: None, + fcm_options: None, + }; + self.client.send(message).await + } else { + debug!("Sending plain message"); + let blob = DecryptedPayloadBlob::from_base64_encoded(&payload.blob)?; + + let message = Message { + data: Some( + serde_json::to_value(payload.to_owned()) + .map_err(Error::InternalSerializationError)?, + ), + notification: Some(Notification { + title: Some(blob.title.clone()), + body: Some(blob.body.clone()), + image: None, + }), + target: Target::Token(token), + android: Some(AndroidConfig { + priority: Some(AndroidMessagePriority::High), + collapse_key: None, + ttl: None, + restricted_package_name: None, + data: None, + notification: Some(AndroidNotification { + notification_priority: None, + // TODO do we need to override this of already set in `notification` above? + title: Some(blob.title), + body: Some(blob.body), + icon: None, + color: None, + sound: None, + tag: None, + click_action: None, + body_loc_key: None, + body_loc_args: None, + title_loc_key: None, + title_loc_args: None, + channel_id: None, + ticker: None, + sticky: None, + event_time: None, + local_only: None, + default_sound: None, + default_vibrate_timings: None, + default_light_settings: None, + vibrate_timings: None, + visibility: None, + notification_count: None, + light_settings: None, + image: None, + }), + fcm_options: None, + direct_boot_ok: None, + }), + // TODO + webpush: Some(WebpushConfig { + headers: None, + data: None, + notification: None, + fcm_options: None, + }), + // TODO do we need to set this for iOS React Native? We are missing content_available equivalent + apns: None, + fcm_options: None, + }; + self.client.send(message).await + } + } + }; + + #[allow(clippy::match_single_binding)] + match result { + Ok(val) => { + let Response { error, .. } = val; + if let Some(error) = error { + match error { + ErrorReason::MissingRegistration => Err(Error::BadDeviceToken( + "Missing registration for token".into(), + )), + ErrorReason::InvalidRegistration => { + Err(Error::BadDeviceToken("Invalid token registration".into())) + } + ErrorReason::NotRegistered => { + Err(Error::BadDeviceToken("Token is not registered".into())) + } + ErrorReason::InvalidApnsCredential => Err(Error::BadApnsCredentials), + e => Err(Error::FcmV1Response(e)), + } + } else { + Ok(()) + } + } + Err(e) => match e { + // SendError::Unauthorized => Err(Error::BadFcmV1Credentials), + e => Err(Error::FcmV1(e)), + }, + } + } +} diff --git a/src/providers/mod.rs b/src/providers/mod.rs index 07f39236..b9dc33e6 100644 --- a/src/providers/mod.rs +++ b/src/providers/mod.rs @@ -1,12 +1,14 @@ pub mod apns; pub mod fcm; +pub mod fcm_v1; #[cfg(any(debug_assertions, test))] pub mod noop; use { + self::fcm_v1::FcmV1Provider, crate::{ blob::ENCRYPTED_FLAG, - error::{self}, + error, providers::{apns::ApnsProvider, fcm::FcmProvider}, }, async_trait::async_trait, @@ -76,14 +78,15 @@ pub struct RawPushMessage { #[async_trait] pub trait PushProvider { - async fn send_notification(&mut self, token: String, body: PushMessage) -> error::Result<()>; + async fn send_notification(&self, token: String, body: PushMessage) -> error::Result<()>; } -const PROVIDER_APNS: &str = "apns"; -const PROVIDER_APNS_SANDBOX: &str = "apns-sandbox"; -const PROVIDER_FCM: &str = "fcm"; +pub const PROVIDER_APNS: &str = "apns"; +pub const PROVIDER_APNS_SANDBOX: &str = "apns-sandbox"; +pub const PROVIDER_FCM: &str = "fcm"; +pub const PROVIDER_FCM_V1: &str = "fcm_v1"; #[cfg(any(debug_assertions, test))] -const PROVIDER_NOOP: &str = "noop"; +pub const PROVIDER_NOOP: &str = "noop"; #[derive(Debug, Copy, Clone, PartialEq, Eq, sqlx::Type)] #[sqlx(type_name = "provider")] @@ -92,6 +95,7 @@ pub enum ProviderKind { Apns, ApnsSandbox, Fcm, + // Intentionally no FcmV1 variant because ProviderKind is also used to determine token type (of which FCM and FCM V1 are the same) #[cfg(any(debug_assertions, test))] Noop, } @@ -148,9 +152,10 @@ impl TryFrom<&str> for ProviderKind { } #[allow(clippy::large_enum_variant)] -#[derive(Debug)] +#[derive(Debug, Clone)] pub enum Provider { Fcm(FcmProvider), + FcmV1(FcmV1Provider), Apns(ApnsProvider), #[cfg(any(debug_assertions, test))] Noop(NoopProvider), @@ -159,9 +164,10 @@ pub enum Provider { #[async_trait] impl PushProvider for Provider { #[instrument(name = "send_notification")] - async fn send_notification(&mut self, token: String, body: PushMessage) -> error::Result<()> { + async fn send_notification(&self, token: String, body: PushMessage) -> error::Result<()> { match self { Provider::Fcm(p) => p.send_notification(token, body).await, + Provider::FcmV1(p) => p.send_notification(token, body).await, Provider::Apns(p) => p.send_notification(token, body).await, #[cfg(any(debug_assertions, test))] Provider::Noop(p) => p.send_notification(token, body).await, diff --git a/src/providers/noop.rs b/src/providers/noop.rs index 89b63fdd..b6b51fb1 100644 --- a/src/providers/noop.rs +++ b/src/providers/noop.rs @@ -1,11 +1,16 @@ use { - super::PushMessage, crate::providers::PushProvider, async_trait::async_trait, reqwest::Url, - std::collections::HashMap, tracing::instrument, + super::PushMessage, + crate::providers::PushProvider, + async_trait::async_trait, + reqwest::Url, + std::{collections::HashMap, sync::Arc}, + tokio::sync::RwLock, + tracing::instrument, }; -#[derive(Debug, Default, PartialEq, Eq, Clone)] +#[derive(Debug, Default, Clone)] pub struct NoopProvider { - notifications: HashMap>, + notifications: Arc>>>, } impl NoopProvider { @@ -18,13 +23,14 @@ impl NoopProvider { impl PushProvider for NoopProvider { #[instrument(name = "send_noop_notification")] async fn send_notification( - &mut self, + &self, token: String, body: PushMessage, ) -> crate::error::Result<()> { - self.bootstrap(token.clone()); + self.bootstrap(token.clone()).await; - let notifications = self.notifications.get_mut(&token).unwrap(); + let mut lock = self.notifications.write().await; + let notifications = lock.get_mut(&token).unwrap(); notifications.append(&mut vec![body]); if let Ok(url) = token.parse::() { @@ -38,7 +44,7 @@ impl PushProvider for NoopProvider { // Utils impl NoopProvider { /// Insert empty notifications for a new token - fn bootstrap(&mut self, token: String) { - self.notifications.entry(token).or_default(); + async fn bootstrap(&self, token: String) { + self.notifications.write().await.entry(token).or_default(); } } diff --git a/src/relay/mod.rs b/src/relay/mod.rs index 9da31482..095e230d 100644 --- a/src/relay/mod.rs +++ b/src/relay/mod.rs @@ -18,7 +18,7 @@ impl RelayClient { } fn string_to_verifying_key(string_key: &str) -> crate::error::Result { - let key_bytes = hex::decode(string_key)?; + let key_bytes = hex::decode(string_key).map_err(crate::error::Error::Hex)?; Ok(VerifyingKey::from_bytes( <&[u8; 32]>::try_from(key_bytes.as_slice()).unwrap(), )?) diff --git a/src/state.rs b/src/state.rs index a27baeca..114f184d 100644 --- a/src/state.rs +++ b/src/state.rs @@ -3,10 +3,12 @@ use { config::Config, metrics::Metrics, networking, + providers::Provider, relay::RelayClient, stores::{client::ClientStore, notification::NotificationStore, tenant::TenantStore}, }, build_info::BuildInfo, + moka::future::Cache, std::{net::IpAddr, sync::Arc}, wc::geoip::{block::middleware::GeoBlockLayer, MaxMindResolver}, }; @@ -51,6 +53,8 @@ pub struct AppState { pub instance_id: uuid::Uuid, /// Service instance uptime measurement pub uptime: std::time::Instant, + pub http_client: reqwest::Client, + pub provider_cache: Cache, } build_info::build_info!(fn build_info); @@ -95,6 +99,8 @@ pub fn new_state( geoblock: None, instance_id: uuid::Uuid::new_v4(), uptime: std::time::Instant::now(), + http_client: reqwest::Client::new(), + provider_cache: Cache::new(100), }) } diff --git a/src/stores/tenant.rs b/src/stores/tenant.rs index d858a552..166b563c 100644 --- a/src/stores/tenant.rs +++ b/src/stores/tenant.rs @@ -4,19 +4,22 @@ use { crate::{ error::{ self, - Error::{InvalidTenantId, ProviderNotAvailable}, + Error::{self, InvalidTenantId, ProviderNotAvailable}, Result, }, providers::{ apns::ApnsProvider, fcm::FcmProvider, - Provider::{self, Apns, Fcm}, + fcm_v1::FcmV1Provider, + Provider::{self, Apns, Fcm, FcmV1}, ProviderKind, }, }, async_trait::async_trait, base64::Engine as _, chrono::{DateTime, Utc}, + moka::future::Cache, + reqwest::Client, serde::{Deserialize, Serialize}, sqlx::{Executor, PgPool}, tracing::{debug, instrument}, @@ -82,6 +85,7 @@ pub struct Tenant { pub id: String, pub fcm_api_key: Option, + pub fcm_v1_credentials: Option, pub apns_type: Option, pub apns_topic: Option, @@ -113,6 +117,11 @@ pub struct TenantFcmUpdateParams { pub fcm_api_key: String, } +#[derive(Debug, Eq, PartialEq, Clone)] +pub struct TenantFcmV1UpdateParams { + pub fcm_v1_credentials: String, +} + #[derive(Deserialize, Clone, Debug)] pub enum TenantApnsUpdateAuth { Certificate { @@ -140,7 +149,7 @@ impl Tenant { supported.push(ProviderKind::ApnsSandbox); } - if self.fcm_api_key.is_some() { + if self.fcm_api_key.is_some() || self.fcm_v1_credentials.is_some() { supported.push(ProviderKind::Fcm); } @@ -179,7 +188,12 @@ impl Tenant { } #[instrument(skip_all, fields(tenant_id = %self.id, provider = %provider.as_str()))] - pub fn provider(&self, provider: &ProviderKind) -> Result { + pub async fn provider( + &self, + provider: &ProviderKind, + http_client: Client, + provider_cache: &Cache, + ) -> Result { if !self.providers().contains(provider) { return Err(ProviderNotAvailable(provider.into())); } @@ -236,13 +250,39 @@ impl Tenant { None => Err(ProviderNotAvailable(provider.into())), } } - ProviderKind::Fcm => match self.fcm_api_key.clone() { - Some(api_key) => { - debug!("fcm provider is matched"); - let fcm = FcmProvider::new(api_key); - Ok(Fcm(fcm)) + ProviderKind::Fcm => match self.fcm_v1_credentials.clone() { + Some(fcm_v1_credentials) => { + debug!("fcm v1 provider is matched"); + if let Some(provider) = provider_cache.get(&fcm_v1_credentials).await { + return Ok(provider); + } + #[allow(clippy::match_single_binding)] + let fcm = FcmV1( + FcmV1Provider::new( + serde_json::from_str(&fcm_v1_credentials) + .map_err(Error::InternalFcmV1InvalidServiceAccountKey)?, + http_client, + ) + .await + .map_err(|e| match e { + // TODO check specific error + // ServiceAccountError::Unauthorized => Error::BadFcmV1Credentials, + _ => Error::BadFcmV1Credentials, + })?, + ); + provider_cache + .insert(fcm_v1_credentials.clone(), fcm.clone()) + .await; + Ok(fcm) } - None => Err(ProviderNotAvailable(provider.into())), + None => match self.fcm_api_key.clone() { + Some(api_key) => { + debug!("fcm provider is matched"); + let fcm = FcmProvider::new(api_key); + Ok(Fcm(fcm)) + } + None => Err(ProviderNotAvailable(provider.into())), + }, }, #[cfg(any(debug_assertions, test))] ProviderKind::Noop => { @@ -259,6 +299,11 @@ pub trait TenantStore { async fn delete_tenant(&self, id: &str) -> Result<()>; async fn create_tenant(&self, params: TenantUpdateParams) -> Result; async fn update_tenant_fcm(&self, id: &str, params: TenantFcmUpdateParams) -> Result; + async fn update_tenant_fcm_v1( + &self, + id: &str, + params: TenantFcmV1UpdateParams, + ) -> Result; async fn update_tenant_apns(&self, id: &str, params: TenantApnsUpdateParams) -> Result; async fn update_tenant_apns_auth( &self, @@ -328,6 +373,24 @@ impl TenantStore for PgPool { Ok(res) } + #[instrument(skip(self))] + async fn update_tenant_fcm_v1( + &self, + id: &str, + params: TenantFcmV1UpdateParams, + ) -> Result { + let res = sqlx::query_as::( + "UPDATE public.tenants SET fcm_v1_credentials = $2, updated_at = NOW() WHERE id = $1 \ + RETURNING *;", + ) + .bind(id) + .bind(params.fcm_v1_credentials) + .fetch_one(self) + .await?; + + Ok(res) + } + #[instrument(skip(self))] async fn update_tenant_apns(&self, id: &str, params: TenantApnsUpdateParams) -> Result { let res = sqlx::query_as::( @@ -419,6 +482,7 @@ impl DefaultTenantStore { Ok(DefaultTenantStore(Tenant { id: DEFAULT_TENANT_ID.to_string(), fcm_api_key: config.fcm_api_key.clone(), + fcm_v1_credentials: config.fcm_v1_credentials.clone(), apns_type: config.apns_type, apns_topic: config.apns_topic.clone(), apns_certificate: config.apns_certificate.clone(), @@ -453,6 +517,14 @@ impl TenantStore for DefaultTenantStore { panic!("Shouldn't have run in single tenant mode") } + async fn update_tenant_fcm_v1( + &self, + _id: &str, + _params: TenantFcmV1UpdateParams, + ) -> Result { + panic!("Shouldn't have run in single tenant mode") + } + async fn update_tenant_apns( &self, _id: &str, diff --git a/tenant_migrations/1713226293_fcm-v1.sql b/tenant_migrations/1713226293_fcm-v1.sql new file mode 100644 index 00000000..958766be --- /dev/null +++ b/tenant_migrations/1713226293_fcm-v1.sql @@ -0,0 +1,2 @@ +ALTER TABLE public.tenants + ADD COLUMN fcm_v1_credentials TEXT NULL DEFAULT NULL; diff --git a/tenant_migrations/README.md b/tenant_migrations/README.md index fc7e1fda..4936e71a 100644 --- a/tenant_migrations/README.md +++ b/tenant_migrations/README.md @@ -8,4 +8,4 @@ This folder contains migrations for Echo Server and they are automatically calle ``` ## Contributors -To create a new migration run `./new.sh [description]` to make a new migration \ No newline at end of file +To create a new migration run `./new.sh [description]` to make a new migration diff --git a/terraform/README.md b/terraform/README.md index 2b7d1cd0..1eefb1a0 100644 --- a/terraform/README.md +++ b/terraform/README.md @@ -94,6 +94,7 @@ No outputs. |------|-------------|------|---------|:--------:| | [azs](#input\_azs) | n/a |
list(string)
|
[
"eu-central-1a",
"eu-central-1b",
"eu-central-1c"
]
| no | | [geoip\_db\_key](#input\_geoip\_db\_key) | The key to the GeoIP database |
string
|
"GeoLite2-City.mmdb"
| no | + | [grafana\_auth](#input\_grafana\_auth) | n/a |
string
|
n/a
| yes | | [grafana\_endpoint](#input\_grafana\_endpoint) | n/a |
string
|
n/a
| yes | | [image\_version](#input\_image\_version) | n/a |
string
|
""
| no | | [jwt\_secret](#input\_jwt\_secret) | n/a |
string
|
n/a
| yes | diff --git a/terraform/provider.tf b/terraform/provider.tf index 0f844f83..965bdb46 100644 --- a/terraform/provider.tf +++ b/terraform/provider.tf @@ -12,9 +12,9 @@ provider "aws" { } } -# Expects GRAFANA_AUTH env variable to be set provider "grafana" { - url = "https://${var.grafana_endpoint}" + url = "https://${var.grafana_endpoint}" + auth = var.grafana_auth } provider "random" {} diff --git a/terraform/variables.tf b/terraform/variables.tf index d71ac65a..8f8c756f 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -17,6 +17,10 @@ variable "grafana_endpoint" { type = string } +variable "grafana_auth" { + type = string +} + variable "image_version" { type = string default = "" diff --git a/tests/context/mod.rs b/tests/context/mod.rs index 8de6596c..9cad39e6 100644 --- a/tests/context/mod.rs +++ b/tests/context/mod.rs @@ -41,7 +41,11 @@ impl TestContext for ConfigContext { log_level_otel: "info,echo-server=trace".into(), disable_header: true, validate_signatures: false, - relay_public_key: env::var("RELAY_PUBLIC_KEY").unwrap_or("none".to_string()), + relay_public_key: env::var("RELAY_PUBLIC_KEY").unwrap_or( + // Default relay public key if env not set + // TODO I don't think this is used in the tests, so this should be refactored/removed + "ff469faa970df23c23a6542765ce8dba2a907538522833b2327a153e365d138e".to_string(), + ), database_url: env::var("DATABASE_URL") .expect("DATABASE_URL environment variable is not set"), tenant_database_url: env::var("TENANT_DATABASE_URL") @@ -66,6 +70,8 @@ impl TestContext for ConfigContext { apns_topic: None, #[cfg(not(feature = "multitenant"))] fcm_api_key: None, + #[cfg(not(feature = "multitenant"))] + fcm_v1_credentials: None, #[cfg(any(feature = "analytics", feature = "geoblock"))] s3_endpoint: None, #[cfg(any(feature = "analytics", feature = "geoblock"))] diff --git a/tests/functional/multitenant/apns.rs b/tests/functional/multitenant/apns.rs index f5432814..da08626e 100644 --- a/tests/functional/multitenant/apns.rs +++ b/tests/functional/multitenant/apns.rs @@ -1,41 +1,26 @@ use { - crate::{context::EchoServerContext, functional::multitenant::ClaimsForValidation}, - echo_server::handlers::create_tenant::TenantRegisterBody, - jsonwebtoken::{encode, EncodingKey, Header}, - random_string::generate, - std::{env, time::SystemTime}, + crate::{context::EchoServerContext, functional::multitenant::generate_random_tenant_id}, + echo_server::{ + handlers::{create_tenant::TenantRegisterBody, get_tenant::GetTenantResponse}, + providers::PROVIDER_APNS, + }, + std::env, test_context::test_context, - uuid::Uuid, }; #[test_context(EchoServerContext)] #[tokio::test] async fn tenant_update_apns_valid_token(ctx: &mut EchoServerContext) { - let tenant_id = Uuid::new_v4().to_string(); - let payload = TenantRegisterBody { - id: tenant_id.clone(), - }; - let unix_timestamp = SystemTime::now() - .duration_since(SystemTime::UNIX_EPOCH) - .unwrap() - .as_secs() as usize; - let token_claims = ClaimsForValidation { - sub: tenant_id.clone(), - exp: unix_timestamp + 60 * 60, // Add an hour for expiration - }; - let jwt_token = encode( - &Header::default(), - &token_claims, - &EncodingKey::from_secret(ctx.config.jwt_secret.as_bytes()), - ) - .expect("Failed to encode jwt token"); + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); // Register new tenant let client = reqwest::Client::new(); let create_tenant_result = client .post(format!("http://{}/tenants", ctx.server.public_addr)) - .header("AUTHORIZATION", jwt_token.clone()) - .json(&payload) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) .send() .await .expect("Failed to create a new tenant"); @@ -60,9 +45,9 @@ async fn tenant_update_apns_valid_token(ctx: &mut EchoServerContext) { let apns_update_result = client .post(format!( "http://{}/tenants/{}/apns", - ctx.server.public_addr, &tenant_id + ctx.server.public_addr, tenant_id )) - .header("AUTHORIZATION", jwt_token.clone()) + .bearer_auth(&jwt_token) .multipart(form) .send() .await @@ -70,20 +55,83 @@ async fn tenant_update_apns_valid_token(ctx: &mut EchoServerContext) { assert_eq!(apns_update_result.status(), reqwest::StatusCode::OK); } +#[test_context(EchoServerContext)] +#[tokio::test] +async fn tenant_enabled_providers(ctx: &mut EchoServerContext) { + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); + + // Register new tenant + let client = reqwest::Client::new(); + let create_tenant_result = client + .post(format!("http://{}/tenants", ctx.server.public_addr)) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) + .send() + .await + .expect("Failed to create a new tenant"); + assert_eq!(create_tenant_result.status(), reqwest::StatusCode::OK); + + // Send valid APNS p8 Key + let form = reqwest::multipart::Form::new() + .text("apns_type", "token") + .text("apns_topic", "app.test") + .text("apns_key_id", env::var("ECHO_TEST_APNS_P8_KEY_ID").unwrap()) + .text( + "apns_team_id", + env::var("ECHO_TEST_APNS_P8_TEAM_ID").unwrap(), + ) + .part( + "apns_pkcs8_pem", + reqwest::multipart::Part::text(env::var("ECHO_TEST_APNS_P8_PEM").unwrap()) + .file_name("apns.p8") + .mime_str("text/plain") + .expect("Error on passing multipart stream to the form request"), + ); + let apns_update_result = client + .post(format!( + "http://{}/tenants/{}/apns", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .multipart(form) + .send() + .await + .expect("Failed to call update tenant endpoint"); + assert_eq!(apns_update_result.status(), reqwest::StatusCode::OK); + + // Get tenant + let response = client + .get(format!( + "http://{}/tenants/{}", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .send() + .await + .expect("Call failed"); + assert!(response.status().is_success()); + let response = response.json::().await.unwrap(); + println!("response: {response:?}"); + assert!(response + .enabled_providers + .contains(&PROVIDER_APNS.to_owned())); +} + #[test_context(EchoServerContext)] #[tokio::test] async fn tenant_update_apns_bad_token(ctx: &mut EchoServerContext) { - let charset = "1234567890"; - let random_tenant_id = generate(12, charset); - let payload = TenantRegisterBody { - id: random_tenant_id.clone(), - }; + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); // Register tenant let client = reqwest::Client::new(); client .post(format!("http://{}/tenants", ctx.server.public_addr)) - .json(&payload) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) .send() .await .expect("Call failed"); @@ -97,8 +145,9 @@ async fn tenant_update_apns_bad_token(ctx: &mut EchoServerContext) { let response = client .post(format!( "http://{}/tenants/{}/apns", - ctx.server.public_addr, &random_tenant_id + ctx.server.public_addr, tenant_id )) + .bearer_auth(&jwt_token) .multipart(form) .send() .await @@ -110,17 +159,16 @@ async fn tenant_update_apns_bad_token(ctx: &mut EchoServerContext) { #[test_context(EchoServerContext)] #[tokio::test] async fn tenant_update_apns_bad_certificate(ctx: &mut EchoServerContext) { - let charset = "1234567890"; - let random_tenant_id = generate(12, charset); - let payload = TenantRegisterBody { - id: random_tenant_id.clone(), - }; + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); // Register tenant let client = reqwest::Client::new(); client .post(format!("http://{}/tenants", ctx.server.public_addr)) - .json(&payload) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) .send() .await .expect("Call failed"); @@ -133,8 +181,9 @@ async fn tenant_update_apns_bad_certificate(ctx: &mut EchoServerContext) { let response = client .post(format!( "http://{}/tenants/{}/apns", - ctx.server.public_addr, &random_tenant_id + ctx.server.public_addr, tenant_id )) + .bearer_auth(&jwt_token) .multipart(form) .send() .await diff --git a/tests/functional/multitenant/fcm.rs b/tests/functional/multitenant/fcm.rs index 6ecd694f..5f865dfd 100644 --- a/tests/functional/multitenant/fcm.rs +++ b/tests/functional/multitenant/fcm.rs @@ -1,41 +1,26 @@ use { - crate::{context::EchoServerContext, functional::multitenant::ClaimsForValidation}, - echo_server::handlers::create_tenant::TenantRegisterBody, - jsonwebtoken::{encode, EncodingKey, Header}, - random_string::generate, - std::{env, time::SystemTime}, + crate::{context::EchoServerContext, functional::multitenant::generate_random_tenant_id}, + echo_server::{ + handlers::{create_tenant::TenantRegisterBody, get_tenant::GetTenantResponse}, + providers::PROVIDER_FCM, + }, + std::env, test_context::test_context, }; #[test_context(EchoServerContext)] #[tokio::test] async fn tenant_update_fcm_valid(ctx: &mut EchoServerContext) { - let charset = "1234567890"; - let random_tenant_id = generate(12, charset); - let payload = TenantRegisterBody { - id: random_tenant_id.clone(), - }; - let unix_timestamp = SystemTime::now() - .duration_since(SystemTime::UNIX_EPOCH) - .unwrap() - .as_secs() as usize; - let token_claims = ClaimsForValidation { - sub: random_tenant_id.clone(), - exp: unix_timestamp + 60 * 60, // Add an hour for expiration - }; - let jwt_token = encode( - &Header::default(), - &token_claims, - &EncodingKey::from_secret(ctx.config.jwt_secret.as_bytes()), - ) - .expect("Failed to encode jwt token"); + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); // Register tenant let client = reqwest::Client::new(); let register_response = client .post(format!("http://{}/tenants", ctx.server.public_addr)) - .json(&payload) - .header("AUTHORIZATION", jwt_token.clone()) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) .send() .await .expect("Call failed"); @@ -48,9 +33,9 @@ async fn tenant_update_fcm_valid(ctx: &mut EchoServerContext) { let response_fcm_update = client .post(format!( "http://{}/tenants/{}/fcm", - ctx.server.public_addr, &random_tenant_id + ctx.server.public_addr, tenant_id )) - .header("AUTHORIZATION", jwt_token.clone()) + .bearer_auth(&jwt_token) .multipart(form) .send() .await @@ -58,20 +43,71 @@ async fn tenant_update_fcm_valid(ctx: &mut EchoServerContext) { assert_eq!(response_fcm_update.status(), reqwest::StatusCode::OK); } +#[test_context(EchoServerContext)] +#[tokio::test] +async fn tenant_enabled_providers(ctx: &mut EchoServerContext) { + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); + + // Register tenant + let client = reqwest::Client::new(); + let register_response = client + .post(format!("http://{}/tenants", ctx.server.public_addr)) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) + .send() + .await + .expect("Call failed"); + assert_eq!(register_response.status(), reqwest::StatusCode::OK); + + // Send valid API Key + let api_key = env::var("ECHO_TEST_FCM_KEY").unwrap(); + let form = reqwest::multipart::Form::new().text("api_key", api_key); + + let response_fcm_update = client + .post(format!( + "http://{}/tenants/{}/fcm", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .multipart(form) + .send() + .await + .expect("Call failed"); + assert_eq!(response_fcm_update.status(), reqwest::StatusCode::OK); + + // Get tenant + let response = client + .get(format!( + "http://{}/tenants/{}", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .send() + .await + .expect("Call failed"); + assert!(response.status().is_success()); + let response = response.json::().await.unwrap(); + println!("response: {response:?}"); + assert!(response + .enabled_providers + .contains(&PROVIDER_FCM.to_owned())); +} + #[test_context(EchoServerContext)] #[tokio::test] async fn tenant_update_fcm_bad(ctx: &mut EchoServerContext) { - let charset = "1234567890"; - let random_tenant_id = generate(12, charset); - let payload = TenantRegisterBody { - id: random_tenant_id.clone(), - }; + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); // Register tenant let client = reqwest::Client::new(); client .post(format!("http://{}/tenants", ctx.server.public_addr)) - .json(&payload) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) .send() .await .expect("Call failed"); @@ -82,8 +118,9 @@ async fn tenant_update_fcm_bad(ctx: &mut EchoServerContext) { let response = client .post(format!( "http://{}/tenants/{}/fcm", - ctx.server.public_addr, &random_tenant_id + ctx.server.public_addr, tenant_id )) + .bearer_auth(&jwt_token) .multipart(form) .send() .await diff --git a/tests/functional/multitenant/fcm_v1.rs b/tests/functional/multitenant/fcm_v1.rs new file mode 100644 index 00000000..2ee94d67 --- /dev/null +++ b/tests/functional/multitenant/fcm_v1.rs @@ -0,0 +1,179 @@ +use { + crate::{context::EchoServerContext, functional::multitenant::generate_random_tenant_id}, + echo_server::{ + handlers::{create_tenant::TenantRegisterBody, get_tenant::GetTenantResponse}, + providers::PROVIDER_FCM_V1, + }, + std::env, + test_context::test_context, +}; + +#[test_context(EchoServerContext)] +#[tokio::test] +async fn tenant_update_fcm_v1_valid(ctx: &mut EchoServerContext) { + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); + + // Register tenant + let client = reqwest::Client::new(); + let register_response = client + .post(format!("http://{}/tenants", ctx.server.public_addr)) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) + .send() + .await + .expect("Call failed"); + assert_eq!(register_response.status(), reqwest::StatusCode::OK); + + // Send valid API Key + let credentials = env::var("ECHO_TEST_FCM_V1_CREDENTIALS").unwrap(); + let form = reqwest::multipart::Form::new().text("credentials", credentials); + + let response_fcm_update = client + .post(format!( + "http://{}/tenants/{}/fcm_v1", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .multipart(form) + .send() + .await + .expect("Call failed"); + assert_eq!(response_fcm_update.status(), reqwest::StatusCode::OK); +} + +#[test_context(EchoServerContext)] +#[tokio::test] +async fn tenant_enabled_providers(ctx: &mut EchoServerContext) { + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); + + // Register tenant + let client = reqwest::Client::new(); + let register_response = client + .post(format!("http://{}/tenants", ctx.server.public_addr)) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) + .send() + .await + .expect("Call failed"); + assert_eq!(register_response.status(), reqwest::StatusCode::OK); + + // Send valid API Key + let credentials = env::var("ECHO_TEST_FCM_V1_CREDENTIALS").unwrap(); + let form = reqwest::multipart::Form::new().text("credentials", credentials); + + let response_fcm_update = client + .post(format!( + "http://{}/tenants/{}/fcm_v1", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .multipart(form) + .send() + .await + .expect("Call failed"); + assert_eq!(response_fcm_update.status(), reqwest::StatusCode::OK); + + // Get tenant + let response = client + .get(format!( + "http://{}/tenants/{}", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .send() + .await + .expect("Call failed"); + assert!(response.status().is_success()); + let response = response.json::().await.unwrap(); + println!("response: {response:?}"); + assert!(response + .enabled_providers + .contains(&PROVIDER_FCM_V1.to_owned())); +} + +#[test_context(EchoServerContext)] +#[tokio::test] +async fn tenant_update_fcm_v1_wrong_format(ctx: &mut EchoServerContext) { + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); + + // Register tenant + let client = reqwest::Client::new(); + client + .post(format!("http://{}/tenants", ctx.server.public_addr)) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) + .send() + .await + .expect("Call failed"); + + // Send invalid API Key + let form = reqwest::multipart::Form::new().text("credentials", "invalid-key"); + + let response = client + .post(format!( + "http://{}/tenants/{}/fcm_v1", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .multipart(form) + .send() + .await + .expect("Call failed"); + + assert!(!response.status().is_success(), "Response was successful"); +} + +#[test_context(EchoServerContext)] +#[tokio::test] +async fn tenant_update_fcm_v1_invalidated(ctx: &mut EchoServerContext) { + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); + + // Register tenant + let client = reqwest::Client::new(); + client + .post(format!("http://{}/tenants", ctx.server.public_addr)) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) + .send() + .await + .expect("Call failed"); + + // Revoked key + let credentials = r#" + { + "type": "service_account", + "project_id": "push-server-tests-cc0f7", + "private_key_id": "2a2d7c139c2d426be391d9003f2687a8f6f1fff2", + "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCeTJvksCrIC3pY\nOqHkIn2L5ZX11GO50pBE65U3Ik99Eh01puRPXitgdJZZIgcJEvSkDwcpq7ieuxe1\nSc35Le+STr8YM62Clp7KBIaTW4yiLxIN0PuLCgMBnTHKrcxwzCTOCog9rlYdGOj8\nnLd69FA9GUPiYvT+HToKRonm1N3kcAVLeUBj6z48qf4PxHAu0dpuGTfMcUUZfPZc\no6BXGrf2+eMTz0j7W6MCnpK1uVQu3rxjrvW2POgdHu31OvH9IAr8+CPuI3CTn/NF\n//uJOSYJmwysGyB/Fa6UqmCjd9u9VXLxOuIMOHXt54OegCuwb8/Y0GNZK4RBc4TS\nmAFramKvAgMBAAECggEAAupu5c8sUWpm/jdT+TJYS/FfgOSKCbVVLvRf6c6jH5yi\nqRl5AWL1zZQqdoAez1ce5nWPQsmE8neIUkLPwd05UCqWAxKuUqG9UUz9wQP0GueD\nn54Y9lCpwF63b8kiB75tKWiw03RPeAkqSFF08yevvPTwLbwumenvVJrWTJFOnQEa\noC4HCPXKNck2LDgnrfSynjYxhrICfXKwZ1Uhl8YYP5iSRf242nGjTyh2FwCM5nqx\nHbk3q/9RCb1VJoDBuSN7AcGm1mipqeJz5fTIGxAXcV0CJrkw3Betl0FYddj5Mc9I\n+koZf2HZbNkB4gF0SqnAakp3hNNqUOiFJPhavC4RoQKBgQDdbgmdUk+NyH57RDgx\nOSchoWgPVYLnQ9ZyDxXnxhzxdMPIDhKcCQpMEo7NR3SyzxcJNibDu3PeeAE5cw1L\n3nd2rFAdPUtSEnVgGxVN0hqAKWKfkCLtwOVznuilQVd1Px+4WJPJmsjQNWWWoGWE\nDcNEyg1lAhD4kiPHLrMPVea5CQKBgQC3A2jlY5h43CWU6Vmc2nEZQCEBYE7CShmc\np/6WvvxwDJxZ+qZR5xCPDwMV1Buw6N1LuGXoSOu4C9yP4qj3NrNVdiTmn/wI4OBl\nZQ/O5FcDHvVVO37cXrP2mKvMKBQfIbSu7oZrzlctyHj8KwWghXWpKai8sAk3dEyz\nNJKK9vzD9wKBgBnLAY+z0NSBMEqHjcweDjLarFZs7Yym2En8+949s41kvpGFIiHO\n48YsuzmqQyu498P47NcL9NlLPUlF35yg02WdeM+PHkD3KXkCbp7cBH49U+GmVos/\nVvr63bqyO8/KhJVirARl5VJrhePf1zNkrwRKTPkhHnz1+PjwtabpqLCRAoGANUL/\nxyqaGCpxoYnb86M7IQ8hy+W8ZhzsoUPe+v4wN2fkJOemedWWYxwKWNL3ECBlLwFG\nXzjBqTmCgjmD1RaNUITmrlvHHMpdZATqedrIW/cpjRmYjQfethiufub3HCxSCksO\nwdc2VfOvCix3IcVVfdrK6ccNl574J3tYXqsM2vcCgYBQKIHoaMfig1C7K6GVj04t\n7L5+hGoGkV3tbarWlN2f3fy+E8N8jNF0zcyy3DNy+nte8L525wV40rv0iUY7UUOD\nEYtL9cKJiAMVHBrmcxYYSKamDokUNYdbL6G/BiyAutDu5dvG/coVhY2DtlpUBuc6\nEZ5GAEY7kywLFZNd54/I2w==\n-----END PRIVATE KEY-----\n", + "client_email": "firebase-adminsdk-eyh3f@push-server-tests-cc0f7.iam.gserviceaccount.com", + "client_id": "102142178126793688289", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", + "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-eyh3f%40push-server-tests-cc0f7.iam.gserviceaccount.com", + "universe_domain": "googleapis.com" + } + "#; + let form = reqwest::multipart::Form::new().text("credentials", credentials); + + let response = client + .post(format!( + "http://{}/tenants/{}/fcm_v1", + ctx.server.public_addr, tenant_id + )) + .bearer_auth(&jwt_token) + .multipart(form) + .send() + .await + .expect("Call failed"); + + assert!(!response.status().is_success(), "Response was successful"); +} diff --git a/tests/functional/multitenant/mod.rs b/tests/functional/multitenant/mod.rs index 40325b35..aec2ffa6 100644 --- a/tests/functional/multitenant/mod.rs +++ b/tests/functional/multitenant/mod.rs @@ -1,8 +1,18 @@ -/// Tests against the handlers -use {crate::context::EchoServerContext, serde::Serialize, test_context::test_context}; +use { + crate::context::EchoServerContext, + jsonwebtoken::{encode, EncodingKey, Header}, + random_string::generate, + serde::Serialize, + std::time::SystemTime, + test_context::test_context, +}; +#[cfg(feature = "apns_tests")] mod apns; +#[cfg(feature = "fcm_tests")] mod fcm; +#[cfg(feature = "fcmv1_tests")] +mod fcm_v1; mod tenancy; /// Struct to hold claims for JWT validation @@ -21,3 +31,23 @@ async fn test_health(ctx: &mut EchoServerContext) { .status(); assert!(body.is_success()); } + +pub fn generate_random_tenant_id(jwt_secret: &str) -> (String, String) { + let charset = "1234567890"; + let tenant_id = generate(12, charset); + let unix_timestamp = SystemTime::now() + .duration_since(SystemTime::UNIX_EPOCH) + .unwrap() + .as_secs() as usize; + let token_claims = ClaimsForValidation { + sub: tenant_id.clone(), + exp: unix_timestamp + 60 * 60, // Add an hour for expiration + }; + let jwt_token = encode( + &Header::default(), + &token_claims, + &EncodingKey::from_secret(jwt_secret.as_bytes()), + ) + .expect("Failed to encode jwt token"); + (tenant_id, jwt_token) +} diff --git a/tests/functional/multitenant/tenancy.rs b/tests/functional/multitenant/tenancy.rs index e5bf7abf..614fbb91 100644 --- a/tests/functional/multitenant/tenancy.rs +++ b/tests/functional/multitenant/tenancy.rs @@ -1,41 +1,22 @@ use { - crate::{context::EchoServerContext, functional::multitenant::ClaimsForValidation}, + crate::{context::EchoServerContext, functional::multitenant::generate_random_tenant_id}, echo_server::handlers::create_tenant::TenantRegisterBody, - jsonwebtoken::{encode, EncodingKey, Header}, - random_string::generate, - std::time::SystemTime, test_context::test_context, }; #[test_context(EchoServerContext)] #[tokio::test] async fn tenant_register_get_delete(ctx: &mut EchoServerContext) { - let charset = "1234567890"; - let random_tenant_id = generate(12, charset); - let payload = TenantRegisterBody { - id: random_tenant_id.clone(), - }; - let unix_timestamp = SystemTime::now() - .duration_since(SystemTime::UNIX_EPOCH) - .unwrap() - .as_secs() as usize; - let token_claims = ClaimsForValidation { - sub: random_tenant_id.clone(), - exp: unix_timestamp + 60 * 60, // Add an hour for expiration - }; - let jwt_token = encode( - &Header::default(), - &token_claims, - &EncodingKey::from_secret(ctx.config.jwt_secret.as_bytes()), - ) - .expect("Failed to encode jwt token"); + let (tenant_id, jwt_token) = generate_random_tenant_id(&ctx.config.jwt_secret); // Register tenant let client = reqwest::Client::new(); let response = client .post(format!("http://{}/tenants", ctx.server.public_addr)) - .json(&payload) - .header("AUTHORIZATION", jwt_token.clone()) + .bearer_auth(&jwt_token) + .json(&TenantRegisterBody { + id: tenant_id.clone(), + }) .send() .await .expect("Call failed"); @@ -45,10 +26,9 @@ async fn tenant_register_get_delete(ctx: &mut EchoServerContext) { let response = client .get(format!( "http://{}/tenants/{}", - ctx.server.public_addr, - random_tenant_id.clone() + ctx.server.public_addr, tenant_id )) - .header("AUTHORIZATION", jwt_token.clone()) + .bearer_auth(&jwt_token) .send() .await .expect("Call failed"); @@ -68,10 +48,9 @@ async fn tenant_register_get_delete(ctx: &mut EchoServerContext) { let response = client .delete(format!( "http://{}/tenants/{}", - ctx.server.public_addr, - random_tenant_id.clone() + ctx.server.public_addr, tenant_id )) - .header("AUTHORIZATION", jwt_token.clone()) + .bearer_auth(&jwt_token) .send() .await .expect("Call failed"); @@ -81,10 +60,9 @@ async fn tenant_register_get_delete(ctx: &mut EchoServerContext) { let response = client .get(format!( "http://{}/tenants/{}", - ctx.server.public_addr, - random_tenant_id.clone() + ctx.server.public_addr, tenant_id )) - .header("AUTHORIZATION", jwt_token.clone()) + .bearer_auth(&jwt_token) .send() .await .expect("Call failed"); diff --git a/tests/functional/stores/tenant.rs b/tests/functional/stores/tenant.rs index 08701c29..a1c82833 100644 --- a/tests/functional/stores/tenant.rs +++ b/tests/functional/stores/tenant.rs @@ -1,7 +1,8 @@ use { crate::context::StoreContext, echo_server::stores::tenant::{ - TenantApnsUpdateAuth, TenantApnsUpdateParams, TenantFcmUpdateParams, TenantUpdateParams, + TenantApnsUpdateAuth, TenantApnsUpdateParams, TenantFcmUpdateParams, + TenantFcmV1UpdateParams, TenantUpdateParams, }, test_context::test_context, uuid::Uuid, @@ -82,6 +83,30 @@ async fn tenant_fcm(ctx: &mut StoreContext) { assert!(res.is_ok()) } +#[test_context(StoreContext)] +#[tokio::test] +async fn tenant_fcm_v1(ctx: &mut StoreContext) { + let tenant = ctx + .tenants + .create_tenant(TenantUpdateParams { + id: Uuid::new_v4().to_string(), + }) + .await + .expect("creation failed"); + + let res = ctx + .tenants + .update_tenant_fcm_v1( + &tenant.id, + TenantFcmV1UpdateParams { + fcm_v1_credentials: "test-credentials".to_string(), + }, + ) + .await; + + assert!(res.is_ok()) +} + #[test_context(StoreContext)] #[tokio::test] async fn tenant_apns(ctx: &mut StoreContext) { diff --git a/tests/unit/messages.rs b/tests/unit/messages.rs index cb55082c..8dac370f 100644 --- a/tests/unit/messages.rs +++ b/tests/unit/messages.rs @@ -11,9 +11,6 @@ const EXAMPLE_CLEARTEXT_ENCODED_BLOB: &str = "eyJ0aXRsZSI6IllvdSBoYXZlIGEgc2lnbi // json string const EXAMPLE_CLEARTEXT_BLOB_TITLE: &str = "You have a sign request"; const EXAMPLE_CLEARTEXT_BLOB_BODY: &str = "example-dapp has sent you a request to sign a message"; -const EXAMPLE_CLEARTEXT_BLOB: &str = "{\"title\":\"You have a sign \ - request\",\"body\":\"example-dapp has sent you a request to \ - sign a message\"}"; // This can be any text as echo-server doesn't mutate or read it const EXAMPLE_ENCRYPTED_BLOB: &str = "encrypted-blob"; @@ -77,19 +74,3 @@ pub fn parse_encoded_blob() { } ) } - -#[test] -pub fn parse_blob() { - let blob = DecryptedPayloadBlob::from_json_string(EXAMPLE_CLEARTEXT_BLOB.to_string()) - .expect("Failed to parse blob"); - - assert_eq!( - blob, - DecryptedPayloadBlob { - title: EXAMPLE_CLEARTEXT_BLOB_TITLE.to_string(), - body: EXAMPLE_CLEARTEXT_BLOB_BODY.to_string(), - image: None, - url: None - } - ) -}