mirror of
https://tangled.org/tranquil.farm/tranquil-pds
synced 2026-09-26 04:04:14 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
17b3338b31 |
+33
-9
@@ -53,15 +53,27 @@ heavy-load-tests = { max-threads = 4 }
|
|||||||
io-heavy-sim = { max-threads = 2 }
|
io-heavy-sim = { max-threads = 2 }
|
||||||
|
|
||||||
[[profile.default.overrides]]
|
[[profile.default.overrides]]
|
||||||
filter = "binary(it) and test(/^ripple_cluster::/)"
|
filter = "test(/import_with_verification/) | test(/plc_migration/)"
|
||||||
test-group = "serial-env-tests"
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
[[profile.default.overrides]]
|
[[profile.default.overrides]]
|
||||||
filter = "package(tranquil-signal) and test(/^tests::/)"
|
filter = "binary(handle_domains)"
|
||||||
test-group = "serial-env-tests"
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
[[profile.default.overrides]]
|
[[profile.default.overrides]]
|
||||||
filter = "binary(it) and test(/^whole_story::/)"
|
filter = "binary(ripple_cluster)"
|
||||||
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
|
[[profile.default.overrides]]
|
||||||
|
filter = "package(tranquil-signal)"
|
||||||
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
|
[[profile.default.overrides]]
|
||||||
|
filter = "package(tranquil-config)"
|
||||||
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
|
[[profile.default.overrides]]
|
||||||
|
filter = "binary(whole_story)"
|
||||||
test-group = "heavy-load-tests"
|
test-group = "heavy-load-tests"
|
||||||
|
|
||||||
[[profile.default.overrides]]
|
[[profile.default.overrides]]
|
||||||
@@ -69,7 +81,7 @@ filter = "test(/two_node_stress_concurrent_load/)"
|
|||||||
test-group = "heavy-load-tests"
|
test-group = "heavy-load-tests"
|
||||||
|
|
||||||
[[profile.default.overrides]]
|
[[profile.default.overrides]]
|
||||||
filter = "binary(it) and test(/^repo_lifecycle::/)"
|
filter = "binary(repo_lifecycle)"
|
||||||
test-group = "heavy-load-tests"
|
test-group = "heavy-load-tests"
|
||||||
|
|
||||||
[[profile.default.overrides]]
|
[[profile.default.overrides]]
|
||||||
@@ -91,7 +103,7 @@ filter = "binary(gauntlet_smoke)"
|
|||||||
slow-timeout = { period = "300s", terminate-after = 8 }
|
slow-timeout = { period = "300s", terminate-after = 8 }
|
||||||
|
|
||||||
[[profile.default.overrides]]
|
[[profile.default.overrides]]
|
||||||
filter = "binary(compaction_restart) | binary(mst_refcount_integrity) | binary(it) and test(/^gc_compaction_restart::/)"
|
filter = "binary(compaction_restart) | binary(mst_refcount_integrity) | binary(gc_compaction_restart)"
|
||||||
slow-timeout = { period = "120s", terminate-after = 4 }
|
slow-timeout = { period = "120s", terminate-after = 4 }
|
||||||
|
|
||||||
[[profile.default.overrides]]
|
[[profile.default.overrides]]
|
||||||
@@ -105,15 +117,27 @@ slow-timeout = { period = "300s", terminate-after = 4 }
|
|||||||
test-group = "io-heavy-sim"
|
test-group = "io-heavy-sim"
|
||||||
|
|
||||||
[[profile.ci.overrides]]
|
[[profile.ci.overrides]]
|
||||||
filter = "binary(it) and test(/^ripple_cluster::/)"
|
filter = "test(/import_with_verification/) | test(/plc_migration/)"
|
||||||
test-group = "serial-env-tests"
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
[[profile.ci.overrides]]
|
[[profile.ci.overrides]]
|
||||||
filter = "package(tranquil-signal) and test(/^tests::/)"
|
filter = "binary(handle_domains)"
|
||||||
test-group = "serial-env-tests"
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
[[profile.ci.overrides]]
|
[[profile.ci.overrides]]
|
||||||
filter = "binary(it) and test(/^whole_story::/)"
|
filter = "binary(ripple_cluster)"
|
||||||
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
|
[[profile.ci.overrides]]
|
||||||
|
filter = "package(tranquil-signal)"
|
||||||
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
|
[[profile.ci.overrides]]
|
||||||
|
filter = "package(tranquil-config)"
|
||||||
|
test-group = "serial-env-tests"
|
||||||
|
|
||||||
|
[[profile.ci.overrides]]
|
||||||
|
filter = "binary(whole_story)"
|
||||||
test-group = "heavy-load-tests"
|
test-group = "heavy-load-tests"
|
||||||
|
|
||||||
[[profile.ci.overrides]]
|
[[profile.ci.overrides]]
|
||||||
@@ -121,7 +145,7 @@ filter = "test(/two_node_stress_concurrent_load/)"
|
|||||||
test-group = "heavy-load-tests"
|
test-group = "heavy-load-tests"
|
||||||
|
|
||||||
[[profile.ci.overrides]]
|
[[profile.ci.overrides]]
|
||||||
filter = "binary(it) and test(/^repo_lifecycle::/)"
|
filter = "binary(repo_lifecycle)"
|
||||||
test-group = "heavy-load-tests"
|
test-group = "heavy-load-tests"
|
||||||
|
|
||||||
[[profile.ci.overrides]]
|
[[profile.ci.overrides]]
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
when:
|
|
||||||
- event: ["push", "pull_request"]
|
|
||||||
branch: ["main"]
|
|
||||||
|
|
||||||
engine: microvm
|
|
||||||
image: nixos
|
|
||||||
|
|
||||||
environment:
|
|
||||||
CARGO_INCREMENTAL: "0"
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
- rustup
|
|
||||||
- gcc
|
|
||||||
- pkg-config
|
|
||||||
- openssl
|
|
||||||
- protobuf
|
|
||||||
- just
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: fmt
|
|
||||||
command: cargo fmt -- --check
|
|
||||||
- name: check
|
|
||||||
command: cargo check --all-targets
|
|
||||||
- name: clippy
|
|
||||||
command: just clippy
|
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
when:
|
||||||
|
- event: ["push", "manual"]
|
||||||
|
branch: ["main"]
|
||||||
|
|
||||||
|
engine: nixery
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
nixpkgs:
|
||||||
|
- nix
|
||||||
|
- cachix
|
||||||
|
- gnugrep
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Authenticate
|
||||||
|
command: |
|
||||||
|
cachix authtoken "$CACHIX_AUTH_TOKEN"
|
||||||
|
|
||||||
|
- name: Build and push aarch64
|
||||||
|
command: |
|
||||||
|
SUBS="--option extra-substituters https://tranquil.cachix.org --option extra-trusted-public-keys tranquil.cachix.org-1:PoO+mGL6a6LcJiPakMDHN4E218/ei/7v2sxeDtNkSRg="
|
||||||
|
nix-store -qR --include-outputs $(nix-store -qd $(nix build .#packages.x86_64-linux.tranquil-pds-aarch64 $SUBS --print-out-paths --no-link)) | grep -v '\.drv$' | cachix push tranquil
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
when:
|
||||||
|
- event: ["push", "manual"]
|
||||||
|
branch: ["main"]
|
||||||
|
|
||||||
|
engine: nixery
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
nixpkgs:
|
||||||
|
- nix
|
||||||
|
- cachix
|
||||||
|
- gnugrep
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Authenticate
|
||||||
|
command: |
|
||||||
|
cachix authtoken "$CACHIX_AUTH_TOKEN"
|
||||||
|
|
||||||
|
- name: Build and push x86_64
|
||||||
|
command: |
|
||||||
|
SUBS="--option extra-substituters https://tranquil.cachix.org --option extra-trusted-public-keys tranquil.cachix.org-1:PoO+mGL6a6LcJiPakMDHN4E218/ei/7v2sxeDtNkSRg="
|
||||||
|
nix-store -qR --include-outputs $(nix-store -qd $(nix build .#packages.x86_64-linux.tranquil-pds $SUBS --print-out-paths --no-link)) | grep -v '\.drv$' | cachix push tranquil
|
||||||
|
nix-store -qR --include-outputs $(nix-store -qd $(nix build .#packages.x86_64-linux.tranquil-frontend $SUBS --print-out-paths --no-link)) | grep -v '\.drv$' | cachix push tranquil
|
||||||
|
|
||||||
|
- name: Build and push devShell
|
||||||
|
command: |
|
||||||
|
SUBS="--option extra-substituters https://tranquil.cachix.org --option extra-trusted-public-keys tranquil.cachix.org-1:PoO+mGL6a6LcJiPakMDHN4E218/ei/7v2sxeDtNkSRg="
|
||||||
|
nix develop $SUBS --profile dev-profile -c true
|
||||||
|
cachix push tranquil dev-profile
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
when:
|
||||||
|
- event: [ "manual" ]
|
||||||
|
- event: [ "push" ]
|
||||||
|
branch: [ "main" ]
|
||||||
|
|
||||||
|
engine: nixery
|
||||||
|
|
||||||
|
dependencies:
|
||||||
|
nixpkgs:
|
||||||
|
- kaniko
|
||||||
|
|
||||||
|
environment:
|
||||||
|
DOCKER_CONFIG: "/kaniko/.docker"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Configure Kaniko
|
||||||
|
command: |
|
||||||
|
mkdir -p /kaniko/.docker/
|
||||||
|
echo "{
|
||||||
|
\"auths\": {
|
||||||
|
\"https://atcr.io/v1\":{
|
||||||
|
\"auth\": \"$ATCR_CREDENTIALS\"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}" > /kaniko/.docker/config.json
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
command: |
|
||||||
|
executor \
|
||||||
|
--context=$(pwd) \
|
||||||
|
--ignore-path=$(pwd) \
|
||||||
|
--dockerfile=$(pwd)/Dockerfile \
|
||||||
|
--destination="atcr.io/tranquil.farm/tranquil-pds:latest" \
|
||||||
|
--destination="atcr.io/tranquil.farm/tranquil-pds:$TANGLED_COMMIT_SHA" \
|
||||||
|
--push-retry=3 \
|
||||||
|
--skip-push-permission-check
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
when:
|
|
||||||
- event: ["push", "pull_request"]
|
|
||||||
branch: ["main"]
|
|
||||||
|
|
||||||
engine: microvm
|
|
||||||
image: nixos
|
|
||||||
|
|
||||||
environment:
|
|
||||||
CARGO_INCREMENTAL: "0"
|
|
||||||
CARGO_PROFILE_DEV_DEBUG: "0"
|
|
||||||
CARGO_PROFILE_TEST_DEBUG: "0"
|
|
||||||
TMPDIR: "/dev/shm"
|
|
||||||
|
|
||||||
dependencies:
|
|
||||||
- rustup
|
|
||||||
- gcc
|
|
||||||
- pkg-config
|
|
||||||
- openssl
|
|
||||||
- protobuf
|
|
||||||
- just
|
|
||||||
- cargo-nextest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: test
|
|
||||||
command: just test
|
|
||||||
Generated
+206
-70
@@ -462,6 +462,28 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aws-lc-rs"
|
||||||
|
version = "1.16.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "a054912289d18629dc78375ba2c3726a3afe3ff71b4edba9dedfca0e3446d1fc"
|
||||||
|
dependencies = [
|
||||||
|
"aws-lc-sys",
|
||||||
|
"zeroize",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "aws-lc-sys"
|
||||||
|
version = "0.39.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "1fa7e52a4c5c547c741610a2c6f123f3881e409b714cd27e6798ef020c514f0a"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
"cmake",
|
||||||
|
"dunce",
|
||||||
|
"fs_extra",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aws-runtime"
|
name = "aws-runtime"
|
||||||
version = "1.7.2"
|
version = "1.7.2"
|
||||||
@@ -719,17 +741,23 @@ dependencies = [
|
|||||||
"aws-smithy-async",
|
"aws-smithy-async",
|
||||||
"aws-smithy-runtime-api",
|
"aws-smithy-runtime-api",
|
||||||
"aws-smithy-types",
|
"aws-smithy-types",
|
||||||
"h2",
|
"h2 0.3.27",
|
||||||
|
"h2 0.4.13",
|
||||||
|
"http 0.2.12",
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"hyper",
|
"http-body 0.4.6",
|
||||||
"hyper-rustls",
|
"hyper 0.14.32",
|
||||||
|
"hyper 1.8.1",
|
||||||
|
"hyper-rustls 0.24.2",
|
||||||
|
"hyper-rustls 0.27.7",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rustls",
|
"rustls 0.21.12",
|
||||||
|
"rustls 0.23.37",
|
||||||
"rustls-native-certs",
|
"rustls-native-certs",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls",
|
"tokio-rustls 0.26.4",
|
||||||
"tower",
|
"tower",
|
||||||
"tracing",
|
"tracing",
|
||||||
]
|
]
|
||||||
@@ -779,6 +807,7 @@ checksum = "028999056d2d2fd58a697232f9eec4a643cf73a71cf327690a7edad1d2af2110"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"aws-smithy-async",
|
"aws-smithy-async",
|
||||||
"aws-smithy-http 0.63.6",
|
"aws-smithy-http 0.63.6",
|
||||||
|
"aws-smithy-http-client",
|
||||||
"aws-smithy-observability",
|
"aws-smithy-observability",
|
||||||
"aws-smithy-runtime-api",
|
"aws-smithy-runtime-api",
|
||||||
"aws-smithy-types",
|
"aws-smithy-types",
|
||||||
@@ -876,7 +905,7 @@ dependencies = [
|
|||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"http-body 1.0.1",
|
"http-body 1.0.1",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"itoa",
|
"itoa",
|
||||||
"matchit",
|
"matchit",
|
||||||
@@ -1143,16 +1172,16 @@ dependencies = [
|
|||||||
"home",
|
"home",
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-named-pipe",
|
"hyper-named-pipe",
|
||||||
"hyper-rustls",
|
"hyper-rustls 0.27.7",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"hyperlocal",
|
"hyperlocal",
|
||||||
"log",
|
"log",
|
||||||
"num",
|
"num",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"rand 0.9.2",
|
"rand 0.9.2",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"rustls-native-certs",
|
"rustls-native-certs",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
@@ -1364,6 +1393,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423"
|
checksum = "7a0dd1ca384932ff3641c8718a02769f1698e7563dc6974ffd03346116310423"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"find-msvc-tools",
|
"find-msvc-tools",
|
||||||
|
"jobserver",
|
||||||
|
"libc",
|
||||||
"shlex",
|
"shlex",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -1516,6 +1547,15 @@ version = "1.1.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
|
checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cmake"
|
||||||
|
version = "0.1.57"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d"
|
||||||
|
dependencies = [
|
||||||
|
"cc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cobs"
|
name = "cobs"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
@@ -1606,21 +1646,6 @@ dependencies = [
|
|||||||
"syn 2.0.117",
|
"syn 2.0.117",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "conquer-once"
|
|
||||||
version = "0.4.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5d008a441c0f269f36ca13712528069a86a3e60dffee1d98b976eb3b0b2160b4"
|
|
||||||
dependencies = [
|
|
||||||
"conquer-util",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "conquer-util"
|
|
||||||
version = "0.3.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "e763eef8846b13b380f37dfecda401770b0ca4e56e95170237bd7c25c7db3582"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "const-oid"
|
name = "const-oid"
|
||||||
version = "0.9.6"
|
version = "0.9.6"
|
||||||
@@ -2165,6 +2190,12 @@ version = "0.0.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5"
|
checksum = "f678cf4a922c215c63e0de95eb1ff08a958a81d47e485cf9da1e27bf6305cfa5"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "dunce"
|
||||||
|
version = "1.0.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "dyn-clone"
|
name = "dyn-clone"
|
||||||
version = "1.0.20"
|
version = "1.0.20"
|
||||||
@@ -2569,6 +2600,12 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "fs_extra"
|
||||||
|
version = "1.3.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "futures"
|
name = "futures"
|
||||||
version = "0.3.32"
|
version = "0.3.32"
|
||||||
@@ -2816,6 +2853,7 @@ dependencies = [
|
|||||||
"nonzero_ext",
|
"nonzero_ext",
|
||||||
"parking_lot",
|
"parking_lot",
|
||||||
"portable-atomic",
|
"portable-atomic",
|
||||||
|
"quanta",
|
||||||
"rand 0.9.2",
|
"rand 0.9.2",
|
||||||
"smallvec",
|
"smallvec",
|
||||||
"spinning_top",
|
"spinning_top",
|
||||||
@@ -2844,6 +2882,25 @@ dependencies = [
|
|||||||
"subtle",
|
"subtle",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "h2"
|
||||||
|
version = "0.3.27"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "0beca50380b1fc32983fc1cb4587bfa4bb9e78fc259aad4a0032d2080309222d"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"fnv",
|
||||||
|
"futures-core",
|
||||||
|
"futures-sink",
|
||||||
|
"futures-util",
|
||||||
|
"http 0.2.12",
|
||||||
|
"indexmap 2.13.0",
|
||||||
|
"slab",
|
||||||
|
"tokio",
|
||||||
|
"tokio-util",
|
||||||
|
"tracing",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "h2"
|
name = "h2"
|
||||||
version = "0.4.13"
|
version = "0.4.13"
|
||||||
@@ -3202,6 +3259,30 @@ version = "1.0.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hyper"
|
||||||
|
version = "0.14.32"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7"
|
||||||
|
dependencies = [
|
||||||
|
"bytes",
|
||||||
|
"futures-channel",
|
||||||
|
"futures-core",
|
||||||
|
"futures-util",
|
||||||
|
"h2 0.3.27",
|
||||||
|
"http 0.2.12",
|
||||||
|
"http-body 0.4.6",
|
||||||
|
"httparse",
|
||||||
|
"httpdate",
|
||||||
|
"itoa",
|
||||||
|
"pin-project-lite",
|
||||||
|
"socket2 0.5.10",
|
||||||
|
"tokio",
|
||||||
|
"tower-service",
|
||||||
|
"tracing",
|
||||||
|
"want",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyper"
|
name = "hyper"
|
||||||
version = "1.8.1"
|
version = "1.8.1"
|
||||||
@@ -3212,7 +3293,7 @@ dependencies = [
|
|||||||
"bytes",
|
"bytes",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"h2",
|
"h2 0.4.13",
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"http-body 1.0.1",
|
"http-body 1.0.1",
|
||||||
"httparse",
|
"httparse",
|
||||||
@@ -3232,7 +3313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278"
|
checksum = "73b7d8abf35697b81a825e386fc151e0d503e8cb5fcb93cc8669c376dfd6f278"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hex",
|
"hex",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tokio",
|
"tokio",
|
||||||
@@ -3240,6 +3321,21 @@ dependencies = [
|
|||||||
"winapi",
|
"winapi",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "hyper-rustls"
|
||||||
|
version = "0.24.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590"
|
||||||
|
dependencies = [
|
||||||
|
"futures-util",
|
||||||
|
"http 0.2.12",
|
||||||
|
"hyper 0.14.32",
|
||||||
|
"log",
|
||||||
|
"rustls 0.21.12",
|
||||||
|
"tokio",
|
||||||
|
"tokio-rustls 0.24.1",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyper-rustls"
|
name = "hyper-rustls"
|
||||||
version = "0.27.7"
|
version = "0.27.7"
|
||||||
@@ -3247,13 +3343,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
|
checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"rustls-native-certs",
|
"rustls-native-certs",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls",
|
"tokio-rustls 0.26.4",
|
||||||
"tower-service",
|
"tower-service",
|
||||||
"webpki-roots 1.0.6",
|
"webpki-roots 1.0.6",
|
||||||
]
|
]
|
||||||
@@ -3264,7 +3360,7 @@ version = "0.5.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0"
|
checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tokio",
|
"tokio",
|
||||||
@@ -3283,7 +3379,7 @@ dependencies = [
|
|||||||
"futures-util",
|
"futures-util",
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"http-body 1.0.1",
|
"http-body 1.0.1",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"ipnet",
|
"ipnet",
|
||||||
"libc",
|
"libc",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
@@ -3304,7 +3400,7 @@ checksum = "986c5ce3b994526b3cd75578e62554abd09f0899d6206de48b3e96ab34ccc8c7"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"hex",
|
"hex",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"tokio",
|
"tokio",
|
||||||
@@ -3731,6 +3827,16 @@ dependencies = [
|
|||||||
"trait-variant",
|
"trait-variant",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jobserver"
|
||||||
|
version = "0.1.34"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "9afb3de4395d6b3e67a780b6de64b51c978ecf11cb9a462c66be7d4ca9039d33"
|
||||||
|
dependencies = [
|
||||||
|
"getrandom 0.3.4",
|
||||||
|
"libc",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
version = "0.3.91"
|
version = "0.3.91"
|
||||||
@@ -3825,11 +3931,11 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"quoted_printable",
|
"quoted_printable",
|
||||||
"rsa",
|
"rsa",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"sha2",
|
"sha2",
|
||||||
"socket2 0.6.3",
|
"socket2 0.6.3",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls",
|
"tokio-rustls 0.26.4",
|
||||||
"tracing",
|
"tracing",
|
||||||
"url",
|
"url",
|
||||||
"webpki-roots 1.0.6",
|
"webpki-roots 1.0.6",
|
||||||
@@ -4292,7 +4398,7 @@ checksum = "dd7399781913e5393588a8d8c6a2867bf85fb38eaf2502fdce465aad2dc6f034"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"indexmap 2.13.0",
|
"indexmap 2.13.0",
|
||||||
"ipnet",
|
"ipnet",
|
||||||
@@ -5449,7 +5555,7 @@ dependencies = [
|
|||||||
"quinn-proto",
|
"quinn-proto",
|
||||||
"quinn-udp",
|
"quinn-udp",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"socket2 0.6.3",
|
"socket2 0.6.3",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
"tokio",
|
"tokio",
|
||||||
@@ -5469,7 +5575,7 @@ dependencies = [
|
|||||||
"rand 0.9.2",
|
"rand 0.9.2",
|
||||||
"ring",
|
"ring",
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"slab",
|
"slab",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
@@ -5792,12 +5898,12 @@ dependencies = [
|
|||||||
"encoding_rs",
|
"encoding_rs",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"h2",
|
"h2 0.4.13",
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"http-body 1.0.1",
|
"http-body 1.0.1",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-rustls",
|
"hyper-rustls 0.27.7",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"js-sys",
|
"js-sys",
|
||||||
"log",
|
"log",
|
||||||
@@ -5806,14 +5912,14 @@ dependencies = [
|
|||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
"quinn",
|
"quinn",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_urlencoded",
|
"serde_urlencoded",
|
||||||
"sync_wrapper",
|
"sync_wrapper",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls",
|
"tokio-rustls 0.26.4",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tower",
|
"tower",
|
||||||
"tower-http",
|
"tower-http",
|
||||||
@@ -5956,17 +6062,30 @@ dependencies = [
|
|||||||
"windows-sys 0.61.2",
|
"windows-sys 0.61.2",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustls"
|
||||||
|
version = "0.21.12"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e"
|
||||||
|
dependencies = [
|
||||||
|
"log",
|
||||||
|
"ring",
|
||||||
|
"rustls-webpki 0.101.7",
|
||||||
|
"sct",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls"
|
name = "rustls"
|
||||||
version = "0.23.37"
|
version = "0.23.37"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4"
|
checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"aws-lc-rs",
|
||||||
"log",
|
"log",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"ring",
|
"ring",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"rustls-webpki",
|
"rustls-webpki 0.103.10",
|
||||||
"subtle",
|
"subtle",
|
||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
@@ -6002,12 +6121,23 @@ dependencies = [
|
|||||||
"zeroize",
|
"zeroize",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rustls-webpki"
|
||||||
|
version = "0.101.7"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765"
|
||||||
|
dependencies = [
|
||||||
|
"ring",
|
||||||
|
"untrusted",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rustls-webpki"
|
name = "rustls-webpki"
|
||||||
version = "0.103.10"
|
version = "0.103.10"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef"
|
checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"aws-lc-rs",
|
||||||
"ring",
|
"ring",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"untrusted",
|
"untrusted",
|
||||||
@@ -6082,6 +6212,16 @@ version = "1.2.0"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "sct"
|
||||||
|
version = "0.7.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414"
|
||||||
|
dependencies = [
|
||||||
|
"ring",
|
||||||
|
"untrusted",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sec1"
|
name = "sec1"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
@@ -6420,16 +6560,6 @@ dependencies = [
|
|||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "signal-hook"
|
|
||||||
version = "0.3.18"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2"
|
|
||||||
dependencies = [
|
|
||||||
"libc",
|
|
||||||
"signal-hook-registry",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "signal-hook-registry"
|
name = "signal-hook-registry"
|
||||||
version = "1.4.8"
|
version = "1.4.8"
|
||||||
@@ -6645,7 +6775,7 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sha2",
|
"sha2",
|
||||||
@@ -6990,7 +7120,6 @@ dependencies = [
|
|||||||
"async-trait",
|
"async-trait",
|
||||||
"bollard",
|
"bollard",
|
||||||
"bytes",
|
"bytes",
|
||||||
"conquer-once",
|
|
||||||
"docker_credential",
|
"docker_credential",
|
||||||
"either",
|
"either",
|
||||||
"etcetera 0.11.0",
|
"etcetera 0.11.0",
|
||||||
@@ -7004,7 +7133,6 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serde_with",
|
"serde_with",
|
||||||
"signal-hook",
|
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-stream",
|
"tokio-stream",
|
||||||
@@ -7173,13 +7301,23 @@ dependencies = [
|
|||||||
"syn 2.0.117",
|
"syn 2.0.117",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tokio-rustls"
|
||||||
|
version = "0.24.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
|
||||||
|
dependencies = [
|
||||||
|
"rustls 0.21.12",
|
||||||
|
"tokio",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tokio-rustls"
|
name = "tokio-rustls"
|
||||||
version = "0.26.4"
|
version = "0.26.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
|
checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"tokio",
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -7202,10 +7340,10 @@ checksum = "d25a406cddcc431a75d3d9afc6a7c0f7428d4891dd973e4d54c56b46127bf857"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"log",
|
"log",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls",
|
"tokio-rustls 0.26.4",
|
||||||
"tungstenite 0.28.0",
|
"tungstenite 0.28.0",
|
||||||
"webpki-roots 0.26.11",
|
"webpki-roots 0.26.11",
|
||||||
]
|
]
|
||||||
@@ -7336,11 +7474,11 @@ dependencies = [
|
|||||||
"axum",
|
"axum",
|
||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"bytes",
|
"bytes",
|
||||||
"h2",
|
"h2 0.4.13",
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"http-body 1.0.1",
|
"http-body 1.0.1",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-timeout",
|
"hyper-timeout",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
@@ -7798,7 +7936,6 @@ dependencies = [
|
|||||||
"async-trait",
|
"async-trait",
|
||||||
"aws-config",
|
"aws-config",
|
||||||
"aws-sdk-s3",
|
"aws-sdk-s3",
|
||||||
"aws-smithy-http-client",
|
|
||||||
"axum",
|
"axum",
|
||||||
"backon",
|
"backon",
|
||||||
"base32",
|
"base32",
|
||||||
@@ -7908,7 +8045,7 @@ dependencies = [
|
|||||||
"quinn",
|
"quinn",
|
||||||
"rand 0.9.2",
|
"rand 0.9.2",
|
||||||
"rcgen",
|
"rcgen",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"serde",
|
"serde",
|
||||||
"sha2",
|
"sha2",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
@@ -7954,16 +8091,16 @@ dependencies = [
|
|||||||
"h3-quinn",
|
"h3-quinn",
|
||||||
"hex",
|
"hex",
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"quinn",
|
"quinn",
|
||||||
"rcgen",
|
"rcgen",
|
||||||
"reqwest",
|
"reqwest",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"rustls-pemfile",
|
"rustls-pemfile",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tokio-rustls",
|
"tokio-rustls 0.26.4",
|
||||||
"tokio-util",
|
"tokio-util",
|
||||||
"tower",
|
"tower",
|
||||||
"tracing",
|
"tracing",
|
||||||
@@ -8005,7 +8142,6 @@ dependencies = [
|
|||||||
"async-trait",
|
"async-trait",
|
||||||
"aws-config",
|
"aws-config",
|
||||||
"aws-sdk-s3",
|
"aws-sdk-s3",
|
||||||
"aws-smithy-http-client",
|
|
||||||
"bytes",
|
"bytes",
|
||||||
"futures",
|
"futures",
|
||||||
"sha2",
|
"sha2",
|
||||||
@@ -8142,7 +8278,7 @@ dependencies = [
|
|||||||
"httparse",
|
"httparse",
|
||||||
"log",
|
"log",
|
||||||
"rand 0.9.2",
|
"rand 0.9.2",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"sha1",
|
"sha1",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
@@ -8261,7 +8397,7 @@ dependencies = [
|
|||||||
"base64 0.22.1",
|
"base64 0.22.1",
|
||||||
"log",
|
"log",
|
||||||
"percent-encoding",
|
"percent-encoding",
|
||||||
"rustls",
|
"rustls 0.23.37",
|
||||||
"rustls-pki-types",
|
"rustls-pki-types",
|
||||||
"ureq-proto",
|
"ureq-proto",
|
||||||
"utf8-zero",
|
"utf8-zero",
|
||||||
@@ -9049,7 +9185,7 @@ dependencies = [
|
|||||||
"futures",
|
"futures",
|
||||||
"http 1.4.0",
|
"http 1.4.0",
|
||||||
"http-body-util",
|
"http-body-util",
|
||||||
"hyper",
|
"hyper 1.8.1",
|
||||||
"hyper-util",
|
"hyper-util",
|
||||||
"log",
|
"log",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
|
|||||||
+3
-14
@@ -63,9 +63,8 @@ backon = "1"
|
|||||||
bincode = { version = "2", features = ["serde"] }
|
bincode = { version = "2", features = ["serde"] }
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
aws-config = { version = "1.8", default-features = false, features = ["rt-tokio", "credentials-process", "sso"] }
|
aws-config = "1.8"
|
||||||
aws-sdk-s3 = { version = "1.118", default-features = false, features = ["sigv4a", "rt-tokio"] }
|
aws-sdk-s3 = "1.118"
|
||||||
aws-smithy-http-client = { version = "1.1", features = ["rustls-ring"] }
|
|
||||||
axum = { version = "0.8", features = ["ws", "macros"] }
|
axum = { version = "0.8", features = ["ws", "macros"] }
|
||||||
base32 = "0.5"
|
base32 = "0.5"
|
||||||
base64 = "0.22"
|
base64 = "0.22"
|
||||||
@@ -81,7 +80,7 @@ ed25519-dalek = { version = "2.1", features = ["pkcs8"] }
|
|||||||
foca = { version = "1", features = ["bincode-codec", "tracing"] }
|
foca = { version = "1", features = ["bincode-codec", "tracing"] }
|
||||||
futures = "0.3"
|
futures = "0.3"
|
||||||
futures-util = "0.3"
|
futures-util = "0.3"
|
||||||
governor = { version = "0.10", default-features = false, features = ["std", "dashmap", "jitter"] }
|
governor = "0.10"
|
||||||
h3 = "0.0.8"
|
h3 = "0.0.8"
|
||||||
h3-quinn = "0.0.10"
|
h3-quinn = "0.0.10"
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
@@ -171,13 +170,3 @@ lto = "fat"
|
|||||||
codegen-units = 1
|
codegen-units = 1
|
||||||
debug = 1
|
debug = 1
|
||||||
strip = false
|
strip = false
|
||||||
|
|
||||||
[profile.dev.package.bcrypt]
|
|
||||||
opt-level = 3
|
|
||||||
|
|
||||||
[profile.dev.package.blowfish]
|
|
||||||
opt-level = 3
|
|
||||||
|
|
||||||
# Set the default to optimized so fortify works in CI.
|
|
||||||
[profile.dev.package.tikv-jemalloc-sys]
|
|
||||||
opt-level = 1
|
|
||||||
|
|||||||
@@ -51,4 +51,3 @@ webauthn-rs = { workspace = true }
|
|||||||
[features]
|
[features]
|
||||||
bsky = ["bsky-support"]
|
bsky = ["bsky-support"]
|
||||||
bsky-support = []
|
bsky-support = []
|
||||||
low-bcrypt-cost = []
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use bcrypt::hash;
|
use bcrypt::{DEFAULT_COST, hash};
|
||||||
use chrono::{DateTime, Utc};
|
use chrono::{DateTime, Utc};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use tracing::{error, warn};
|
use tracing::{error, warn};
|
||||||
@@ -8,12 +8,6 @@ use tranquil_pds::api::error::DbResultExt;
|
|||||||
use tranquil_pds::types::{AtIdentifier, Did, Handle, PasswordHash};
|
use tranquil_pds::types::{AtIdentifier, Did, Handle, PasswordHash};
|
||||||
use tranquil_types::{DiscordUsername, SignalUsername, TelegramUsername};
|
use tranquil_types::{DiscordUsername, SignalUsername, TelegramUsername};
|
||||||
|
|
||||||
#[cfg(not(feature = "low-bcrypt-cost"))]
|
|
||||||
const PASSWORD_HASH_COST: u32 = bcrypt::DEFAULT_COST;
|
|
||||||
// Use a lower bcrypt cost in tests.
|
|
||||||
#[cfg(feature = "low-bcrypt-cost")]
|
|
||||||
const PASSWORD_HASH_COST: u32 = 4;
|
|
||||||
|
|
||||||
pub struct ResolvedRepo {
|
pub struct ResolvedRepo {
|
||||||
pub user_id: uuid::Uuid,
|
pub user_id: uuid::Uuid,
|
||||||
pub did: Did,
|
pub did: Did,
|
||||||
@@ -284,7 +278,7 @@ pub async fn verify_credential(
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn hash_or_internal_error(value: &str) -> Result<PasswordHash, ApiError> {
|
pub fn hash_or_internal_error(value: &str) -> Result<PasswordHash, ApiError> {
|
||||||
bcrypt::hash(value, PASSWORD_HASH_COST)
|
bcrypt::hash(value, DEFAULT_COST)
|
||||||
.map(PasswordHash::new)
|
.map(PasswordHash::new)
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
error!("Bcrypt hash error: {:?}", e);
|
error!("Bcrypt hash error: {:?}", e);
|
||||||
@@ -294,7 +288,7 @@ pub fn hash_or_internal_error(value: &str) -> Result<PasswordHash, ApiError> {
|
|||||||
|
|
||||||
pub async fn hash_password_async(password: &str) -> Result<PasswordHash, ApiError> {
|
pub async fn hash_password_async(password: &str) -> Result<PasswordHash, ApiError> {
|
||||||
let password = password.to_string();
|
let password = password.to_string();
|
||||||
tokio::task::spawn_blocking(move || hash(password, PASSWORD_HASH_COST))
|
tokio::task::spawn_blocking(move || hash(password, DEFAULT_COST))
|
||||||
.await
|
.await
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
error!("Failed to spawn blocking task: {:?}", e);
|
error!("Failed to spawn blocking task: {:?}", e);
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ async fn test_fetch_schema_error_status_gives_meaningful_error() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn jail_test_plc_server_timeout() {
|
async fn test_plc_server_timeout() {
|
||||||
let plc_server = MockServer::start().await;
|
let plc_server = MockServer::start().await;
|
||||||
let did = "did:plc:timeout123";
|
let did = "did:plc:timeout123";
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ tranquil-infra = { workspace = true, features = ["testing"] }
|
|||||||
tempfile = "3"
|
tempfile = "3"
|
||||||
ciborium = { workspace = true }
|
ciborium = { workspace = true }
|
||||||
ctor = { workspace = true }
|
ctor = { workspace = true }
|
||||||
testcontainers = { workspace = true, features = ["watchdog"] }
|
testcontainers = { workspace = true }
|
||||||
testcontainers-modules = { workspace = true }
|
testcontainers-modules = { workspace = true }
|
||||||
tranquil-ripple = { workspace = true }
|
tranquil-ripple = { workspace = true }
|
||||||
tranquil-sync = { workspace = true }
|
tranquil-sync = { workspace = true }
|
||||||
@@ -102,5 +102,4 @@ hex = { workspace = true }
|
|||||||
tokio-tungstenite = { workspace = true }
|
tokio-tungstenite = { workspace = true }
|
||||||
aws-config = { workspace = true }
|
aws-config = { workspace = true }
|
||||||
aws-sdk-s3 = { workspace = true }
|
aws-sdk-s3 = { workspace = true }
|
||||||
aws-smithy-http-client = { workspace = true }
|
|
||||||
redis = { workspace = true }
|
redis = { workspace = true }
|
||||||
|
|||||||
@@ -251,9 +251,7 @@ impl AppState {
|
|||||||
|
|
||||||
let mut state = match cfg.storage.repo_backend() {
|
let mut state = match cfg.storage.repo_backend() {
|
||||||
tranquil_config::RepoBackend::TranquilStore => {
|
tranquil_config::RepoBackend::TranquilStore => {
|
||||||
tracing::info!(
|
tracing::info!("tranquil-store repo backend active. Thank you so much for believing in us!");
|
||||||
"tranquil-store repo backend active. Thank you so much for believing in us!"
|
|
||||||
);
|
|
||||||
Self::from_store(shutdown).await
|
Self::from_store(shutdown).await
|
||||||
}
|
}
|
||||||
tranquil_config::RepoBackend::Postgres => {
|
tranquil_config::RepoBackend::Postgres => {
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::{base_url, client, create_account_and_login, get_test_repos, user_id_of};
|
mod common;
|
||||||
|
use common::{base_url, client, create_account_and_login, get_test_repos, user_id_of};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_db_traits::{CommsChannel, CommsType};
|
use tranquil_db_traits::{CommsChannel, CommsType};
|
||||||
use tranquil_types::{Did, Recipient};
|
use tranquil_types::{Did, Recipient};
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::{base_url, client, create_account_and_login};
|
mod common;
|
||||||
|
use common::{base_url, client, create_account_and_login};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
+28
-26
@@ -1,3 +1,5 @@
|
|||||||
|
mod common;
|
||||||
|
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_db_traits::CommsType;
|
use tranquil_db_traits::CommsType;
|
||||||
@@ -5,10 +7,10 @@ use tranquil_types::Did;
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_send_email_success() {
|
async fn test_send_email_success() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let (access_jwt, did) = crate::common::create_admin_account_and_login(&client).await;
|
let (access_jwt, did) = common::create_admin_account_and_login(&client).await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
||||||
.bearer_auth(&access_jwt)
|
.bearer_auth(&access_jwt)
|
||||||
@@ -24,7 +26,7 @@ async fn test_send_email_success() {
|
|||||||
assert_eq!(res.status(), StatusCode::OK);
|
assert_eq!(res.status(), StatusCode::OK);
|
||||||
let body: Value = res.json().await.expect("Invalid JSON");
|
let body: Value = res.json().await.expect("Invalid JSON");
|
||||||
assert_eq!(body["sent"], true);
|
assert_eq!(body["sent"], true);
|
||||||
let user_id = crate::common::user_id_of(repos, &Did::new(did).unwrap()).await;
|
let user_id = common::user_id_of(repos, &Did::new(did).unwrap()).await;
|
||||||
let comms = repos
|
let comms = repos
|
||||||
.infra
|
.infra
|
||||||
.get_latest_comms_for_user(user_id, CommsType::AdminEmail, 1)
|
.get_latest_comms_for_user(user_id, CommsType::AdminEmail, 1)
|
||||||
@@ -41,10 +43,10 @@ async fn test_send_email_success() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_send_email_default_subject() {
|
async fn test_send_email_default_subject() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let (access_jwt, did) = crate::common::create_admin_account_and_login(&client).await;
|
let (access_jwt, did) = common::create_admin_account_and_login(&client).await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
||||||
.bearer_auth(&access_jwt)
|
.bearer_auth(&access_jwt)
|
||||||
@@ -59,7 +61,7 @@ async fn test_send_email_default_subject() {
|
|||||||
assert_eq!(res.status(), StatusCode::OK);
|
assert_eq!(res.status(), StatusCode::OK);
|
||||||
let body: Value = res.json().await.expect("Invalid JSON");
|
let body: Value = res.json().await.expect("Invalid JSON");
|
||||||
assert_eq!(body["sent"], true);
|
assert_eq!(body["sent"], true);
|
||||||
let user_id = crate::common::user_id_of(repos, &Did::new(did).unwrap()).await;
|
let user_id = common::user_id_of(repos, &Did::new(did).unwrap()).await;
|
||||||
let comms = repos
|
let comms = repos
|
||||||
.infra
|
.infra
|
||||||
.get_latest_comms_for_user(user_id, CommsType::AdminEmail, 10)
|
.get_latest_comms_for_user(user_id, CommsType::AdminEmail, 10)
|
||||||
@@ -81,9 +83,9 @@ async fn test_send_email_default_subject() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_send_email_recipient_not_found() {
|
async fn test_send_email_recipient_not_found() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let (access_jwt, _) = crate::common::create_admin_account_and_login(&client).await;
|
let (access_jwt, _) = common::create_admin_account_and_login(&client).await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
||||||
.bearer_auth(&access_jwt)
|
.bearer_auth(&access_jwt)
|
||||||
@@ -102,9 +104,9 @@ async fn test_send_email_recipient_not_found() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_send_email_missing_content() {
|
async fn test_send_email_missing_content() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let (access_jwt, did) = crate::common::create_admin_account_and_login(&client).await;
|
let (access_jwt, did) = common::create_admin_account_and_login(&client).await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
||||||
.bearer_auth(&access_jwt)
|
.bearer_auth(&access_jwt)
|
||||||
@@ -123,9 +125,9 @@ async fn test_send_email_missing_content() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_send_email_missing_recipient() {
|
async fn test_send_email_missing_recipient() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let (access_jwt, _) = crate::common::create_admin_account_and_login(&client).await;
|
let (access_jwt, _) = common::create_admin_account_and_login(&client).await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
||||||
.bearer_auth(&access_jwt)
|
.bearer_auth(&access_jwt)
|
||||||
@@ -142,8 +144,8 @@ async fn test_send_email_missing_recipient() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_send_email_requires_auth() {
|
async fn test_send_email_requires_auth() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
.post(format!("{}/xrpc/com.atproto.admin.sendEmail", base_url))
|
||||||
.json(&json!({
|
.json(&json!({
|
||||||
@@ -159,11 +161,11 @@ async fn test_send_email_requires_auth() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_send_email_rejects_garbage_stored_email() {
|
async fn test_send_email_rejects_garbage_stored_email() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let (access_jwt, did) = crate::common::create_admin_account_and_login(&client).await;
|
let (access_jwt, did) = common::create_admin_account_and_login(&client).await;
|
||||||
let user_id = crate::common::user_id_of(repos, &Did::new(did.clone()).unwrap()).await;
|
let user_id = common::user_id_of(repos, &Did::new(did.clone()).unwrap()).await;
|
||||||
repos
|
repos
|
||||||
.user
|
.user
|
||||||
.update_email(user_id, "not-an-email")
|
.update_email(user_id, "not-an-email")
|
||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::{base_url, client, create_admin_account_and_login};
|
mod common;
|
||||||
|
use common::{base_url, client, create_admin_account_and_login};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
+6
-3
@@ -1,7 +1,10 @@
|
|||||||
use crate::common::{base_url, client, create_account_and_login, pds_endpoint};
|
mod common;
|
||||||
use crate::helpers::verify_new_account;
|
mod helpers;
|
||||||
|
|
||||||
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::{base_url, client, create_account_and_login, pds_endpoint};
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
@@ -212,7 +215,7 @@ async fn test_oauth_admin_extractor_allows_oauth_tokens() {
|
|||||||
let did = account["did"].as_str().unwrap().to_string();
|
let did = account["did"].as_str().unwrap().to_string();
|
||||||
verify_new_account(&http_client, &did).await;
|
verify_new_account(&http_client, &did).await;
|
||||||
|
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
repos
|
repos
|
||||||
.user
|
.user
|
||||||
.set_admin_status(&tranquil_types::Did::new(did.clone()).unwrap(), true)
|
.set_admin_status(&tranquil_types::Did::new(did.clone()).unwrap(), true)
|
||||||
+4
-2
@@ -13,8 +13,10 @@
|
|||||||
* - we maintain this code precisely because we believe everyone deserves an experience on the web that is free from this kinda language
|
* - we maintain this code precisely because we believe everyone deserves an experience on the web that is free from this kinda language
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
@@ -83,41 +83,28 @@ fn has_external_infra() -> bool {
|
|||||||
|| (std::env::var("DATABASE_URL").is_ok()
|
|| (std::env::var("DATABASE_URL").is_ok()
|
||||||
&& (std::env::var("S3_ENDPOINT").is_ok() || std::env::var("BLOB_STORAGE_PATH").is_ok()))
|
&& (std::env::var("S3_ENDPOINT").is_ok() || std::env::var("BLOB_STORAGE_PATH").is_ok()))
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "external-infra"))]
|
|
||||||
fn started_container_ids() -> Vec<String> {
|
|
||||||
let db = DB_CONTAINER.get().map(|c| c.id().to_string());
|
|
||||||
#[cfg(feature = "s3")]
|
|
||||||
let s3 = S3_CONTAINER.get().map(|c| c.id().to_string());
|
|
||||||
#[cfg(not(feature = "s3"))]
|
|
||||||
let s3: Option<String> = None;
|
|
||||||
db.into_iter().chain(s3).collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "external-infra")]
|
|
||||||
fn started_container_ids() -> Vec<String> {
|
|
||||||
Vec::new()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
#[ctor::dtor]
|
#[ctor::dtor]
|
||||||
fn cleanup() {
|
fn cleanup() {
|
||||||
if let Some(temp_dir) = TEST_TEMP_DIR.get() {
|
if let Some(temp_dir) = TEST_TEMP_DIR.get() {
|
||||||
let _ = std::fs::remove_dir_all(temp_dir);
|
let _ = std::fs::remove_dir_all(temp_dir);
|
||||||
}
|
}
|
||||||
let ids = started_container_ids();
|
if has_external_infra() {
|
||||||
if ids.is_empty() {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if std::env::var("XDG_RUNTIME_DIR").is_ok() {
|
if std::env::var("XDG_RUNTIME_DIR").is_ok() {
|
||||||
let _ = std::process::Command::new("podman")
|
let _ = std::process::Command::new("podman")
|
||||||
.args(["rm", "-f"])
|
.args(["rm", "-f", "--filter", "label=tranquil_pds_test=true"])
|
||||||
.args(&ids)
|
|
||||||
.output();
|
.output();
|
||||||
}
|
}
|
||||||
let _ = std::process::Command::new("docker")
|
let _ = std::process::Command::new("docker")
|
||||||
.args(["rm", "-f"])
|
.args([
|
||||||
.args(&ids)
|
"container",
|
||||||
|
"prune",
|
||||||
|
"-f",
|
||||||
|
"--filter",
|
||||||
|
"label=tranquil_pds_test=true",
|
||||||
|
])
|
||||||
.output();
|
.output();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -270,13 +257,6 @@ async fn setup_with_testcontainers() -> String {
|
|||||||
}
|
}
|
||||||
let sdk_config = aws_config::defaults(BehaviorVersion::latest())
|
let sdk_config = aws_config::defaults(BehaviorVersion::latest())
|
||||||
.region("us-east-1")
|
.region("us-east-1")
|
||||||
.http_client(
|
|
||||||
aws_smithy_http_client::Builder::new()
|
|
||||||
.tls_provider(aws_smithy_http_client::tls::Provider::Rustls(
|
|
||||||
aws_smithy_http_client::tls::rustls_provider::CryptoMode::Ring,
|
|
||||||
))
|
|
||||||
.build_https(),
|
|
||||||
)
|
|
||||||
.endpoint_url(&s3_endpoint)
|
.endpoint_url(&s3_endpoint)
|
||||||
.credentials_provider(Credentials::new(
|
.credentials_provider(Credentials::new(
|
||||||
"minioadmin",
|
"minioadmin",
|
||||||
@@ -754,40 +734,7 @@ pub async fn spawn_cluster(pool: Option<sqlx::PgPool>, node_count: usize) -> Vec
|
|||||||
let first = &instances[0];
|
let first = &instances[0];
|
||||||
APP_PORT.set(first.port).ok();
|
APP_PORT.set(first.port).ok();
|
||||||
|
|
||||||
let caches: Vec<Arc<dyn Cache>> = instances
|
tokio::time::sleep(Duration::from_millis(2000)).await;
|
||||||
.iter()
|
|
||||||
.map(|instance| instance.cache.clone().expect("cluster node has no cache"))
|
|
||||||
.collect();
|
|
||||||
futures::future::join_all(caches.iter().enumerate().map(|(i, cache)| async move {
|
|
||||||
cache
|
|
||||||
.set(
|
|
||||||
&format!("__cluster_ready_{i}"),
|
|
||||||
"1",
|
|
||||||
Duration::from_secs(60),
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
.expect("cluster readiness probe failed");
|
|
||||||
}))
|
|
||||||
.await;
|
|
||||||
let deadline = tokio::time::Instant::now() + Duration::from_secs(10);
|
|
||||||
loop {
|
|
||||||
let ready = futures::future::join_all(caches.iter().flat_map(|cache| {
|
|
||||||
(0..caches.len()).map(move |i| async move {
|
|
||||||
cache.get(&format!("__cluster_ready_{i}")).await.is_some()
|
|
||||||
})
|
|
||||||
}))
|
|
||||||
.await
|
|
||||||
.into_iter()
|
|
||||||
.all(|seen| seen);
|
|
||||||
if ready {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
assert!(
|
|
||||||
tokio::time::Instant::now() < deadline,
|
|
||||||
"cluster nodes did not converge within 10s"
|
|
||||||
);
|
|
||||||
tokio::time::sleep(Duration::from_millis(50)).await;
|
|
||||||
}
|
|
||||||
|
|
||||||
instances
|
instances
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
mod helpers;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use base64::Engine;
|
use base64::Engine;
|
||||||
use base64::engine::general_purpose::URL_SAFE_NO_PAD;
|
use base64::engine::general_purpose::URL_SAFE_NO_PAD;
|
||||||
|
use common::*;
|
||||||
use k256::ecdsa::{SigningKey, signature::Signer};
|
use k256::ecdsa::{SigningKey, signature::Signer};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
@@ -99,7 +100,7 @@ async fn test_external_did_web_no_local_doc() {
|
|||||||
let mock_addr = mock_uri.trim_start_matches("http://");
|
let mock_addr = mock_uri.trim_start_matches("http://");
|
||||||
let did = format!("did:web:{}", mock_addr.replace(":", "%3A"));
|
let did = format!("did:web:{}", mock_addr.replace(":", "%3A"));
|
||||||
let handle = format!("xw{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("xw{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let pds_endpoint = crate::common::pds_endpoint();
|
let pds_endpoint = common::pds_endpoint();
|
||||||
|
|
||||||
let reserve_res = client
|
let reserve_res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
@@ -202,7 +203,7 @@ async fn assert_reserved_key_placement_rejected(
|
|||||||
let mock_addr = mock_uri.trim_start_matches("http://");
|
let mock_addr = mock_uri.trim_start_matches("http://");
|
||||||
let did = format!("did:web:{}", mock_addr.replace(":", "%3A"));
|
let did = format!("did:web:{}", mock_addr.replace(":", "%3A"));
|
||||||
let handle = format!("wm{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("wm{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let pds_endpoint = crate::common::pds_endpoint();
|
let pds_endpoint = common::pds_endpoint();
|
||||||
|
|
||||||
let signing_key = reserve_signing_key(&client, base, &did).await;
|
let signing_key = reserve_signing_key(&client, base, &did).await;
|
||||||
let signing_multibase = signing_key
|
let signing_multibase = signing_key
|
||||||
@@ -524,8 +525,8 @@ async fn test_did_web_byod_flow() {
|
|||||||
unique_id
|
unique_id
|
||||||
);
|
);
|
||||||
let handle = format!("by{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("by{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let pds_endpoint = crate::common::pds_endpoint();
|
let pds_endpoint = common::pds_endpoint();
|
||||||
let pds_hostname = crate::common::pds_hostname();
|
let pds_hostname = common::pds_hostname();
|
||||||
let pds_did = format!("did:web:{}", pds_hostname);
|
let pds_did = format!("did:web:{}", pds_hostname);
|
||||||
|
|
||||||
let temp_key = SigningKey::random(&mut rand::thread_rng());
|
let temp_key = SigningKey::random(&mut rand::thread_rng());
|
||||||
@@ -578,7 +579,7 @@ async fn test_did_web_byod_flow() {
|
|||||||
"BYOD accounts should require verification"
|
"BYOD accounts should require verification"
|
||||||
);
|
);
|
||||||
|
|
||||||
let access_jwt = crate::common::verify_new_account(&client, returned_did).await;
|
let access_jwt = common::verify_new_account(&client, returned_did).await;
|
||||||
|
|
||||||
let res = client
|
let res = client
|
||||||
.get(format!(
|
.get(format!(
|
||||||
+34
-33
@@ -1,10 +1,11 @@
|
|||||||
|
mod common;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_db_traits::CommsType;
|
use tranquil_db_traits::CommsType;
|
||||||
use tranquil_types::Did;
|
use tranquil_types::Did;
|
||||||
|
|
||||||
async fn get_email_update_token(did: &str) -> String {
|
async fn get_email_update_token(did: &str) -> String {
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let parsed_did = Did::new(did.to_string()).unwrap();
|
let parsed_did = Did::new(did.to_string()).unwrap();
|
||||||
let user = repos
|
let user = repos
|
||||||
.user
|
.user
|
||||||
@@ -59,14 +60,14 @@ async fn create_verified_account(
|
|||||||
assert_eq!(res.status(), StatusCode::OK);
|
assert_eq!(res.status(), StatusCode::OK);
|
||||||
let body: Value = res.json().await.expect("Invalid JSON");
|
let body: Value = res.json().await.expect("Invalid JSON");
|
||||||
let did = body["did"].as_str().expect("No did").to_string();
|
let did = body["did"].as_str().expect("No did").to_string();
|
||||||
let jwt = crate::common::verify_new_account(client, &did).await;
|
let jwt = common::verify_new_account(client, &did).await;
|
||||||
(jwt, did)
|
(jwt, did)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_request_email_update_returns_token_required() {
|
async fn test_request_email_update_returns_token_required() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let handle = format!("er{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("er{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@nel.pet", handle);
|
let email = format!("{}@nel.pet", handle);
|
||||||
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
||||||
@@ -87,9 +88,9 @@ async fn test_request_email_update_returns_token_required() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_update_email_flow_success() {
|
async fn test_update_email_flow_success() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let handle = format!("eu{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("eu{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@nel.pet", handle);
|
let email = format!("{}@nel.pet", handle);
|
||||||
let (access_jwt, did) = create_verified_account(&client, base_url, &handle, &email).await;
|
let (access_jwt, did) = create_verified_account(&client, base_url, &handle, &email).await;
|
||||||
@@ -135,8 +136,8 @@ async fn test_update_email_flow_success() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_update_email_requires_token_when_verified() {
|
async fn test_update_email_requires_token_when_verified() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let handle = format!("ed{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("ed{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@nel.pet", handle);
|
let email = format!("{}@nel.pet", handle);
|
||||||
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
||||||
@@ -156,8 +157,8 @@ async fn test_update_email_requires_token_when_verified() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_update_email_same_email_noop() {
|
async fn test_update_email_same_email_noop() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let handle = format!("es{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("es{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@nel.pet", handle);
|
let email = format!("{}@nel.pet", handle);
|
||||||
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
||||||
@@ -178,8 +179,8 @@ async fn test_update_email_same_email_noop() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_update_email_invalid_token() {
|
async fn test_update_email_invalid_token() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let handle = format!("eb{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("eb{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@nel.pet", handle);
|
let email = format!("{}@nel.pet", handle);
|
||||||
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
||||||
@@ -213,8 +214,8 @@ async fn test_update_email_invalid_token() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_update_email_no_auth() {
|
async fn test_update_email_no_auth() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
|
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!("{}/xrpc/com.atproto.server.updateEmail", base_url))
|
.post(format!("{}/xrpc/com.atproto.server.updateEmail", base_url))
|
||||||
@@ -229,8 +230,8 @@ async fn test_update_email_no_auth() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_update_email_invalid_format() {
|
async fn test_update_email_invalid_format() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let handle = format!("ef{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("ef{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@nel.pet", handle);
|
let email = format!("{}@nel.pet", handle);
|
||||||
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
let (access_jwt, _) = create_verified_account(&client, base_url, &handle, &email).await;
|
||||||
@@ -247,9 +248,9 @@ async fn test_update_email_invalid_format() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_confirm_email_confirms_existing_email() {
|
async fn test_confirm_email_confirms_existing_email() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let handle = format!("ec{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("ec{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@nel.pet", handle);
|
let email = format!("{}@nel.pet", handle);
|
||||||
|
|
||||||
@@ -322,9 +323,9 @@ async fn test_confirm_email_confirms_existing_email() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_confirm_email_rejects_wrong_email() {
|
async fn test_confirm_email_rejects_wrong_email() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let handle = format!("ew{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("ew{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@jola.dev", handle);
|
let email = format!("{}@jola.dev", handle);
|
||||||
|
|
||||||
@@ -390,8 +391,8 @@ async fn test_confirm_email_rejects_wrong_email() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_confirm_email_invalid_token() {
|
async fn test_confirm_email_invalid_token() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let handle = format!("ei{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("ei{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@jola.dev", handle);
|
let email = format!("{}@jola.dev", handle);
|
||||||
|
|
||||||
@@ -432,9 +433,9 @@ async fn test_confirm_email_invalid_token() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_unverified_account_can_update_email_without_token() {
|
async fn test_unverified_account_can_update_email_without_token() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let handle = format!("ev{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("ev{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@nel.pet", handle);
|
let email = format!("{}@nel.pet", handle);
|
||||||
|
|
||||||
@@ -502,9 +503,9 @@ async fn test_unverified_account_can_update_email_without_token() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_update_email_to_same_as_another_user_allowed() {
|
async fn test_update_email_to_same_as_another_user_allowed() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
|
|
||||||
let handle1 = format!("d1{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle1 = format!("d1{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email1 = format!("{}@jola.dev", handle1);
|
let email1 = format!("{}@jola.dev", handle1);
|
||||||
@@ -556,8 +557,8 @@ async fn test_update_email_to_same_as_another_user_allowed() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_check_email_in_use_distinguishes_empty_from_invalid() {
|
async fn test_check_email_in_use_distinguishes_empty_from_invalid() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base = crate::common::base_url().await;
|
let base = common::base_url().await;
|
||||||
|
|
||||||
let resp = client
|
let resp = client
|
||||||
.post(format!("{}/xrpc/_account.checkEmailInUse", base))
|
.post(format!("{}/xrpc/_account.checkEmailInUse", base))
|
||||||
+3
-1
@@ -1,6 +1,8 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
|
||||||
use base64::Engine;
|
use base64::Engine;
|
||||||
use base64::engine::general_purpose::URL_SAFE_NO_PAD;
|
use base64::engine::general_purpose::URL_SAFE_NO_PAD;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
+7
-3
@@ -1,7 +1,11 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::firehose::FirehoseConsumer;
|
mod firehose;
|
||||||
use crate::helpers::build_car_with_signature;
|
mod helpers;
|
||||||
|
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
|
use common::*;
|
||||||
|
use firehose::FirehoseConsumer;
|
||||||
|
use helpers::build_car_with_signature;
|
||||||
use iroh_car::CarReader;
|
use iroh_car::CarReader;
|
||||||
use k256::ecdsa::SigningKey;
|
use k256::ecdsa::SigningKey;
|
||||||
use multihash::Multihash;
|
use multihash::Multihash;
|
||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
|
use common::*;
|
||||||
use futures::{SinkExt, stream::StreamExt};
|
use futures::{SinkExt, stream::StreamExt};
|
||||||
use iroh_car::CarReader;
|
use iroh_car::CarReader;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
+4
-2
@@ -1,6 +1,8 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_types::{Did, Nsid, Rkey};
|
use tranquil_types::{Did, Nsid, Rkey};
|
||||||
+3
-1
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use wiremock::matchers::{method, path};
|
use wiremock::matchers::{method, path};
|
||||||
@@ -97,7 +98,7 @@ async fn test_create_did_web_account_and_resolve() {
|
|||||||
let did = format!("did:web:{}", mock_addr.replace(":", "%3A"));
|
let did = format!("did:web:{}", mock_addr.replace(":", "%3A"));
|
||||||
let handle = format!("wu{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("wu{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let base = base_url().await;
|
let base = base_url().await;
|
||||||
let pds_endpoint = crate::common::pds_endpoint();
|
let pds_endpoint = common::pds_endpoint();
|
||||||
|
|
||||||
let reserve_res = client
|
let reserve_res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
@@ -219,7 +220,7 @@ async fn test_did_web_lifecycle() {
|
|||||||
let handle = format!("lc{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("lc{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let did = format!("did:web:{}:u:{}", mock_addr.replace(":", "%3A"), handle);
|
let did = format!("did:web:{}:u:{}", mock_addr.replace(":", "%3A"), handle);
|
||||||
let email = format!("{}@test.com", handle);
|
let email = format!("{}@test.com", handle);
|
||||||
let pds_endpoint = crate::common::pds_endpoint();
|
let pds_endpoint = common::pds_endpoint();
|
||||||
|
|
||||||
let reserve_res = client
|
let reserve_res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
use common::*;
|
||||||
use iroh_car::CarHeader;
|
use iroh_car::CarHeader;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
use common::*;
|
||||||
use reqwest::{Client, StatusCode};
|
use reqwest::{Client, StatusCode};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_pds::api::error::ApiError;
|
use tranquil_pds::api::error::ApiError;
|
||||||
@@ -1,85 +0,0 @@
|
|||||||
#[path = "../common/mod.rs"]
|
|
||||||
mod common;
|
|
||||||
#[path = "../firehose/mod.rs"]
|
|
||||||
mod firehose;
|
|
||||||
#[path = "../helpers/mod.rs"]
|
|
||||||
mod helpers;
|
|
||||||
#[path = "../mst_verify/mod.rs"]
|
|
||||||
mod mst_verify;
|
|
||||||
|
|
||||||
mod account_lifecycle;
|
|
||||||
mod account_notifications;
|
|
||||||
mod actor;
|
|
||||||
mod admin_email;
|
|
||||||
mod admin_invite;
|
|
||||||
mod admin_moderation;
|
|
||||||
mod admin_search;
|
|
||||||
mod admin_stats;
|
|
||||||
mod apple_sso_unit;
|
|
||||||
mod auth_extractor;
|
|
||||||
mod banned_words;
|
|
||||||
mod car_export_detects_corruption;
|
|
||||||
mod change_password;
|
|
||||||
mod commit_signing;
|
|
||||||
mod delete_account;
|
|
||||||
mod did_web;
|
|
||||||
mod dpop_unit;
|
|
||||||
mod email_update;
|
|
||||||
mod feed_proxy_aud;
|
|
||||||
mod firehose_inline_blocks;
|
|
||||||
mod firehose_validation;
|
|
||||||
mod gc_after_delete;
|
|
||||||
mod gc_compaction_restart;
|
|
||||||
mod identity;
|
|
||||||
mod image_processing;
|
|
||||||
mod import_verification;
|
|
||||||
mod invite;
|
|
||||||
mod invite_registration;
|
|
||||||
mod jwt_security;
|
|
||||||
mod legacy_2fa;
|
|
||||||
mod lifecycle_record;
|
|
||||||
mod lifecycle_session;
|
|
||||||
mod lifecycle_social;
|
|
||||||
mod moderation;
|
|
||||||
mod mst_diff_equivalence;
|
|
||||||
mod mst_firehose_e2e;
|
|
||||||
mod mst_inductive_firehose;
|
|
||||||
mod mst_integrity;
|
|
||||||
mod mst_property_fuzz;
|
|
||||||
mod mst_repair_audit;
|
|
||||||
mod mst_repair_durability;
|
|
||||||
mod mst_structural_repair;
|
|
||||||
mod notifications;
|
|
||||||
mod oauth;
|
|
||||||
mod oauth_lifecycle;
|
|
||||||
mod oauth_permission_sets;
|
|
||||||
mod oauth_scopes;
|
|
||||||
mod oauth_security;
|
|
||||||
mod oauth_token_eviction;
|
|
||||||
mod password_reset;
|
|
||||||
mod plc_operations;
|
|
||||||
mod plc_validation;
|
|
||||||
mod rate_limit;
|
|
||||||
mod record_validation;
|
|
||||||
mod repair_leaf_loss;
|
|
||||||
mod repo_batch;
|
|
||||||
mod repo_blob;
|
|
||||||
mod repo_conformance;
|
|
||||||
mod repo_lifecycle;
|
|
||||||
mod ripple_cluster;
|
|
||||||
mod scope_edge_cases;
|
|
||||||
mod security_fixes;
|
|
||||||
mod server;
|
|
||||||
mod session_management;
|
|
||||||
mod shutdown_unit;
|
|
||||||
mod signing_key;
|
|
||||||
mod sso;
|
|
||||||
mod store_parity;
|
|
||||||
mod sync_blob;
|
|
||||||
mod sync_conformance;
|
|
||||||
mod sync_deprecated;
|
|
||||||
mod sync_repo;
|
|
||||||
mod user_blocks_reachability;
|
|
||||||
mod validation_edge_cases;
|
|
||||||
mod verify_live_commit;
|
|
||||||
mod whole_story;
|
|
||||||
+2
-1
@@ -1,7 +1,8 @@
|
|||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
use crate::common::{base_url, client, create_account_and_login, get_test_repos};
|
mod common;
|
||||||
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||||
use chrono::{Duration, Utc};
|
use chrono::{Duration, Utc};
|
||||||
|
use common::{base_url, client, create_account_and_login, get_test_repos};
|
||||||
use k256::SecretKey;
|
use k256::SecretKey;
|
||||||
use k256::ecdsa::{Signature, SigningKey, signature::Signer};
|
use k256::ecdsa::{Signature, SigningKey, signature::Signer};
|
||||||
use rand::rngs::OsRng;
|
use rand::rngs::OsRng;
|
||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
use crate::common::{base_url, client, create_account_and_login, get_test_repos, user_id_of};
|
mod common;
|
||||||
|
|
||||||
|
use common::{base_url, client, create_account_and_login, get_test_repos, user_id_of};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_db_traits::{CommsChannel, CommsType};
|
use tranquil_db_traits::{CommsChannel, CommsType};
|
||||||
+4
-2
@@ -1,6 +1,8 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::{StatusCode, header};
|
use reqwest::{StatusCode, header};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
+4
-2
@@ -1,6 +1,8 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+4
-2
@@ -1,6 +1,8 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+6
-3
@@ -1,13 +1,16 @@
|
|||||||
|
mod common;
|
||||||
|
mod firehose;
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use crate::common::*;
|
|
||||||
use crate::firehose::{FirehoseConsumer, ParsedCommitFrame};
|
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
|
use common::*;
|
||||||
|
use firehose::{FirehoseConsumer, ParsedCommitFrame};
|
||||||
use iroh_car::CarReader;
|
use iroh_car::CarReader;
|
||||||
use jacquard_common::smol_str::SmolStr;
|
use jacquard_common::smol_str::SmolStr;
|
||||||
use jacquard_repo::commit::Commit;
|
use jacquard_repo::commit::Commit;
|
||||||
@@ -28,7 +31,7 @@ async fn car_to_blocks(car_bytes: &[u8]) -> BTreeMap<Cid, Bytes> {
|
|||||||
blocks
|
blocks
|
||||||
}
|
}
|
||||||
|
|
||||||
fn op_to_verified(op: &crate::firehose::ParsedRepoOp) -> Result<VerifiedWriteOp, String> {
|
fn op_to_verified(op: &firehose::ParsedRepoOp) -> Result<VerifiedWriteOp, String> {
|
||||||
let key = SmolStr::new(&op.path);
|
let key = SmolStr::new(&op.path);
|
||||||
match op.action {
|
match op.action {
|
||||||
RepoAction::Create => {
|
RepoAction::Create => {
|
||||||
+5
-2
@@ -1,14 +1,17 @@
|
|||||||
|
mod common;
|
||||||
|
mod mst_verify;
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
use crate::common::*;
|
|
||||||
use crate::mst_verify::{extract_event_blocks, inline_to_store};
|
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
|
use common::*;
|
||||||
use jacquard_common::smol_str::SmolStr;
|
use jacquard_common::smol_str::SmolStr;
|
||||||
use jacquard_repo::commit::Commit;
|
use jacquard_repo::commit::Commit;
|
||||||
use jacquard_repo::mst::{Mst, VerifiedWriteOp};
|
use jacquard_repo::mst::{Mst, VerifiedWriteOp};
|
||||||
use jacquard_repo::storage::{BlockStore, MemoryBlockStore};
|
use jacquard_repo::storage::{BlockStore, MemoryBlockStore};
|
||||||
|
use mst_verify::{extract_event_blocks, inline_to_store};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_db_traits::{RepoEventType, SequenceNumber, SequencedEvent};
|
use tranquil_db_traits::{RepoEventType, SequenceNumber, SequencedEvent};
|
||||||
+7
-3
@@ -1,13 +1,17 @@
|
|||||||
|
mod common;
|
||||||
|
mod firehose;
|
||||||
|
mod helpers;
|
||||||
|
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::io::Cursor;
|
use std::io::Cursor;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use crate::common::*;
|
|
||||||
use crate::firehose::FirehoseConsumer;
|
|
||||||
use crate::helpers::build_car_with_signature;
|
|
||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
|
use common::*;
|
||||||
|
use firehose::FirehoseConsumer;
|
||||||
|
use helpers::build_car_with_signature;
|
||||||
use iroh_car::CarReader;
|
use iroh_car::CarReader;
|
||||||
use jacquard_repo::commit::Commit;
|
use jacquard_repo::commit::Commit;
|
||||||
use jacquard_repo::mst::Mst;
|
use jacquard_repo::mst::Mst;
|
||||||
+5
-2
@@ -1,13 +1,16 @@
|
|||||||
|
mod common;
|
||||||
|
mod mst_verify;
|
||||||
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use crate::common::*;
|
|
||||||
use crate::mst_verify::{extract_event_blocks, inline_to_store};
|
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
|
use common::*;
|
||||||
use jacquard_common::smol_str::SmolStr;
|
use jacquard_common::smol_str::SmolStr;
|
||||||
use jacquard_repo::commit::Commit;
|
use jacquard_repo::commit::Commit;
|
||||||
use jacquard_repo::mst::{Mst, VerifiedWriteOp};
|
use jacquard_repo::mst::{Mst, VerifiedWriteOp};
|
||||||
use jacquard_repo::storage::BlockStore;
|
use jacquard_repo::storage::BlockStore;
|
||||||
|
use mst_verify::{extract_event_blocks, inline_to_store};
|
||||||
use rand::rngs::StdRng;
|
use rand::rngs::StdRng;
|
||||||
use rand::{Rng, SeedableRng};
|
use rand::{Rng, SeedableRng};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
+10
-12
@@ -1,12 +1,13 @@
|
|||||||
|
mod common;
|
||||||
use tranquil_db_traits::{CommsChannel, CommsStatus, CommsType};
|
use tranquil_db_traits::{CommsChannel, CommsStatus, CommsType};
|
||||||
use tranquil_types::{Did, Recipient};
|
use tranquil_types::{Did, Recipient};
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_enqueue_comms() {
|
async fn test_enqueue_comms() {
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let (_, did) = crate::common::create_account_and_login(&crate::common::client()).await;
|
let (_, did) = common::create_account_and_login(&common::client()).await;
|
||||||
let user_id = crate::common::user_id_of(repos, &Did::new(did).unwrap()).await;
|
let user_id = common::user_id_of(repos, &Did::new(did).unwrap()).await;
|
||||||
let comms_id = repos
|
repos
|
||||||
.infra
|
.infra
|
||||||
.enqueue_comms(
|
.enqueue_comms(
|
||||||
Some(user_id),
|
Some(user_id),
|
||||||
@@ -20,13 +21,10 @@ async fn test_enqueue_comms() {
|
|||||||
.expect("Failed to enqueue comms");
|
.expect("Failed to enqueue comms");
|
||||||
let comms = repos
|
let comms = repos
|
||||||
.infra
|
.infra
|
||||||
.get_latest_comms_for_user(user_id, CommsType::Welcome, 2)
|
.get_latest_comms_for_user(user_id, CommsType::Welcome, 1)
|
||||||
.await
|
.await
|
||||||
.expect("DB error");
|
.expect("DB error");
|
||||||
let row = comms
|
let row = comms.first().expect("Comms not found");
|
||||||
.iter()
|
|
||||||
.find(|c| c.id == comms_id)
|
|
||||||
.expect("Comms not found");
|
|
||||||
assert_eq!(row.user_id, Some(user_id));
|
assert_eq!(row.user_id, Some(user_id));
|
||||||
assert_eq!(row.recipient, "test@nel.pet");
|
assert_eq!(row.recipient, "test@nel.pet");
|
||||||
assert_eq!(row.subject.as_deref(), Some("Test Subject"));
|
assert_eq!(row.subject.as_deref(), Some("Test Subject"));
|
||||||
@@ -38,9 +36,9 @@ async fn test_enqueue_comms() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_comms_queue_status_index() {
|
async fn test_comms_queue_status_index() {
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let (_, did) = crate::common::create_account_and_login(&crate::common::client()).await;
|
let (_, did) = common::create_account_and_login(&common::client()).await;
|
||||||
let user_id = crate::common::user_id_of(repos, &Did::new(did).unwrap()).await;
|
let user_id = common::user_id_of(repos, &Did::new(did).unwrap()).await;
|
||||||
let initial_count = repos
|
let initial_count = repos
|
||||||
.infra
|
.infra
|
||||||
.count_comms_by_type(user_id, CommsType::PasswordReset)
|
.count_comms_by_type(user_id, CommsType::PasswordReset)
|
||||||
@@ -1,6 +1,8 @@
|
|||||||
use crate::common::{base_url, client, get_test_repos};
|
mod common;
|
||||||
use crate::helpers::verify_new_account;
|
mod helpers;
|
||||||
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||||
|
use common::{base_url, client, get_test_repos};
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::{StatusCode, redirect};
|
use reqwest::{StatusCode, redirect};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
+5
-2
@@ -1,7 +1,10 @@
|
|||||||
use crate::common::{base_url, client};
|
mod common;
|
||||||
use crate::helpers::verify_new_account;
|
mod helpers;
|
||||||
|
|
||||||
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::{base_url, client};
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
+10
-7
@@ -1,7 +1,10 @@
|
|||||||
use crate::common::{base_url, client, create_account_and_login};
|
mod common;
|
||||||
use crate::helpers::verify_new_account;
|
mod helpers;
|
||||||
|
|
||||||
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::{base_url, client, create_account_and_login};
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
@@ -56,7 +59,7 @@ async fn setup_mock_client_metadata(redirect_uri: &str) -> MockServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn seed_permission_set(nsid: &str, granular_scope: &str) {
|
async fn seed_permission_set(nsid: &str, granular_scope: &str) {
|
||||||
let state = crate::common::get_test_app_state().await;
|
let state = common::get_test_app_state().await;
|
||||||
let key = tranquil_pds::cache_keys::permission_set_key(
|
let key = tranquil_pds::cache_keys::permission_set_key(
|
||||||
&tranquil_types::Nsid::new(nsid).unwrap(),
|
&tranquil_types::Nsid::new(nsid).unwrap(),
|
||||||
None,
|
None,
|
||||||
@@ -594,7 +597,7 @@ async fn test_grant_row_keeps_include_jwt_carries_expanded() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
let token_id = token_id_from_jwt(&session.access_token);
|
let token_id = token_id_from_jwt(&session.access_token);
|
||||||
let token_data = crate::common::get_test_repos()
|
let token_data = common::get_test_repos()
|
||||||
.await
|
.await
|
||||||
.oauth
|
.oauth
|
||||||
.get_token_by_id(&token_id)
|
.get_token_by_id(&token_id)
|
||||||
@@ -913,7 +916,7 @@ async fn test_consent_post_errors_when_set_unresolvable() {
|
|||||||
"Consent GET should succeed"
|
"Consent GET should succeed"
|
||||||
);
|
);
|
||||||
|
|
||||||
let state = crate::common::get_test_app_state().await;
|
let state = common::get_test_app_state().await;
|
||||||
let key = tranquil_pds::cache_keys::permission_set_key(
|
let key = tranquil_pds::cache_keys::permission_set_key(
|
||||||
&tranquil_types::Nsid::new(UNRESOLVABLE_NSID).unwrap(),
|
&tranquil_types::Nsid::new(UNRESOLVABLE_NSID).unwrap(),
|
||||||
None,
|
None,
|
||||||
@@ -1208,7 +1211,7 @@ async fn test_consent_remember_persists_set_preference() {
|
|||||||
|
|
||||||
let did: tranquil_types::Did = delegated_did.parse().expect("valid did");
|
let did: tranquil_types::Did = delegated_did.parse().expect("valid did");
|
||||||
let client_id_typed = tranquil_types::ClientId::new(client_id.clone());
|
let client_id_typed = tranquil_types::ClientId::new(client_id.clone());
|
||||||
let stored_prefs = crate::common::get_test_repos()
|
let stored_prefs = common::get_test_repos()
|
||||||
.await
|
.await
|
||||||
.oauth
|
.oauth
|
||||||
.get_scope_preferences(&did, &client_id_typed)
|
.get_scope_preferences(&did, &client_id_typed)
|
||||||
@@ -1592,7 +1595,7 @@ async fn test_consent_post_drops_unpresented_scope() {
|
|||||||
let access_token = token_body["access_token"].as_str().unwrap().to_string();
|
let access_token = token_body["access_token"].as_str().unwrap().to_string();
|
||||||
|
|
||||||
let token_id = token_id_from_jwt(&access_token);
|
let token_id = token_id_from_jwt(&access_token);
|
||||||
let token_data = crate::common::get_test_repos()
|
let token_data = common::get_test_repos()
|
||||||
.await
|
.await
|
||||||
.oauth
|
.oauth
|
||||||
.get_token_by_id(&token_id)
|
.get_token_by_id(&token_id)
|
||||||
+5
-2
@@ -1,7 +1,10 @@
|
|||||||
use crate::common::{base_url, client, get_test_repos};
|
mod common;
|
||||||
use crate::helpers::verify_new_account;
|
mod helpers;
|
||||||
|
|
||||||
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::{base_url, client, get_test_repos};
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
+4
-2
@@ -1,8 +1,10 @@
|
|||||||
#![allow(unused_imports)]
|
#![allow(unused_imports)]
|
||||||
use crate::common::{base_url, client, create_account_and_login};
|
mod common;
|
||||||
use crate::helpers::verify_new_account;
|
mod helpers;
|
||||||
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
use base64::{Engine as _, engine::general_purpose::URL_SAFE_NO_PAD};
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::{base_url, client, create_account_and_login};
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
+5
-2
@@ -1,7 +1,10 @@
|
|||||||
use crate::common::{base_url, client, get_test_repos};
|
mod common;
|
||||||
use crate::helpers::verify_new_account;
|
mod helpers;
|
||||||
|
|
||||||
use chrono::{DateTime, Duration, Utc};
|
use chrono::{DateTime, Duration, Utc};
|
||||||
|
use common::{base_url, client, get_test_repos};
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_oauth::{
|
use tranquil_oauth::{
|
||||||
+24
-22
@@ -1,13 +1,15 @@
|
|||||||
use crate::helpers::verify_new_account;
|
mod common;
|
||||||
|
mod helpers;
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_db_traits::CommsType;
|
use tranquil_db_traits::CommsType;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_request_password_reset_creates_code() {
|
async fn test_request_password_reset_creates_code() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let handle = format!("pr{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("pr{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@example.com", handle);
|
let email = format!("{}@example.com", handle);
|
||||||
let payload = json!({
|
let payload = json!({
|
||||||
@@ -53,8 +55,8 @@ async fn test_request_password_reset_creates_code() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_request_password_reset_unknown_email_returns_ok() {
|
async fn test_request_password_reset_unknown_email_returns_ok() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.requestPasswordReset",
|
"{}/xrpc/com.atproto.server.requestPasswordReset",
|
||||||
@@ -69,9 +71,9 @@ async fn test_request_password_reset_unknown_email_returns_ok() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reset_password_with_valid_token() {
|
async fn test_reset_password_with_valid_token() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let handle = format!("pr2{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("pr2{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@example.com", handle);
|
let email = format!("{}@example.com", handle);
|
||||||
let old_password = "Oldpass123!";
|
let old_password = "Oldpass123!";
|
||||||
@@ -165,8 +167,8 @@ async fn test_reset_password_with_valid_token() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reset_password_with_invalid_token() {
|
async fn test_reset_password_with_invalid_token() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.resetPassword",
|
"{}/xrpc/com.atproto.server.resetPassword",
|
||||||
@@ -186,9 +188,9 @@ async fn test_reset_password_with_invalid_token() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reset_password_with_expired_token() {
|
async fn test_reset_password_with_expired_token() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let handle = format!("pr3{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("pr3{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@example.com", handle);
|
let email = format!("{}@example.com", handle);
|
||||||
let payload = json!({
|
let payload = json!({
|
||||||
@@ -247,9 +249,9 @@ async fn test_reset_password_with_expired_token() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reset_password_invalidates_sessions() {
|
async fn test_reset_password_invalidates_sessions() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let handle = format!("pr4{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("pr4{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@example.com", handle);
|
let email = format!("{}@example.com", handle);
|
||||||
let payload = json!({
|
let payload = json!({
|
||||||
@@ -318,8 +320,8 @@ async fn test_reset_password_invalidates_sessions() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_request_password_reset_empty_email() {
|
async fn test_request_password_reset_empty_email() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.requestPasswordReset",
|
"{}/xrpc/com.atproto.server.requestPasswordReset",
|
||||||
@@ -336,9 +338,9 @@ async fn test_request_password_reset_empty_email() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reset_password_creates_notification() {
|
async fn test_reset_password_creates_notification() {
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let handle = format!("pr5{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("pr5{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let email = format!("{}@example.com", handle);
|
let email = format!("{}@example.com", handle);
|
||||||
let payload = json!({
|
let payload = json!({
|
||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use tranquil_types::Did;
|
use tranquil_types::Did;
|
||||||
+2
-1
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::{base_url, client};
|
mod common;
|
||||||
|
use common::{base_url, client};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
+5
-2
@@ -1,6 +1,9 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use jacquard_repo::commit::Commit;
|
use jacquard_repo::commit::Commit;
|
||||||
use jacquard_repo::storage::BlockStore;
|
use jacquard_repo::storage::BlockStore;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
+2
-1
@@ -1,5 +1,6 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_db_traits::{Backlink, BacklinkPath};
|
use tranquil_db_traits::{Backlink, BacklinkPath};
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
use common::*;
|
||||||
use reqwest::{StatusCode, header};
|
use reqwest::{StatusCode, header};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
+4
-2
@@ -1,6 +1,8 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+8
-3
@@ -1,6 +1,9 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::firehose::{FirehoseConsumer, ParsedCommitFrame};
|
mod firehose;
|
||||||
|
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
|
use common::*;
|
||||||
|
use firehose::{FirehoseConsumer, ParsedCommitFrame};
|
||||||
use iroh_car::CarReader;
|
use iroh_car::CarReader;
|
||||||
use jacquard_repo::commit::Commit;
|
use jacquard_repo::commit::Commit;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
@@ -9,6 +12,8 @@ use std::io::Cursor;
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use tranquil_scopes::RepoAction;
|
use tranquil_scopes::RepoAction;
|
||||||
|
|
||||||
|
mod helpers;
|
||||||
|
|
||||||
async fn create_post_record(client: &reqwest::Client, token: &str, did: &str, text: &str) -> Value {
|
async fn create_post_record(client: &reqwest::Client, token: &str, did: &str, text: &str) -> Value {
|
||||||
let payload = json!({
|
let payload = json!({
|
||||||
"repo": did,
|
"repo": did,
|
||||||
@@ -379,7 +384,7 @@ async fn test_firehose_commit_signature_verification() {
|
|||||||
let client = client();
|
let client = client();
|
||||||
let (token, did) = create_account_and_login(&client).await;
|
let (token, did) = create_account_and_login(&client).await;
|
||||||
|
|
||||||
let key_bytes = crate::helpers::get_user_signing_key(&did)
|
let key_bytes = helpers::get_user_signing_key(&did)
|
||||||
.await
|
.await
|
||||||
.expect("Failed to get signing key");
|
.expect("Failed to get signing key");
|
||||||
let signing_key =
|
let signing_key =
|
||||||
+29
-27
@@ -1,3 +1,5 @@
|
|||||||
|
mod common;
|
||||||
|
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
@@ -23,14 +25,14 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn cache_for(nodes: &[crate::common::ServerInstance], idx: usize) -> Arc<dyn Cache> {
|
fn cache_for(nodes: &[common::ServerInstance], idx: usize) -> Arc<dyn Cache> {
|
||||||
nodes[idx]
|
nodes[idx]
|
||||||
.cache
|
.cache
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or_else(|| panic!("node {idx} should have a cache"))
|
.unwrap_or_else(|| panic!("node {idx} should have a cache"))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn rl_for(nodes: &[crate::common::ServerInstance], idx: usize) -> Arc<dyn DistributedRateLimiter> {
|
fn rl_for(nodes: &[common::ServerInstance], idx: usize) -> Arc<dyn DistributedRateLimiter> {
|
||||||
nodes[idx]
|
nodes[idx]
|
||||||
.distributed_rate_limiter
|
.distributed_rate_limiter
|
||||||
.clone()
|
.clone()
|
||||||
@@ -39,10 +41,10 @@ fn rl_for(nodes: &[crate::common::ServerInstance], idx: usize) -> Arc<dyn Distri
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cluster_formation() {
|
async fn cluster_formation() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
assert!(nodes.len() >= 3, "expected at least 3 cluster nodes");
|
assert!(nodes.len() >= 3, "expected at least 3 cluster nodes");
|
||||||
|
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let results: Vec<_> = futures::future::join_all(nodes.iter().map(|node| {
|
let results: Vec<_> = futures::future::join_all(nodes.iter().map(|node| {
|
||||||
let client = client.clone();
|
let client = client.clone();
|
||||||
let url = node.url.clone();
|
let url = node.url.clone();
|
||||||
@@ -69,8 +71,8 @@ async fn cluster_formation() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cluster_any_node_access() {
|
async fn cluster_any_node_access() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
|
|
||||||
let handle = format!("u{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("u{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let payload = serde_json::json!({
|
let payload = serde_json::json!({
|
||||||
@@ -95,7 +97,7 @@ async fn cluster_any_node_access() {
|
|||||||
.expect("no accessJwt")
|
.expect("no accessJwt")
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let user = repos
|
let user = repos
|
||||||
.user
|
.user
|
||||||
.get_by_did(&tranquil_types::Did::new(did.clone()).unwrap())
|
.get_by_did(&tranquil_types::Did::new(did.clone()).unwrap())
|
||||||
@@ -174,7 +176,7 @@ async fn cluster_any_node_access() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cache_convergence() {
|
async fn cache_convergence() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
|
|
||||||
let cache_a = nodes[0].cache.as_ref().expect("node 0 should have a cache");
|
let cache_a = nodes[0].cache.as_ref().expect("node 0 should have a cache");
|
||||||
let cache_b = nodes[1].cache.as_ref().expect("node 1 should have a cache");
|
let cache_b = nodes[1].cache.as_ref().expect("node 1 should have a cache");
|
||||||
@@ -216,7 +218,7 @@ async fn cache_convergence() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn rate_limit_convergence() {
|
async fn rate_limit_convergence() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
|
|
||||||
let rl_a = nodes[0]
|
let rl_a = nodes[0]
|
||||||
.distributed_rate_limiter
|
.distributed_rate_limiter
|
||||||
@@ -272,7 +274,7 @@ async fn rate_limit_convergence() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn delete_convergence() {
|
async fn delete_convergence() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let cache_0 = cache_for(nodes, 0);
|
let cache_0 = cache_for(nodes, 0);
|
||||||
let cache_1 = cache_for(nodes, 1);
|
let cache_1 = cache_for(nodes, 1);
|
||||||
|
|
||||||
@@ -306,7 +308,7 @@ async fn delete_convergence() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn three_node_transitive_convergence() {
|
async fn three_node_transitive_convergence() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let cache_0 = cache_for(nodes, 0);
|
let cache_0 = cache_for(nodes, 0);
|
||||||
let cache_2 = cache_for(nodes, 2);
|
let cache_2 = cache_for(nodes, 2);
|
||||||
|
|
||||||
@@ -329,7 +331,7 @@ async fn three_node_transitive_convergence() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cluster_overwrite_conflict_resolution() {
|
async fn cluster_overwrite_conflict_resolution() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let cache_0 = cache_for(nodes, 0);
|
let cache_0 = cache_for(nodes, 0);
|
||||||
let cache_1 = cache_for(nodes, 1);
|
let cache_1 = cache_for(nodes, 1);
|
||||||
let cache_2 = cache_for(nodes, 2);
|
let cache_2 = cache_for(nodes, 2);
|
||||||
@@ -372,7 +374,7 @@ async fn cluster_overwrite_conflict_resolution() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cluster_bulk_key_convergence() {
|
async fn cluster_bulk_key_convergence() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let cache_0 = cache_for(nodes, 0);
|
let cache_0 = cache_for(nodes, 0);
|
||||||
let cache_1 = cache_for(nodes, 1);
|
let cache_1 = cache_for(nodes, 1);
|
||||||
let cache_2 = cache_for(nodes, 2);
|
let cache_2 = cache_for(nodes, 2);
|
||||||
@@ -431,7 +433,7 @@ async fn cluster_bulk_key_convergence() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cluster_concurrent_multi_node_writes() {
|
async fn cluster_concurrent_multi_node_writes() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let cache_0 = cache_for(nodes, 0);
|
let cache_0 = cache_for(nodes, 0);
|
||||||
let cache_1 = cache_for(nodes, 1);
|
let cache_1 = cache_for(nodes, 1);
|
||||||
let cache_2 = cache_for(nodes, 2);
|
let cache_2 = cache_for(nodes, 2);
|
||||||
@@ -540,7 +542,7 @@ async fn cluster_concurrent_multi_node_writes() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cluster_rate_limit_multi_node_convergence() {
|
async fn cluster_rate_limit_multi_node_convergence() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let rl_0 = rl_for(nodes, 0);
|
let rl_0 = rl_for(nodes, 0);
|
||||||
let rl_1 = rl_for(nodes, 1);
|
let rl_1 = rl_for(nodes, 1);
|
||||||
let rl_2 = rl_for(nodes, 2);
|
let rl_2 = rl_for(nodes, 2);
|
||||||
@@ -630,7 +632,7 @@ fn create_account_on_node<'a>(
|
|||||||
.expect("no accessJwt")
|
.expect("no accessJwt")
|
||||||
.to_string();
|
.to_string();
|
||||||
|
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let user = repos
|
let user = repos
|
||||||
.user
|
.user
|
||||||
.get_by_did(&tranquil_types::Did::new(did.clone()).unwrap())
|
.get_by_did(&tranquil_types::Did::new(did.clone()).unwrap())
|
||||||
@@ -687,9 +689,9 @@ fn create_account_on_node<'a>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn jail_cross_node_rate_limit_via_login() {
|
async fn cross_node_rate_limit_via_login() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
|
|
||||||
let now_ms = u64::try_from(
|
let now_ms = u64::try_from(
|
||||||
std::time::SystemTime::now()
|
std::time::SystemTime::now()
|
||||||
@@ -770,8 +772,8 @@ async fn jail_cross_node_rate_limit_via_login() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cross_node_handle_resolution_from_cache() {
|
async fn cross_node_handle_resolution_from_cache() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let cache_0 = cache_for(nodes, 0);
|
let cache_0 = cache_for(nodes, 0);
|
||||||
|
|
||||||
let fake_handle = format!("cached-{}.test", uuid::Uuid::new_v4().simple());
|
let fake_handle = format!("cached-{}.test", uuid::Uuid::new_v4().simple());
|
||||||
@@ -823,8 +825,8 @@ async fn cross_node_handle_resolution_from_cache() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cross_node_cache_delete_observable_via_http() {
|
async fn cross_node_cache_delete_observable_via_http() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let cache_0 = cache_for(nodes, 0);
|
let cache_0 = cache_for(nodes, 0);
|
||||||
let cache_1 = cache_for(nodes, 1);
|
let cache_1 = cache_for(nodes, 1);
|
||||||
|
|
||||||
@@ -890,8 +892,8 @@ async fn cross_node_cache_delete_observable_via_http() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cross_node_email_update_status() {
|
async fn cross_node_email_update_status() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let cache_0 = cache_for(nodes, 0);
|
let cache_0 = cache_for(nodes, 0);
|
||||||
let cache_1 = cache_for(nodes, 1);
|
let cache_1 = cache_for(nodes, 1);
|
||||||
|
|
||||||
@@ -965,8 +967,8 @@ async fn cross_node_email_update_status() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn cross_node_session_revocation() {
|
async fn cross_node_session_revocation() {
|
||||||
let nodes = crate::common::cluster().await;
|
let nodes = common::cluster().await;
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
|
|
||||||
let (token, _did) = create_account_on_node(&client, &nodes[0].url).await;
|
let (token, _did) = create_account_on_node(&client, &nodes[0].url).await;
|
||||||
|
|
||||||
+2
-1
@@ -1,3 +1,4 @@
|
|||||||
|
mod common;
|
||||||
use tranquil_pds::comms::{SendError, is_valid_phone_number};
|
use tranquil_pds::comms::{SendError, is_valid_phone_number};
|
||||||
use tranquil_pds::image::{ImageError, ImageProcessor};
|
use tranquil_pds::image::{ImageError, ImageProcessor};
|
||||||
|
|
||||||
@@ -83,7 +84,7 @@ fn test_send_error_display() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_signup_queue_authentication() {
|
async fn test_signup_queue_authentication() {
|
||||||
use crate::common::{base_url, client, create_account_and_login};
|
use common::{base_url, client, create_account_and_login};
|
||||||
let base = base_url().await;
|
let base = base_url().await;
|
||||||
let http_client = client();
|
let http_client = client();
|
||||||
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::verify_new_account;
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
+24
-22
@@ -1,11 +1,13 @@
|
|||||||
use crate::helpers::verify_new_account;
|
mod common;
|
||||||
|
mod helpers;
|
||||||
|
use helpers::verify_new_account;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reserve_signing_key_without_did() {
|
async fn test_reserve_signing_key_without_did() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
||||||
@@ -27,9 +29,9 @@ async fn test_reserve_signing_key_without_did() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reserve_signing_key_with_did() {
|
async fn test_reserve_signing_key_with_did() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let target_did = "did:plc:test123456";
|
let target_did = "did:plc:test123456";
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
@@ -58,9 +60,9 @@ async fn test_reserve_signing_key_with_did() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reserve_signing_key_stores_private_key() {
|
async fn test_reserve_signing_key_stores_private_key() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
||||||
@@ -98,8 +100,8 @@ async fn test_reserve_signing_key_stores_private_key() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reserve_signing_key_unique_keys() {
|
async fn test_reserve_signing_key_unique_keys() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res1 = client
|
let res1 = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
||||||
@@ -129,8 +131,8 @@ async fn test_reserve_signing_key_unique_keys() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reserve_signing_key_is_public() {
|
async fn test_reserve_signing_key_is_public() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
||||||
@@ -149,9 +151,9 @@ async fn test_reserve_signing_key_is_public() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_create_account_with_reserved_signing_key() {
|
async fn test_create_account_with_reserved_signing_key() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let repos = crate::common::get_test_repos().await;
|
let repos = common::get_test_repos().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
||||||
@@ -201,8 +203,8 @@ async fn test_create_account_with_reserved_signing_key() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_create_account_with_invalid_signing_key() {
|
async fn test_create_account_with_invalid_signing_key() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let handle = format!("bk{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
let handle = format!("bk{}", &uuid::Uuid::new_v4().simple().to_string()[..12]);
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
@@ -225,8 +227,8 @@ async fn test_create_account_with_invalid_signing_key() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_create_account_cannot_reuse_signing_key() {
|
async fn test_create_account_cannot_reuse_signing_key() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
||||||
@@ -278,8 +280,8 @@ async fn test_create_account_cannot_reuse_signing_key() {
|
|||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_reserved_key_tokens_work() {
|
async fn test_reserved_key_tokens_work() {
|
||||||
let client = crate::common::client();
|
let client = common::client();
|
||||||
let base_url = crate::common::base_url().await;
|
let base_url = common::base_url().await;
|
||||||
let res = client
|
let res = client
|
||||||
.post(format!(
|
.post(format!(
|
||||||
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
"{}/xrpc/com.atproto.server.reserveSigningKey",
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
use crate::common::{base_url, client, create_account_and_login, get_test_repos};
|
mod common;
|
||||||
|
|
||||||
|
use common::{base_url, client, create_account_and_login, get_test_repos};
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
use tranquil_db_traits::{CommsChannel, CommsType, SsoAction, SsoProviderType};
|
use tranquil_db_traits::{CommsChannel, CommsType, SsoAction, SsoProviderType};
|
||||||
+7
-4
@@ -1,3 +1,6 @@
|
|||||||
|
mod common;
|
||||||
|
mod helpers;
|
||||||
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tranquil_db::PostgresRepositories;
|
use tranquil_db::PostgresRepositories;
|
||||||
use tranquil_db_traits::{Backlink, BacklinkPath, CommsChannel, CommsType};
|
use tranquil_db_traits::{Backlink, BacklinkPath, CommsChannel, CommsType};
|
||||||
@@ -82,7 +85,7 @@ async fn create_store_repos() -> Arc<PostgresRepositories> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn create_pg_repos() -> Arc<PostgresRepositories> {
|
async fn create_pg_repos() -> Arc<PostgresRepositories> {
|
||||||
let db_url = crate::common::get_db_connection_string().await;
|
let db_url = common::get_db_connection_string().await;
|
||||||
let pool = sqlx::postgres::PgPoolOptions::new()
|
let pool = sqlx::postgres::PgPoolOptions::new()
|
||||||
.max_connections(5)
|
.max_connections(5)
|
||||||
.connect(&db_url)
|
.connect(&db_url)
|
||||||
@@ -114,7 +117,7 @@ fn test_handle(suffix: &str) -> Handle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn test_cid(seed: u8) -> CidLink {
|
fn test_cid(seed: u8) -> CidLink {
|
||||||
CidLink::from_cid(&crate::helpers::make_cid(&[seed]))
|
CidLink::from_cid(&helpers::make_cid(&[seed]))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_nsid(name: &str) -> Nsid {
|
fn test_nsid(name: &str) -> Nsid {
|
||||||
@@ -136,7 +139,7 @@ fn test_at_uri(did: &Did, collection: &Nsid, rkey: &Rkey) -> AtUri {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn seed_user(repos: &PostgresRepositories, did: &Did, handle: &Handle) -> Uuid {
|
async fn seed_user(repos: &PostgresRepositories, did: &Did, handle: &Handle) -> Uuid {
|
||||||
let commit_cid = CidLink::from_cid(&crate::helpers::make_cid(did.as_str().as_bytes()));
|
let commit_cid = CidLink::from_cid(&helpers::make_cid(did.as_str().as_bytes()));
|
||||||
let input = tranquil_db_traits::CreatePasswordAccountInput {
|
let input = tranquil_db_traits::CreatePasswordAccountInput {
|
||||||
handle: handle.clone(),
|
handle: handle.clone(),
|
||||||
email: None,
|
email: None,
|
||||||
@@ -1777,7 +1780,7 @@ async fn parity_prune_events_older_than() {
|
|||||||
let baseline = f.pg.repo.get_max_seq().await.unwrap();
|
let baseline = f.pg.repo.get_max_seq().await.unwrap();
|
||||||
f.pg.repo.insert_commit_event(&event).await.unwrap();
|
f.pg.repo.insert_commit_event(&event).await.unwrap();
|
||||||
f.store.repo.insert_commit_event(&event).await.unwrap();
|
f.store.repo.insert_commit_event(&event).await.unwrap();
|
||||||
let pg_seq = crate::common::sequenced_event_for_did(&f.pg, baseline, &did)
|
let pg_seq = common::sequenced_event_for_did(&f.pg, baseline, &did)
|
||||||
.await
|
.await
|
||||||
.seq;
|
.seq;
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
|
use common::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use reqwest::header;
|
use reqwest::header;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
+5
-2
@@ -1,5 +1,8 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
+4
-2
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use reqwest::header;
|
use reqwest::header;
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
+4
-2
@@ -1,6 +1,8 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
|
use helpers::*;
|
||||||
use reqwest::StatusCode;
|
use reqwest::StatusCode;
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::sync::LazyLock;
|
use std::sync::LazyLock;
|
||||||
+1
@@ -1,6 +1,7 @@
|
|||||||
use bytes::Bytes;
|
use bytes::Bytes;
|
||||||
use cid::Cid;
|
use cid::Cid;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
mod common;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[ignore = "depends on external live server state; run manually with --ignored"]
|
#[ignore = "depends on external live server state; run manually with --ignored"]
|
||||||
+8
-5
@@ -1,7 +1,10 @@
|
|||||||
use crate::common::*;
|
mod common;
|
||||||
use crate::helpers::*;
|
mod helpers;
|
||||||
|
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
|
use common::*;
|
||||||
use futures::{StreamExt, future::join_all};
|
use futures::{StreamExt, future::join_all};
|
||||||
|
use helpers::*;
|
||||||
use k256::ecdsa::SigningKey;
|
use k256::ecdsa::SigningKey;
|
||||||
use reqwest::{StatusCode, header};
|
use reqwest::{StatusCode, header};
|
||||||
use serde_json::{Value, json};
|
use serde_json::{Value, json};
|
||||||
@@ -1168,7 +1171,7 @@ async fn test_backup_restore_workflow() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn jail_test_scale_1000_posts_with_pagination() {
|
async fn test_scale_1000_posts_with_pagination() {
|
||||||
let client = client();
|
let client = client();
|
||||||
let base = base_url().await;
|
let base = base_url().await;
|
||||||
let (did, jwt) = setup_new_user("scale-posts").await;
|
let (did, jwt) = setup_new_user("scale-posts").await;
|
||||||
@@ -1279,7 +1282,7 @@ async fn jail_test_scale_1000_posts_with_pagination() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn jail_test_scale_many_users_social_graph() {
|
async fn test_scale_many_users_social_graph() {
|
||||||
let client = client();
|
let client = client();
|
||||||
let base = base_url().await;
|
let base = base_url().await;
|
||||||
|
|
||||||
@@ -1690,7 +1693,7 @@ async fn test_scale_batch_operations() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn jail_test_scale_reply_thread_depth() {
|
async fn test_scale_reply_thread_depth() {
|
||||||
let client = client();
|
let client = client();
|
||||||
let base = base_url().await;
|
let base = base_url().await;
|
||||||
let (did, jwt) = setup_new_user("deep-thread").await;
|
let (did, jwt) = setup_new_user("deep-thread").await;
|
||||||
@@ -1327,7 +1327,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn jail_timed_out_write_resets_stream_instead_of_truncating() {
|
async fn timed_out_write_resets_stream_instead_of_truncating() {
|
||||||
let shutdown = CancellationToken::new();
|
let shutdown = CancellationToken::new();
|
||||||
let (sender, _rx_sender) =
|
let (sender, _rx_sender) =
|
||||||
Transport::bind("127.0.0.1:0".parse().unwrap(), None, shutdown.clone())
|
Transport::bind("127.0.0.1:0".parse().unwrap(), None, shutdown.clone())
|
||||||
@@ -1368,7 +1368,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn jail_write_timeout_keeps_connection() {
|
async fn write_timeout_keeps_connection() {
|
||||||
use futures::StreamExt;
|
use futures::StreamExt;
|
||||||
|
|
||||||
let shutdown = CancellationToken::new();
|
let shutdown = CancellationToken::new();
|
||||||
|
|||||||
@@ -36,22 +36,8 @@ async fn spawn_pair(
|
|||||||
.await
|
.await
|
||||||
.expect("node B failed to start");
|
.expect("node B failed to start");
|
||||||
|
|
||||||
cache_a
|
tokio::time::sleep(Duration::from_millis(2000)).await;
|
||||||
.set("__ready_a", "1", Duration::from_secs(60))
|
|
||||||
.await
|
|
||||||
.expect("readiness probe on A failed");
|
|
||||||
cache_b
|
|
||||||
.set("__ready_b", "1", Duration::from_secs(60))
|
|
||||||
.await
|
|
||||||
.expect("readiness probe on B failed");
|
|
||||||
poll_until(10_000, 50, || {
|
|
||||||
let cache_a = cache_a.clone();
|
|
||||||
let cache_b = cache_b.clone();
|
|
||||||
async move {
|
|
||||||
cache_b.get("__ready_a").await.is_some() && cache_a.get("__ready_b").await.is_some()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.await;
|
|
||||||
((cache_a, rl_a), (cache_b, rl_b))
|
((cache_a, rl_a), (cache_b, rl_b))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -794,5 +780,7 @@ async fn two_node_stress_concurrent_load() {
|
|||||||
r.unwrap_or_else(|e| panic!("task {i} panicked: {e}"));
|
r.unwrap_or_else(|e| panic!("task {i} panicked: {e}"));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
tokio::time::sleep(Duration::from_secs(12)).await;
|
||||||
|
|
||||||
shutdown.cancel();
|
shutdown.cancel();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,11 @@ fn blob_covers(g: &BlobScope, r: &BlobScope) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn rpc_covers(g: &RpcScope, r: &RpcScope) -> bool {
|
fn rpc_covers(g: &RpcScope, r: &RpcScope) -> bool {
|
||||||
let lxm_ok = g.lxm == "*" || g.lxm == r.lxm;
|
let lxm_ok = match &g.lxm {
|
||||||
|
None => true,
|
||||||
|
Some(gl) if gl == "*" => true,
|
||||||
|
Some(gl) => r.lxm.as_deref() == Some(gl.as_str()),
|
||||||
|
};
|
||||||
let aud_ok = match &g.aud {
|
let aud_ok = match &g.aud {
|
||||||
None => true,
|
None => true,
|
||||||
Some(ga) if ga == "*" => true,
|
Some(ga) if ga == "*" => true,
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ impl BlobScope {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||||
pub struct RpcScope {
|
pub struct RpcScope {
|
||||||
pub lxm: String,
|
pub lxm: Option<String>,
|
||||||
pub aud: Option<String>,
|
pub aud: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -245,10 +245,9 @@ pub fn parse_scope(scope: &str) -> ParsedScope {
|
|||||||
let lxm = lxm_positional.or_else(|| params.get("lxm").and_then(|v| v.first().cloned()));
|
let lxm = lxm_positional.or_else(|| params.get("lxm").and_then(|v| v.first().cloned()));
|
||||||
let aud = params.get("aud").and_then(|v| v.first().cloned());
|
let aud = params.get("aud").and_then(|v| v.first().cloned());
|
||||||
|
|
||||||
let Some(lxm) = lxm else {
|
let is_lxm_wildcard = lxm.as_deref() == Some("*") || lxm.is_none();
|
||||||
return ParsedScope::Unknown(scope.to_string());
|
let is_aud_wildcard = aud.as_deref() == Some("*");
|
||||||
};
|
if is_lxm_wildcard && is_aud_wildcard {
|
||||||
if lxm == "*" && aud.as_deref() == Some("*") {
|
|
||||||
return ParsedScope::Unknown(scope.to_string());
|
return ParsedScope::Unknown(scope.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,7 +400,7 @@ mod tests {
|
|||||||
let scope = parse_scope("rpc:app.bsky.feed.getTimeline?aud=did:web:api.bsky.app");
|
let scope = parse_scope("rpc:app.bsky.feed.getTimeline?aud=did:web:api.bsky.app");
|
||||||
match scope {
|
match scope {
|
||||||
ParsedScope::Rpc(r) => {
|
ParsedScope::Rpc(r) => {
|
||||||
assert_eq!(r.lxm, "app.bsky.feed.getTimeline");
|
assert_eq!(r.lxm, Some("app.bsky.feed.getTimeline".to_string()));
|
||||||
assert_eq!(r.aud, Some("did:web:api.bsky.app".to_string()));
|
assert_eq!(r.aud, Some("did:web:api.bsky.app".to_string()));
|
||||||
}
|
}
|
||||||
_ => panic!("Expected Rpc scope"),
|
_ => panic!("Expected Rpc scope"),
|
||||||
@@ -511,12 +510,6 @@ mod tests {
|
|||||||
assert!(matches!(scope4, ParsedScope::Rpc(_)));
|
assert!(matches!(scope4, ParsedScope::Rpc(_)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_rpc_lxm_required() {
|
|
||||||
let bare = parse_scope("rpc");
|
|
||||||
assert!(matches!(bare, ParsedScope::Unknown(_)));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_url_encoded_aud_with_fragment() {
|
fn test_url_encoded_aud_with_fragment() {
|
||||||
let scope =
|
let scope =
|
||||||
@@ -534,7 +527,10 @@ mod tests {
|
|||||||
);
|
);
|
||||||
match scope2 {
|
match scope2 {
|
||||||
ParsedScope::Rpc(r) => {
|
ParsedScope::Rpc(r) => {
|
||||||
assert_eq!(r.lxm, "com.atproto.moderation.createReport");
|
assert_eq!(
|
||||||
|
r.lxm,
|
||||||
|
Some("com.atproto.moderation.createReport".to_string())
|
||||||
|
);
|
||||||
assert_eq!(r.aud, Some("did:web:api.bsky.app#bsky_appview".to_string()));
|
assert_eq!(r.aud, Some("did:web:api.bsky.app#bsky_appview".to_string()));
|
||||||
}
|
}
|
||||||
_ => panic!("Expected Rpc scope"),
|
_ => panic!("Expected Rpc scope"),
|
||||||
|
|||||||
@@ -49,7 +49,10 @@ impl ScopePermissions {
|
|||||||
pub fn superseded_by_transition_generic(scope: &ParsedScope) -> bool {
|
pub fn superseded_by_transition_generic(scope: &ParsedScope) -> bool {
|
||||||
match scope {
|
match scope {
|
||||||
ParsedScope::Repo(_) | ParsedScope::Blob(_) => true,
|
ParsedScope::Repo(_) | ParsedScope::Blob(_) => true,
|
||||||
ParsedScope::Rpc(rpc) => !(rpc.lxm == "*" || rpc.lxm.starts_with("chat.bsky.")),
|
ParsedScope::Rpc(rpc) => !rpc
|
||||||
|
.lxm
|
||||||
|
.as_deref()
|
||||||
|
.is_some_and(|lxm| lxm == "*" || lxm.starts_with("chat.bsky.")),
|
||||||
ParsedScope::Account(_)
|
ParsedScope::Account(_)
|
||||||
| ParsedScope::Identity(_)
|
| ParsedScope::Identity(_)
|
||||||
| ParsedScope::TransitionEmail
|
| ParsedScope::TransitionEmail
|
||||||
@@ -190,9 +193,9 @@ impl ScopePermissions {
|
|||||||
|
|
||||||
let has_permission = self.find_rpc_scopes().any(|rpc_scope| {
|
let has_permission = self.find_rpc_scopes().any(|rpc_scope| {
|
||||||
let lxm_matches = match &rpc_scope.lxm {
|
let lxm_matches = match &rpc_scope.lxm {
|
||||||
scope_lxm if scope_lxm == "*" => true,
|
None => true,
|
||||||
scope_lxm if scope_lxm == lxm => true,
|
Some(scope_lxm) if scope_lxm == lxm => true,
|
||||||
scope_lxm if scope_lxm.ends_with(".*") => {
|
Some(scope_lxm) if scope_lxm.ends_with(".*") => {
|
||||||
let prefix = scope_lxm.strip_suffix(".*").unwrap();
|
let prefix = scope_lxm.strip_suffix(".*").unwrap();
|
||||||
lxm.starts_with(prefix) && lxm.chars().nth(prefix.len()) == Some('.')
|
lxm.starts_with(prefix) && lxm.chars().nth(prefix.len()) == Some('.')
|
||||||
}
|
}
|
||||||
@@ -200,7 +203,7 @@ impl ScopePermissions {
|
|||||||
};
|
};
|
||||||
|
|
||||||
let aud_matches = match &rpc_scope.aud {
|
let aud_matches = match &rpc_scope.aud {
|
||||||
None => false,
|
None => true,
|
||||||
Some(scope_aud) if scope_aud == "*" => true,
|
Some(scope_aud) if scope_aud == "*" => true,
|
||||||
Some(scope_aud) => scope_aud == aud,
|
Some(scope_aud) => scope_aud == aud,
|
||||||
};
|
};
|
||||||
@@ -471,24 +474,6 @@ mod tests {
|
|||||||
assert!(!perms.allows_rpc("did:web:api.bsky.app", &c("app.bsky.feed.getAuthorFeed")));
|
assert!(!perms.allows_rpc("did:web:api.bsky.app", &c("app.bsky.feed.getAuthorFeed")));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_rpc_wildcard_lxm() {
|
|
||||||
let perms = ScopePermissions::from_scope_string(Some(
|
|
||||||
"rpc:*?aud=did:web:api.bsky.app#bsky_appview",
|
|
||||||
));
|
|
||||||
let aud = "did:web:api.bsky.app#bsky_appview";
|
|
||||||
let other = "did:web:other.app#bsky_appview";
|
|
||||||
assert!(perms.allows_rpc(aud, &c("app.bsky.feed.getTimeline")));
|
|
||||||
assert!(!perms.allows_rpc(other, &c("app.bsky.feed.getTimeline")));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_rpc_wildcard_lxm_without_aud() {
|
|
||||||
let perms = ScopePermissions::from_scope_string(Some("rpc:*"));
|
|
||||||
let aud = "did:web:api.bsky.app#bsky_appview";
|
|
||||||
assert!(!perms.allows_rpc(aud, &c("app.bsky.feed.getTimeline")));
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_granular_account() {
|
fn test_granular_account() {
|
||||||
let perms = ScopePermissions::from_scope_string(Some("account:email?action=read"));
|
let perms = ScopePermissions::from_scope_string(Some("account:email?action=read"));
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ edition.workspace = true
|
|||||||
license.workspace = true
|
license.workspace = true
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
s3 = ["dep:aws-config", "dep:aws-sdk-s3", "dep:aws-smithy-http-client"]
|
s3 = ["dep:aws-config", "dep:aws-sdk-s3"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tranquil-config = { workspace = true }
|
tranquil-config = { workspace = true }
|
||||||
@@ -14,7 +14,6 @@ tranquil-infra = { workspace = true }
|
|||||||
async-trait = { workspace = true }
|
async-trait = { workspace = true }
|
||||||
aws-config = { workspace = true, optional = true }
|
aws-config = { workspace = true, optional = true }
|
||||||
aws-sdk-s3 = { workspace = true, optional = true }
|
aws-sdk-s3 = { workspace = true, optional = true }
|
||||||
aws-smithy-http-client = { workspace = true, optional = true }
|
|
||||||
bytes = { workspace = true }
|
bytes = { workspace = true }
|
||||||
futures = { workspace = true }
|
futures = { workspace = true }
|
||||||
sha2 = { workspace = true }
|
sha2 = { workspace = true }
|
||||||
|
|||||||
@@ -151,15 +151,8 @@ mod s3 {
|
|||||||
async fn create_s3_client() -> Client {
|
async fn create_s3_client() -> Client {
|
||||||
let region_provider = RegionProviderChain::default_provider().or_else("us-east-1");
|
let region_provider = RegionProviderChain::default_provider().or_else("us-east-1");
|
||||||
|
|
||||||
let http_client = aws_smithy_http_client::Builder::new()
|
|
||||||
.tls_provider(aws_smithy_http_client::tls::Provider::Rustls(
|
|
||||||
aws_smithy_http_client::tls::rustls_provider::CryptoMode::Ring,
|
|
||||||
))
|
|
||||||
.build_https();
|
|
||||||
|
|
||||||
let config = aws_config::defaults(BehaviorVersion::latest())
|
let config = aws_config::defaults(BehaviorVersion::latest())
|
||||||
.region(region_provider)
|
.region(region_provider)
|
||||||
.http_client(http_client)
|
|
||||||
.load()
|
.load()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ test-harness = ["dep:tempfile"]
|
|||||||
jemalloc = ["dep:tikv-jemallocator"]
|
jemalloc = ["dep:tikv-jemallocator"]
|
||||||
gauntlet-cli = ["test-harness", "dep:clap", "dep:toml", "dep:tracing-subscriber", "jemalloc"]
|
gauntlet-cli = ["test-harness", "dep:clap", "dep:toml", "dep:tracing-subscriber", "jemalloc"]
|
||||||
gauntlet-jemalloc-prof = []
|
gauntlet-jemalloc-prof = []
|
||||||
skip-fsync = []
|
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "tranquil-gauntlet"
|
name = "tranquil-gauntlet"
|
||||||
|
|||||||
@@ -267,16 +267,10 @@ impl StorageIO for RealIO {
|
|||||||
self.lookup(id)?.write_at(buf, offset)
|
self.lookup(id)?.write_at(buf, offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "skip-fsync"))]
|
|
||||||
fn sync(&self, id: FileId) -> io::Result<()> {
|
fn sync(&self, id: FileId) -> io::Result<()> {
|
||||||
self.lookup(id)?.sync_data()
|
self.lookup(id)?.sync_data()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "skip-fsync")]
|
|
||||||
fn sync(&self, id: FileId) -> io::Result<()> {
|
|
||||||
self.lookup(id).map(|_| ())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn file_size(&self, id: FileId) -> io::Result<u64> {
|
fn file_size(&self, id: FileId) -> io::Result<u64> {
|
||||||
self.lookup(id)?.metadata().map(|m| m.len())
|
self.lookup(id)?.metadata().map(|m| m.len())
|
||||||
}
|
}
|
||||||
@@ -297,16 +291,10 @@ impl StorageIO for RealIO {
|
|||||||
fs::create_dir_all(path)
|
fs::create_dir_all(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(feature = "skip-fsync"))]
|
|
||||||
fn sync_dir(&self, path: &Path) -> io::Result<()> {
|
fn sync_dir(&self, path: &Path) -> io::Result<()> {
|
||||||
fs::File::open(path)?.sync_all()
|
fs::File::open(path)?.sync_all()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "skip-fsync")]
|
|
||||||
fn sync_dir(&self, path: &Path) -> io::Result<()> {
|
|
||||||
fs::File::open(path).map(|_| ())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn list_dir(&self, path: &Path) -> io::Result<Vec<PathBuf>> {
|
fn list_dir(&self, path: &Path) -> io::Result<Vec<PathBuf>> {
|
||||||
fs::read_dir(path)?
|
fs::read_dir(path)?
|
||||||
.map(|entry| entry.map(|e| e.path()))
|
.map(|entry| entry.map(|e| e.path()))
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user