Merge remote-tracking branch 'origin/devel' into david/test-admin
This commit is contained in:
commit
d613969c3e
87
Cargo.lock
generated
87
Cargo.lock
generated
@ -14,9 +14,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "addr2line"
|
name = "addr2line"
|
||||||
version = "0.19.0"
|
version = "0.20.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97"
|
checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gimli",
|
"gimli",
|
||||||
]
|
]
|
||||||
@ -289,7 +289,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -377,7 +377,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -413,13 +413,13 @@ checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-trait"
|
name = "async-trait"
|
||||||
version = "0.1.68"
|
version = "0.1.69"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842"
|
checksum = "7b2d0f03b3640e3a630367e40c468cb7f309529c708ed1d88597047b0e7c6ef7"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -561,20 +561,20 @@ dependencies = [
|
|||||||
"heck 0.4.1",
|
"heck 0.4.1",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "backtrace"
|
name = "backtrace"
|
||||||
version = "0.3.67"
|
version = "0.3.68"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca"
|
checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"addr2line",
|
"addr2line",
|
||||||
"cc",
|
"cc",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
"miniz_oxide 0.6.2",
|
"miniz_oxide",
|
||||||
"object",
|
"object",
|
||||||
"rustc-demangle",
|
"rustc-demangle",
|
||||||
]
|
]
|
||||||
@ -1884,7 +1884,7 @@ dependencies = [
|
|||||||
"reqwest",
|
"reqwest",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
"toml 0.7.5",
|
"toml 0.7.5",
|
||||||
"walkdir",
|
"walkdir",
|
||||||
]
|
]
|
||||||
@ -1902,7 +1902,7 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -1928,7 +1928,7 @@ dependencies = [
|
|||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"strum 0.24.1",
|
"strum 0.24.1",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
"tempfile",
|
"tempfile",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
"tiny-keccak",
|
"tiny-keccak",
|
||||||
@ -2161,7 +2161,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743"
|
checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crc32fast",
|
"crc32fast",
|
||||||
"miniz_oxide 0.7.1",
|
"miniz_oxide",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -2347,7 +2347,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -3381,15 +3381,6 @@ version = "0.2.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "miniz_oxide"
|
|
||||||
version = "0.6.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa"
|
|
||||||
dependencies = [
|
|
||||||
"adler",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
@ -3668,14 +3659,14 @@ dependencies = [
|
|||||||
"proc-macro-crate 1.3.1",
|
"proc-macro-crate 1.3.1",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "object"
|
name = "object"
|
||||||
version = "0.30.4"
|
version = "0.31.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385"
|
checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
@ -3740,7 +3731,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4027,7 +4018,7 @@ dependencies = [
|
|||||||
"pest_meta",
|
"pest_meta",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4091,7 +4082,7 @@ dependencies = [
|
|||||||
"phf_shared 0.11.2",
|
"phf_shared 0.11.2",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4129,7 +4120,7 @@ checksum = "d1fef411b303e3e12d534fb6e7852de82da56edd937d895125821fb7c09436c7"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4223,7 +4214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||||||
checksum = "9825a04601d60621feed79c4e6b56d65db77cdca55cef43b46b0de1096d1c282"
|
checksum = "9825a04601d60621feed79c4e6b56d65db77cdca55cef43b46b0de1096d1c282"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -4542,9 +4533,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rdkafka"
|
name = "rdkafka"
|
||||||
version = "0.32.2"
|
version = "0.33.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f8733bc5dc0b192d1a4b28073f9bff1326ad9e4fecd4d9b025d6fc358d1c3e79"
|
checksum = "8c613d9892f835d4593a769ee274716b0c4403b80e8f57ac0f773b815738cda8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
@ -5469,22 +5460,22 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.164"
|
version = "1.0.166"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d"
|
checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.164"
|
version = "1.0.166"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68"
|
checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -6047,7 +6038,7 @@ dependencies = [
|
|||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"rustversion",
|
"rustversion",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -6089,9 +6080,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "syn"
|
name = "syn"
|
||||||
version = "2.0.22"
|
version = "2.0.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616"
|
checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -6184,7 +6175,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -6339,7 +6330,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -6595,7 +6586,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -7014,7 +7005,7 @@ dependencies = [
|
|||||||
"once_cell",
|
"once_cell",
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -7048,7 +7039,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.22",
|
"syn 2.0.23",
|
||||||
"wasm-bindgen-backend",
|
"wasm-bindgen-backend",
|
||||||
"wasm-bindgen-shared",
|
"wasm-bindgen-shared",
|
||||||
]
|
]
|
||||||
|
@ -12,6 +12,6 @@ path = "src/mod.rs"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
ethers = { version = "2.0.7", default-features = false }
|
ethers = { version = "2.0.7", default-features = false }
|
||||||
sea-orm = "0.11.3"
|
sea-orm = "0.11.3"
|
||||||
serde = "1.0.164"
|
serde = "1.0.166"
|
||||||
ulid = "1.0.0"
|
ulid = "1.0.0"
|
||||||
uuid = "1.4.0"
|
uuid = "1.4.0"
|
||||||
|
@ -9,7 +9,7 @@ edition = "2021"
|
|||||||
flume = "0.10.14"
|
flume = "0.10.14"
|
||||||
log = "0.4.19"
|
log = "0.4.19"
|
||||||
portable-atomic = { version = "1.3.3", features = ["float"] }
|
portable-atomic = { version = "1.3.3", features = ["float"] }
|
||||||
serde = { version = "1.0.164", features = [] }
|
serde = { version = "1.0.166", features = [] }
|
||||||
tokio = { version = "1.29.1", features = ["full"] }
|
tokio = { version = "1.29.1", features = ["full"] }
|
||||||
tracing = "0.1.37"
|
tracing = "0.1.37"
|
||||||
watermill = "0.1.1"
|
watermill = "0.1.1"
|
||||||
|
@ -5,7 +5,7 @@ fn main() {
|
|||||||
// Tell Cargo that if the given file changes, to rerun this build script.
|
// Tell Cargo that if the given file changes, to rerun this build script.
|
||||||
glob("./abi/*.json").unwrap().for_each(|x| {
|
glob("./abi/*.json").unwrap().for_each(|x| {
|
||||||
if let Ok(x) = x {
|
if let Ok(x) = x {
|
||||||
println!("cargo:rerun-if-changed={:?}", x);
|
println!("cargo:rerun-if-changed={}", x.display());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -43,8 +43,8 @@ siwe = { git = "https://github.com/llamanodes/siwe-rs", rev = "013be5204ff1c8577
|
|||||||
anyhow = { version = "1.0.71", features = ["backtrace"] }
|
anyhow = { version = "1.0.71", features = ["backtrace"] }
|
||||||
arc-swap = { version = "1.6.0" }
|
arc-swap = { version = "1.6.0" }
|
||||||
argh = "0.1.10"
|
argh = "0.1.10"
|
||||||
async-stripe = { version = "0.22.2", default-features = false, features = ["full", "runtime-tokio-hyper-rustls", "webhook-events"] }
|
async-stripe = { version = "0.22.2", default-features = false, features = ["billing", "checkout", "connect", "runtime-tokio-hyper-rustls", "webhook-events"] }
|
||||||
async-trait = "0.1.68"
|
async-trait = "0.1.69"
|
||||||
axum = { version = "0.6.18", features = ["headers", "tracing", "ws"] }
|
axum = { version = "0.6.18", features = ["headers", "tracing", "ws"] }
|
||||||
axum-client-ip = "0.4.1"
|
axum-client-ip = "0.4.1"
|
||||||
axum-macros = "0.3.7"
|
axum-macros = "0.3.7"
|
||||||
@ -82,18 +82,18 @@ pagerduty-rs = { version = "0.1.6", default-features = false, features = ["async
|
|||||||
parking_lot = { version = "0.12.1", features = ["arc_lock", "nightly"] }
|
parking_lot = { version = "0.12.1", features = ["arc_lock", "nightly"] }
|
||||||
prettytable = "0.10.0"
|
prettytable = "0.10.0"
|
||||||
proctitle = "0.1.1"
|
proctitle = "0.1.1"
|
||||||
rdkafka = { version = "0.32.2", features = ["tracing"] }
|
rdkafka = { version = "0.33.0", features = ["tracing"] }
|
||||||
regex = "1.8.4"
|
regex = "1.8.4"
|
||||||
reqwest = { version = "0.11.18", default-features = false, features = ["deflate", "gzip", "json", "tokio-rustls"] }
|
reqwest = { version = "0.11.18", default-features = false, features = ["deflate", "gzip", "json", "tokio-rustls"] }
|
||||||
rmp-serde = "1.1.1"
|
rmp-serde = "1.1.1"
|
||||||
rust_decimal = { version = "1.30.0", features = ["maths"] }
|
rust_decimal = { version = "1.30.0", features = ["maths"] }
|
||||||
sentry = { version = "0.31.5", default-features = false, features = ["anyhow", "backtrace", "contexts", "panic", "reqwest", "rustls", "serde_json", "tracing"] }
|
sentry = { version = "0.31.5", default-features = false, features = ["anyhow", "backtrace", "contexts", "panic", "reqwest", "rustls", "serde_json", "tracing"] }
|
||||||
sentry-tracing = "0.31.5"
|
sentry-tracing = "0.31.5"
|
||||||
serde = { version = "1.0.164" }
|
serde = { version = "1.0.166" }
|
||||||
serde_json = { version = "1.0.99", default-features = false, features = ["raw_value"] }
|
serde_json = { version = "1.0.99", default-features = false, features = ["raw_value"] }
|
||||||
serde_prometheus = "0.2.3"
|
serde_prometheus = "0.2.3"
|
||||||
strum = { version = "0.25.0", features = ["derive"] }
|
strum = { version = "0.25.0", features = ["derive"] }
|
||||||
time_01 = { package = "time", version = "0.1" }
|
time_01 = { package = "time", version = "0.1.45" }
|
||||||
time_03 = { package = "time", version = "0.3" }
|
time_03 = { package = "time", version = "0.3" }
|
||||||
tokio = { version = "1.29.1", features = ["full", "tracing"] }
|
tokio = { version = "1.29.1", features = ["full", "tracing"] }
|
||||||
tokio-console = { version = "0.1.8", optional = true }
|
tokio-console = { version = "0.1.8", optional = true }
|
||||||
|
@ -146,6 +146,7 @@ pub enum Web3ProxyError {
|
|||||||
/// simple way to return an error message to the user and an anyhow to our logs
|
/// simple way to return an error message to the user and an anyhow to our logs
|
||||||
#[display(fmt = "{}, {}, {:?}", _0, _1, _2)]
|
#[display(fmt = "{}, {}, {:?}", _0, _1, _2)]
|
||||||
StatusCode(StatusCode, Cow<'static, str>, Option<anyhow::Error>),
|
StatusCode(StatusCode, Cow<'static, str>, Option<anyhow::Error>),
|
||||||
|
StripeWebhookError(stripe::WebhookError),
|
||||||
/// TODO: what should be attached to the timout?
|
/// TODO: what should be attached to the timout?
|
||||||
#[display(fmt = "{:?}", _0)]
|
#[display(fmt = "{:?}", _0)]
|
||||||
#[error(ignore)]
|
#[error(ignore)]
|
||||||
@ -498,7 +499,7 @@ impl Web3ProxyError {
|
|||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
// TODO: is it safe to expose our io error strings?
|
// TODO: is it safe to expose our io error strings?
|
||||||
message: err.to_string().into(),
|
message: format!("std io error: {}", err).into(),
|
||||||
code: StatusCode::INTERNAL_SERVER_ERROR.as_u16().into(),
|
code: StatusCode::INTERNAL_SERVER_ERROR.as_u16().into(),
|
||||||
data: None,
|
data: None,
|
||||||
},
|
},
|
||||||
@ -674,7 +675,7 @@ impl Web3ProxyError {
|
|||||||
num_known,
|
num_known,
|
||||||
min_head_rpcs,
|
min_head_rpcs,
|
||||||
} => {
|
} => {
|
||||||
error!("NotEnoughRpcs {}/{}", num_known, min_head_rpcs);
|
error!(%num_known, %min_head_rpcs, "NotEnoughRpcs");
|
||||||
(
|
(
|
||||||
StatusCode::BAD_GATEWAY,
|
StatusCode::BAD_GATEWAY,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
@ -689,7 +690,7 @@ impl Web3ProxyError {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Self::NotEnoughSoftLimit { available, needed } => {
|
Self::NotEnoughSoftLimit { available, needed } => {
|
||||||
error!("NotEnoughSoftLimit {}/{}", available, needed);
|
error!(available, needed, "NotEnoughSoftLimit");
|
||||||
(
|
(
|
||||||
StatusCode::BAD_GATEWAY,
|
StatusCode::BAD_GATEWAY,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
@ -742,7 +743,7 @@ impl Web3ProxyError {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Self::OriginNotAllowed(origin) => {
|
Self::OriginNotAllowed(origin) => {
|
||||||
trace!("OriginNotAllowed origin={}", origin);
|
trace!(?origin, "OriginNotAllowed");
|
||||||
(
|
(
|
||||||
StatusCode::FORBIDDEN,
|
StatusCode::FORBIDDEN,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
@ -753,7 +754,7 @@ impl Web3ProxyError {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Self::ParseBytesError(err) => {
|
Self::ParseBytesError(err) => {
|
||||||
trace!("ParseBytesError err={:#?}", err);
|
trace!(?err, "ParseBytesError");
|
||||||
(
|
(
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
@ -764,7 +765,7 @@ impl Web3ProxyError {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Self::ParseMsgError(err) => {
|
Self::ParseMsgError(err) => {
|
||||||
trace!("ParseMsgError err={:#?}", err);
|
trace!(?err, "ParseMsgError");
|
||||||
(
|
(
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
@ -936,9 +937,22 @@ impl Web3ProxyError {
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Self::StripeWebhookError(err) => {
|
||||||
|
trace!(?err, "StripeWebhookError");
|
||||||
|
(
|
||||||
|
StatusCode::BAD_REQUEST,
|
||||||
|
JsonRpcErrorData {
|
||||||
|
message: format!("stripe webhook error: {}", err).into(),
|
||||||
|
code: StatusCode::BAD_REQUEST.as_u16().into(),
|
||||||
|
// TODO: include the stripe signature? anything else?
|
||||||
|
data: None,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
Self::Timeout(x) => (
|
Self::Timeout(x) => (
|
||||||
StatusCode::REQUEST_TIMEOUT,
|
StatusCode::REQUEST_TIMEOUT,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
|
// TODO: prettier message
|
||||||
message: format!("request timed out: {:?}", x).into(),
|
message: format!("request timed out: {:?}", x).into(),
|
||||||
code: StatusCode::REQUEST_TIMEOUT.as_u16().into(),
|
code: StatusCode::REQUEST_TIMEOUT.as_u16().into(),
|
||||||
// TODO: include the actual id!
|
// TODO: include the actual id!
|
||||||
@ -946,11 +960,11 @@ impl Web3ProxyError {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
Self::UlidDecode(err) => {
|
Self::UlidDecode(err) => {
|
||||||
// trace!(?err, "UlidDecodeError");
|
trace!(?err, "UlidDecodeError");
|
||||||
(
|
(
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
message: format!("{}", err).into(),
|
message: format!("ulid decode error: {}", err).into(),
|
||||||
code: StatusCode::BAD_REQUEST.as_u16().into(),
|
code: StatusCode::BAD_REQUEST.as_u16().into(),
|
||||||
data: None,
|
data: None,
|
||||||
},
|
},
|
||||||
@ -1010,7 +1024,7 @@ impl Web3ProxyError {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Self::UserAgentNotAllowed(ua) => {
|
Self::UserAgentNotAllowed(ua) => {
|
||||||
trace!("UserAgentNotAllowed ua={}", ua);
|
trace!(%ua, "UserAgentNotAllowed");
|
||||||
(
|
(
|
||||||
StatusCode::FORBIDDEN,
|
StatusCode::FORBIDDEN,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
@ -1033,7 +1047,7 @@ impl Web3ProxyError {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
Self::WatchRecvError(err) => {
|
Self::WatchRecvError(err) => {
|
||||||
error!("WatchRecvError err={:#?}", err);
|
error!(?err, "WatchRecvError");
|
||||||
(
|
(
|
||||||
StatusCode::INTERNAL_SERVER_ERROR,
|
StatusCode::INTERNAL_SERVER_ERROR,
|
||||||
JsonRpcErrorData {
|
JsonRpcErrorData {
|
||||||
|
@ -1,15 +1,11 @@
|
|||||||
use crate::app::Web3ProxyApp;
|
use crate::app::Web3ProxyApp;
|
||||||
use crate::errors::{Web3ProxyError, Web3ProxyErrorContext, Web3ProxyResponse};
|
use crate::errors::{Web3ProxyError, Web3ProxyErrorContext, Web3ProxyResponse};
|
||||||
use crate::frontend::authorization::{
|
|
||||||
login_is_authorized, Authorization as Web3ProxyAuthorization,
|
|
||||||
};
|
|
||||||
use anyhow::Context;
|
use anyhow::Context;
|
||||||
use axum::{
|
use axum::{
|
||||||
headers::{authorization::Bearer, Authorization},
|
headers::{authorization::Bearer, Authorization},
|
||||||
response::IntoResponse,
|
response::IntoResponse,
|
||||||
Extension, Json, TypedHeader,
|
Extension, Json, TypedHeader,
|
||||||
};
|
};
|
||||||
use axum_client_ip::InsecureClientIp;
|
|
||||||
use axum_macros::debug_handler;
|
use axum_macros::debug_handler;
|
||||||
use entities::{
|
use entities::{
|
||||||
balance, increase_on_chain_balance_receipt, rpc_key, stripe_increase_balance_receipt, user,
|
balance, increase_on_chain_balance_receipt, rpc_key, stripe_increase_balance_receipt, user,
|
||||||
@ -21,12 +17,11 @@ use migration::sea_orm::{
|
|||||||
self, ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, TransactionTrait,
|
self, ActiveModelTrait, ColumnTrait, EntityTrait, QueryFilter, TransactionTrait,
|
||||||
};
|
};
|
||||||
use migration::{Expr, OnConflict};
|
use migration::{Expr, OnConflict};
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
use std::num::NonZeroU64;
|
use std::num::NonZeroU64;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use stripe::Webhook;
|
use stripe::Webhook;
|
||||||
use tracing::{debug, error, trace};
|
use tracing::{debug, error, info, trace};
|
||||||
|
|
||||||
/// `GET /user/balance/stripe` -- Use a bearer token to get the user's balance and spend.
|
/// `GET /user/balance/stripe` -- Use a bearer token to get the user's balance and spend.
|
||||||
///
|
///
|
||||||
@ -55,80 +50,56 @@ pub async fn user_stripe_deposits_get(
|
|||||||
Ok(Json(response).into_response())
|
Ok(Json(response).into_response())
|
||||||
}
|
}
|
||||||
|
|
||||||
// /// the JSON input to the `post_user` handler.
|
|
||||||
// /// TODO: what else can we update here? password hash? subscription to newsletter?
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
|
||||||
pub struct StripePost {
|
|
||||||
// email: Option<String>,
|
|
||||||
// referral_code: Option<String>,
|
|
||||||
data: Box<serde_json::value::RawValue>,
|
|
||||||
}
|
|
||||||
|
|
||||||
/// `POST /user/balance/stripe` -- Process a stripe transaction;
|
/// `POST /user/balance/stripe` -- Process a stripe transaction;
|
||||||
/// this endpoint is called from the webhook with the user_id parameter in the request
|
/// this endpoint is called from the webhook with the user_id parameter in the request
|
||||||
#[debug_handler]
|
#[debug_handler]
|
||||||
pub async fn user_balance_stripe_post(
|
pub async fn user_balance_stripe_post(
|
||||||
Extension(app): Extension<Arc<Web3ProxyApp>>,
|
Extension(app): Extension<Arc<Web3ProxyApp>>,
|
||||||
InsecureClientIp(ip): InsecureClientIp,
|
// InsecureClientIp(ip): InsecureClientIp,
|
||||||
headers: HeaderMap,
|
headers: HeaderMap,
|
||||||
bearer: Option<TypedHeader<Authorization<Bearer>>>,
|
payload: String,
|
||||||
Json(payload): Json<StripePost>,
|
|
||||||
) -> Web3ProxyResponse {
|
) -> Web3ProxyResponse {
|
||||||
// rate limit by bearer token **OR** IP address
|
// TODO: (high) rate limits by IP address. login limiter is probably too low
|
||||||
let (_, _semaphore) = if let Some(TypedHeader(Authorization(bearer))) = bearer {
|
// TODO: maybe instead, a bad stripe-header should ban the IP? or a good one should allow it?
|
||||||
let (_, semaphore) = app.bearer_is_authorized(bearer).await?;
|
|
||||||
|
|
||||||
// TODO: is handling this as internal fine?
|
// TODO: lower log level when done testing
|
||||||
let authorization = Web3ProxyAuthorization::internal(app.db_conn().ok().cloned())?;
|
debug!(%payload, ?headers);
|
||||||
|
|
||||||
(authorization, Some(semaphore))
|
// get the signature from the header
|
||||||
|
// the docs are inconsistent on the key, so we just check all of them
|
||||||
|
let signature = if let Some(x) = headers.get("stripe-signature") {
|
||||||
|
x
|
||||||
|
} else if let Some(x) = headers.get("Stripe-Signature") {
|
||||||
|
x
|
||||||
|
} else if let Some(x) = headers.get("STRIPE_SIGNATURE") {
|
||||||
|
x
|
||||||
|
} else if let Some(x) = headers.get("HTTP_STRIPE_SIGNATURE") {
|
||||||
|
x
|
||||||
} else {
|
} else {
|
||||||
let authorization = login_is_authorized(&app, ip).await?;
|
return Err(Web3ProxyError::BadRequest(
|
||||||
(authorization, None)
|
"You have not provided a 'STRIPE_SIGNATURE' for the Stripe payload".into(),
|
||||||
|
));
|
||||||
};
|
};
|
||||||
|
|
||||||
// let recipient_user_id: u64 = params
|
let signature = signature
|
||||||
// .remove("user_id")
|
|
||||||
// .ok_or(Web3ProxyError::BadRouting)?
|
|
||||||
// .parse()
|
|
||||||
// .or(Err(Web3ProxyError::ParseAddressError))?;
|
|
||||||
|
|
||||||
trace!(?payload);
|
|
||||||
|
|
||||||
// Get the payload, and the header
|
|
||||||
// let payload = payload.data.get("data").ok_or(Web3ProxyError::BadRequest(
|
|
||||||
// "You have not provided a 'data' for the Stripe payload".into(),
|
|
||||||
// ))?;
|
|
||||||
|
|
||||||
// TODO Get this from the header
|
|
||||||
let signature = headers
|
|
||||||
.get("STRIPE_SIGNATURE")
|
|
||||||
.ok_or(Web3ProxyError::BadRequest(
|
|
||||||
"You have not provided a 'STRIPE_SIGNATURE' for the Stripe payload".into(),
|
|
||||||
))?
|
|
||||||
.to_str()
|
.to_str()
|
||||||
.web3_context("Could not parse stripe signature as byte-string")?;
|
.web3_context("Could not parse stripe signature as byte-string")?;
|
||||||
|
|
||||||
// Now parse the payload and signature
|
let secret = app
|
||||||
// TODO: Move env variable elsewhere
|
.config
|
||||||
let event = Webhook::construct_event(
|
|
||||||
payload.data.get(),
|
|
||||||
signature,
|
|
||||||
app.config
|
|
||||||
.stripe_api_key
|
.stripe_api_key
|
||||||
.clone()
|
.clone()
|
||||||
.web3_context("Stripe API key not found in config!")?
|
.web3_context("Stripe API key not found in config!")?;
|
||||||
.as_str(),
|
|
||||||
)
|
let event = Webhook::construct_event(&payload, signature, secret.as_str())?;
|
||||||
.context(Web3ProxyError::BadRequest(
|
|
||||||
"Could not parse the stripe webhook request!".into(),
|
|
||||||
))?;
|
|
||||||
|
|
||||||
let intent = match event.data.object {
|
let intent = match event.data.object {
|
||||||
stripe::EventObject::PaymentIntent(intent) => intent,
|
stripe::EventObject::PaymentIntent(intent) => intent,
|
||||||
_ => return Ok("Received irrelevant webhook".into_response()),
|
_ => return Ok("Received irrelevant webhook".into_response()),
|
||||||
};
|
};
|
||||||
debug!("Found PaymentIntent Event: {:?}", intent);
|
|
||||||
|
// TODO: lower log level when done testing
|
||||||
|
info!(?intent);
|
||||||
|
|
||||||
if intent.status.as_str() != "succeeded" {
|
if intent.status.as_str() != "succeeded" {
|
||||||
return Ok("Received Webhook".into_response());
|
return Ok("Received Webhook".into_response());
|
||||||
@ -180,7 +151,7 @@ pub async fn user_balance_stripe_post(
|
|||||||
let txn = db_conn.begin().await?;
|
let txn = db_conn.begin().await?;
|
||||||
|
|
||||||
// Assert that it's usd
|
// Assert that it's usd
|
||||||
if intent.currency.to_string() != "USD" || recipient.is_none() {
|
if intent.currency.to_string() != "usd" || recipient.is_none() {
|
||||||
// In this case I should probably still save it to the database,
|
// In this case I should probably still save it to the database,
|
||||||
// but not increase balance (this should be refunded)
|
// but not increase balance (this should be refunded)
|
||||||
// TODO: I suppose we could send a refund request right away from here
|
// TODO: I suppose we could send a refund request right away from here
|
||||||
|
@ -10,7 +10,7 @@ use tokio::{
|
|||||||
};
|
};
|
||||||
use web3_proxy::rpcs::blockchain::ArcBlock;
|
use web3_proxy::rpcs::blockchain::ArcBlock;
|
||||||
|
|
||||||
#[cfg_attr(not(feature = "tests-needing-docker"), ignore)]
|
// #[cfg_attr(not(feature = "tests-needing-docker"), ignore)]
|
||||||
#[ignore = "under construction"]
|
#[ignore = "under construction"]
|
||||||
#[test_log::test(tokio::test)]
|
#[test_log::test(tokio::test)]
|
||||||
async fn it_migrates_the_db() {
|
async fn it_migrates_the_db() {
|
||||||
|
@ -1,14 +1,21 @@
|
|||||||
mod common;
|
mod common;
|
||||||
|
|
||||||
use crate::common::TestApp;
|
use crate::common::TestApp;
|
||||||
use axum::headers::Authorization;
|
|
||||||
use ethers::{signers::Signer, types::Signature};
|
use ethers::{signers::Signer, types::Signature};
|
||||||
use hashbrown::HashMap;
|
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use serde_json::Value;
|
|
||||||
use tracing::{debug, info, trace};
|
use tracing::{debug, info, trace};
|
||||||
use ulid::Ulid;
|
use ulid::Ulid;
|
||||||
use web3_proxy::frontend::users::authentication::{LoginPostResponse, PostLogin};
|
use web3_proxy::frontend::users::authentication::PostLogin;
|
||||||
|
|
||||||
|
/// TODO: use this type in the frontend
|
||||||
|
#[derive(Debug, Deserialize)]
|
||||||
|
struct LoginPostResponse {
|
||||||
|
pub bearer_token: Ulid,
|
||||||
|
// pub rpc_keys: Value,
|
||||||
|
// /// unknown data gets put here
|
||||||
|
// #[serde(flatten, default = "HashMap::default")]
|
||||||
|
// pub extra: HashMap<String, serde_json::Value>,
|
||||||
|
}
|
||||||
|
|
||||||
/// TODO: 191 and the other message formats in another test
|
/// TODO: 191 and the other message formats in another test
|
||||||
#[cfg_attr(not(feature = "tests-needing-docker"), ignore)]
|
#[cfg_attr(not(feature = "tests-needing-docker"), ignore)]
|
||||||
|
Loading…
Reference in New Issue
Block a user