diff --git a/Cargo.lock b/Cargo.lock index 84047dfa..9e2db942 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -79,9 +79,9 @@ checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "api" @@ -103,7 +103,7 @@ dependencies = [ "http 1.1.0", "http-serde-ext", "hyper 0.14.28", - "indexmap 2.2.5", + "indexmap 2.2.6", "integrationos-domain", "jsonwebtoken", "mockito", @@ -113,7 +113,7 @@ dependencies = [ "openapiv3", "rand", "redis", - "reqwest 0.12.3", + "reqwest 0.12.4", "segment", "semver 1.0.22", "serde", @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "arc-swap" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3d0060af21e8d11a926981cc00c6c1541aa91dd64b9f881985c3da1094425f" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "assert-json-diff" @@ -148,33 +148,35 @@ dependencies = [ [[package]] name = "async-lock" -version = "2.8.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener", + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite", ] [[package]] name = "async-recursion" -version = "1.0.5" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +checksum = "30c5ef0ede93efbf733c1a727f3b6b5a1060bbedd5600183e66f6e4be4af0ec5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -185,9 +187,9 @@ checksum = "c59bdb34bc650a32731b31bd8f0829cc15d24a708ee31559e0bb34f2bc320cba" [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "axum" @@ -254,7 +256,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -281,9 +283,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -312,6 +314,15 @@ version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +[[package]] +name = "base64-simd" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "781dd20c3aff0bd194fe7d2a977dd92f21c173891f3a03b677359e5fa457e5d5" +dependencies = [ + "simd-abstraction", +] + [[package]] name = "base64ct" version = "1.6.0" @@ -326,9 +337,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -363,15 +374,15 @@ dependencies = [ [[package]] name = "bson" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce21468c1c9c154a85696bb25c20582511438edb6ad67f846ba1378ffdd80222" +checksum = "4d43b38e074cc0de2957f10947e376a1d88b9c4dbab340b590800cc1b2e066b2" dependencies = [ "ahash", "base64 0.13.1", "bitvec", "hex", - "indexmap 2.2.5", + "indexmap 2.2.6", "js-sys", "once_cell", "rand", @@ -384,52 +395,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" - -[[package]] -name = "bytecount" -version = "0.6.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e5f035d16fc623ae5f74981db80a439803888314e3a555fd6f04acd51a3205" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" - -[[package]] -name = "camino" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.22", - "serde", - "serde_json", -] +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "cast" @@ -439,9 +413,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.90" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" [[package]] name = "cfg-if" @@ -451,9 +425,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", @@ -461,7 +435,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -503,9 +477,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.2" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", ] @@ -538,9 +512,9 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.6" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ "bytes", "futures-core", @@ -550,6 +524,15 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "concurrent-queue" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "convert_case" version = "0.4.0" @@ -738,7 +721,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -760,7 +743,7 @@ checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core 0.20.8", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -830,7 +813,7 @@ dependencies = [ "quote", "strum", "strum_macros", - "syn 2.0.52", + "syn 2.0.60", "thiserror", ] @@ -879,9 +862,9 @@ dependencies = [ [[package]] name = "deunicode" -version = "1.4.3" +version = "1.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e854126756c496b8c81dec88f9a706b15b875c5849d4097a3854476b9fdf94" +checksum = "322ef0094744e63628e6f0eb2295517f79276a5b342a4c2ff3042566ca181d4e" [[package]] name = "digest" @@ -902,9 +885,9 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "downcast-rs" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" [[package]] name = "dummy" @@ -915,20 +898,20 @@ dependencies = [ "darling 0.20.8", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -981,15 +964,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "version_check", -] - [[package]] name = "event-core" version = "0.1.0" @@ -1012,7 +986,7 @@ dependencies = [ "moka", "mongodb", "redis", - "reqwest 0.12.3", + "reqwest 0.12.4", "serde", "serde_json", "testcontainers-modules", @@ -1025,9 +999,35 @@ dependencies = [ [[package]] name = "event-listener" -version = "2.5.3" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" +checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] [[package]] name = "fake" @@ -1047,12 +1047,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - [[package]] name = "finl_unicode" version = "1.2.0" @@ -1156,7 +1150,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -1245,9 +1239,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -1260,12 +1254,6 @@ version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "governor" version = "0.6.3" @@ -1280,7 +1268,7 @@ dependencies = [ "nonzero_ext", "parking_lot", "portable-atomic", - "quanta 0.12.2", + "quanta 0.12.3", "rand", "smallvec", "spinning_top", @@ -1288,9 +1276,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -1298,7 +1286,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.2.5", + "indexmap 2.2.6", "slab", "tokio", "tokio-util", @@ -1307,9 +1295,9 @@ dependencies = [ [[package]] name = "half" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5eceaaeec696539ddaf7b333340f1af35a5aa87ae3e4f3ead0532f72affab2e" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" dependencies = [ "cfg-if", "crunchy", @@ -1531,7 +1519,7 @@ dependencies = [ "futures-util", "http 0.2.12", "hyper 0.14.28", - "rustls 0.21.10", + "rustls 0.21.11", "tokio", "tokio-rustls 0.24.1", ] @@ -1546,7 +1534,7 @@ dependencies = [ "http 1.1.0", "hyper 1.3.1", "hyper-util", - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -1651,9 +1639,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.5" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -1671,9 +1659,9 @@ dependencies = [ [[package]] name = "integrationos-domain" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9663002ce2572d980b5c260d9d8c9e142573714e1d24accd7e40a57b2c1c8ca7" +checksum = "10979a5f9f49b10ac4cf02c88e11a9e795aebb9fb9d5926d1dd7d4f7e44f9823" dependencies = [ "aes", "anyhow", @@ -1692,7 +1680,7 @@ dependencies = [ "handlebars", "http 1.1.0", "http-serde-ext", - "indexmap 2.2.5", + "indexmap 2.2.6", "js-sandbox-ios", "jsonpath_lib", "moka", @@ -1702,7 +1690,7 @@ dependencies = [ "prost", "rand", "redis", - "reqwest 0.12.3", + "reqwest 0.12.4", "semver 1.0.22", "serde", "serde_json", @@ -1758,18 +1746,18 @@ dependencies = [ [[package]] name = "itertools" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sandbox-ios" @@ -1791,7 +1779,7 @@ checksum = "e0445474069bad4c2b01856976d83c796521ae9298ba718ecf26041767eb68b2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -1934,9 +1922,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "metrics" @@ -1985,11 +1973,11 @@ checksum = "9bf4e7146e30ad172c42c39b3246864bd2d3c6396780711a1baf749cfe423e21" dependencies = [ "base64 0.21.7", "hyper 0.14.28", - "indexmap 2.2.5", + "indexmap 2.2.6", "ipnet", "metrics 0.22.3", "metrics-util 0.16.3", - "quanta 0.12.2", + "quanta 0.12.3", "thiserror", "tokio", ] @@ -2002,7 +1990,7 @@ checksum = "38b4faf00617defe497754acde3024865bc143d44a86799b24e191ecff91354f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -2031,7 +2019,7 @@ dependencies = [ "hashbrown 0.14.3", "metrics 0.22.3", "num_cpus", - "quanta 0.12.2", + "quanta 0.12.3", "sketches-ddsketch", ] @@ -2082,21 +2070,21 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1911e88d5831f748a4097a43862d129e3c6fca831eecac9b8db6d01d93c9de2" +checksum = "9e0d88686dc561d743b40de8269b26eaf0dc58781bde087b0984646602021d08" dependencies = [ "async-lock", "async-trait", "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", + "event-listener 5.3.0", "futures-util", "once_cell", "parking_lot", - "quanta 0.12.2", + "quanta 0.12.3", "rustc_version 0.4.0", - "skeptic", "smallvec", "tagptr", "thiserror", @@ -2106,9 +2094,9 @@ dependencies = [ [[package]] name = "mongodb" -version = "2.8.1" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de59562e5c71656c098d8e966641b31da87b89dc3dcb6e761d3b37dcdfa0cb72" +checksum = "ef206acb1b72389b49bc9985efe7eb1f8a9bb18e5680d262fac26c07f44025f1" dependencies = [ "async-trait", "base64 0.13.1", @@ -2129,7 +2117,7 @@ dependencies = [ "percent-encoding", "rand", "rustc_version_runtime", - "rustls 0.21.10", + "rustls 0.21.11", "rustls-pemfile 1.0.4", "serde", "serde_bytes", @@ -2252,17 +2240,29 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc02deea53ffe807708244e5914f6b099ad7015a207ee24317c22112e17d9c5c" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "serde", "serde_json", ] +[[package]] +name = "outref" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" + [[package]] name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2312,9 +2312,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.8" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f8023d0fb78c8e03784ea1c7f3fa36e68a723138990b8d5a47d916b651e7a8" +checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" dependencies = [ "memchr", "thiserror", @@ -2323,9 +2323,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.8" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d24f72393fd16ab6ac5738bc33cdb6a9aa73f8b902e8fe29cf4e67d7dd1026" +checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" dependencies = [ "pest", "pest_generator", @@ -2333,22 +2333,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.8" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc17e2a6c7d0a492f0158d7a4bd66cc17280308bbaff78d5bef566dca35ab80" +checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] name = "pest_meta" -version = "2.7.8" +version = "2.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934cd7631c050f4674352a6e835d5f6711ffbfb9345c2fc0107155ac495ae293" +checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" dependencies = [ "once_cell", "pest", @@ -2372,14 +2372,14 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -2465,7 +2465,7 @@ checksum = "07c277e4e643ef00c1233393c673f655e3672cf7eb3ba08a00bdd0ea59139b5f" dependencies = [ "proc-macro-rules-macros", "proc-macro2", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -2477,23 +2477,23 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" dependencies = [ "bytes", "prost-derive", @@ -2501,26 +2501,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +checksum = "19de2de2a00075bf566bee3bd4db014b11587e84184d3f7a791bc17f1a8e9e48" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.52", -] - -[[package]] -name = "pulldown-cmark" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" -dependencies = [ - "bitflags 2.4.2", - "memchr", - "unicase", + "syn 2.0.60", ] [[package]] @@ -2541,9 +2530,9 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca0b7bac0b97248c40bb77288fc52029cf1459c0461ea1b05ee32ccf011de2c" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" dependencies = [ "crossbeam-utils", "libc", @@ -2562,9 +2551,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2620,14 +2609,14 @@ version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d86a7c4638d42c44551f4791a20e687dbb4c3de1f33c43dd71e355cd429def1" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", ] [[package]] name = "rayon" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -2678,14 +2667,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", "regex-automata 0.4.6", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -2705,7 +2694,7 @@ checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.3", ] [[package]] @@ -2716,15 +2705,15 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", "bytes", @@ -2743,7 +2732,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.10", + "rustls 0.21.11", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -2763,9 +2752,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "base64 0.22.0", "bytes", @@ -2784,7 +2773,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", @@ -2878,11 +2867,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno", "libc", "linux-raw-sys", @@ -2891,9 +2880,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring 0.17.8", @@ -2903,14 +2892,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.3", "subtle", "zeroize", ] @@ -2952,9 +2941,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -2963,9 +2952,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" @@ -3005,7 +2994,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12485833e00457a6bbba60397d3f19362751a0caefe27f6755fff1a2be4fd601" dependencies = [ "async-trait", - "reqwest 0.11.24", + "reqwest 0.11.27", "serde", "serde_json", "thiserror", @@ -3038,9 +3027,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.197" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] @@ -3056,22 +3045,22 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ - "indexmap 2.2.5", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -3079,9 +3068,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd154a240de39fdebcf5775d2675c204d7c13cf39a4c697be6493c8e734337c" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" dependencies = [ "itoa", "serde", @@ -3185,18 +3174,27 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] +[[package]] +name = "simd-abstraction" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadb29c57caadc51ff8346233b5cec1d240b68ce55cf1afc764818791876987" +dependencies = [ + "outref", +] + [[package]] name = "similar" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32fea41aca09ee824cc9724996433064c89f7777e60762749a4170a14abbfa21" +checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" [[package]] name = "simple_asn1" @@ -3210,21 +3208,6 @@ dependencies = [ "time", ] -[[package]] -name = "skeptic" -version = "0.13.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" -dependencies = [ - "bytecount", - "cargo_metadata", - "error-chain", - "glob", - "pulldown-cmark", - "tempfile", - "walkdir", -] - [[package]] name = "sketches-ddsketch" version = "0.2.2" @@ -3242,9 +3225,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "socket2" @@ -3268,17 +3251,18 @@ dependencies = [ [[package]] name = "sourcemap" -version = "7.0.1" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10da010a590ed2fa9ca8467b00ce7e9c5a8017742c0c09c45450efc172208c4b" +checksum = "e7768edd06c02535e0d50653968f46e1e0d3aa54742190d35dd9466f59de9c71" dependencies = [ + "base64-simd", "data-encoding", "debugid", "if_chain", "rustc_version 0.2.3", "serde", "serde_json", - "unicode-id", + "unicode-id-start", "url", ] @@ -3345,7 +3329,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -3367,9 +3351,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -3427,18 +3411,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" -dependencies = [ - "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", -] - [[package]] name = "testcontainers" version = "0.15.0" @@ -3458,31 +3430,31 @@ dependencies = [ [[package]] name = "testcontainers-modules" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0334776e1e8ee7c504a922c5236daf865ffe413aa630d84ae91dcce0b10bc3" +checksum = "8debb5e215d9e89ea93255fffff00bf037ea44075d7a2669a21a8a988d6b52fd" dependencies = [ "testcontainers", ] [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -3497,9 +3469,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -3518,9 +3490,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -3553,9 +3525,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -3587,7 +3559,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -3607,7 +3579,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.11", "tokio", ] @@ -3617,7 +3589,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "tokio", ] @@ -3659,7 +3631,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "bytes", "http 1.1.0", "http-body 1.0.0", @@ -3718,7 +3690,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] @@ -3869,15 +3841,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" -[[package]] -name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - [[package]] name = "unicode-bidi" version = "0.3.15" @@ -3885,10 +3848,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] -name = "unicode-id" -version = "0.3.4" +name = "unicode-id-start" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" +checksum = "b8f73150333cb58412db36f2aca8f2875b013049705cc77b94ded70a1ab1f5da" [[package]] name = "unicode-ident" @@ -3946,9 +3909,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" dependencies = [ "atomic", "getrandom", @@ -4069,7 +4032,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", "wasm-bindgen-shared", ] @@ -4103,7 +4066,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4171,9 +4134,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -4212,7 +4175,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4230,7 +4193,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4250,17 +4213,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -4271,9 +4235,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4283,9 +4247,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -4295,9 +4259,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -4307,9 +4277,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -4319,9 +4289,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -4331,9 +4301,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -4343,9 +4313,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winreg" @@ -4393,7 +4363,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.60", ] [[package]] diff --git a/api/src/config.rs b/api/src/config.rs index 5089fb22..02f8ac83 100644 --- a/api/src/config.rs +++ b/api/src/config.rs @@ -24,8 +24,6 @@ pub struct Config { pub access_key_cache_ttl_secs: u64, #[envconfig(from = "ACCESS_KEY_WHITELIST_REFRESH_INTERVAL_SECS", default = "60")] pub access_key_whitelist_refresh_interval_secs: u64, - #[envconfig(from = "IS_ADMIN", default = "false")] - pub is_admin: bool, #[envconfig(from = "ENGINEERING_ACCOUNT_ID", default = "engineering_account")] pub engineering_account_id: String, #[envconfig( @@ -94,7 +92,6 @@ impl Display for Config { "ACCESS_KEY_WHITELIST_REFRESH_INTERVAL_SECS: {}", self.access_key_whitelist_refresh_interval_secs )?; - writeln!(f, "IS_ADMIN: {}", self.is_admin)?; writeln!(f, "EVENT_ACCESS_PASSWORD: ***")?; writeln!( f, diff --git a/api/src/endpoints/common_enum.rs b/api/src/endpoints/common_enum.rs index 59cf5c71..8018908b 100644 --- a/api/src/endpoints/common_enum.rs +++ b/api/src/endpoints/common_enum.rs @@ -14,7 +14,7 @@ pub async fn read( query: Option>>, State(state): State>, ) -> Result>, ApiError> { - let mut query = shape_mongo_filter(query, None, None); + let mut query = shape_mongo_filter(query, None, None, false); query.filter.remove(DELETED_STR); let store = &state.app_stores.common_enum; diff --git a/api/src/endpoints/common_model.rs b/api/src/endpoints/common_model.rs index a1b3baab..ef719ddb 100644 --- a/api/src/endpoints/common_model.rs +++ b/api/src/endpoints/common_model.rs @@ -81,6 +81,10 @@ impl CrudHook for CreateRequest { impl CrudRequest for CreateRequest { type Output = CommonModel; + fn filterable() -> bool { + false + } + fn output(&self) -> Option { let mut record = Self::Output { id: Id::now(IdPrefix::CommonModel), diff --git a/api/src/endpoints/connection_definition.rs b/api/src/endpoints/connection_definition.rs index 86f105f4..716bb86c 100644 --- a/api/src/endpoints/connection_definition.rs +++ b/api/src/endpoints/connection_definition.rs @@ -1,5 +1,6 @@ use super::{ - create, delete, update, ApiResult, CachedRequest, CrudHook, CrudRequest, ReadResponse, Unit, + create, delete, read, update, ApiResult, CachedRequest, CrudHook, CrudRequest, ReadResponse, + Unit, }; use crate::{ internal_server_error, not_found, @@ -31,7 +32,11 @@ use tracing::error; pub fn get_router() -> Router> { Router::new() - .route("/", post(create::)) + .route( + "/", + post(create::) + .get(read::), + ) .route( "/:id", patch(update::) @@ -254,6 +259,10 @@ pub async fn public_get_connection_details( impl CrudRequest for CreateRequest { type Output = ConnectionDefinition; + fn filterable() -> bool { + false + } + fn output(&self) -> Option { let auth_secrets: Vec = self .authentication diff --git a/api/src/endpoints/connection_model_definition.rs b/api/src/endpoints/connection_model_definition.rs index bbf3cd1f..c07bae1c 100644 --- a/api/src/endpoints/connection_model_definition.rs +++ b/api/src/endpoints/connection_model_definition.rs @@ -303,6 +303,10 @@ impl CrudHook for CreateRequest {} impl CrudRequest for CreateRequest { type Output = ConnectionModelDefinition; + fn filterable() -> bool { + false + } + fn output(&self) -> Option { let key = format!( "api::{}::{}::{}::{}::{}::{}", diff --git a/api/src/endpoints/connection_model_schema.rs b/api/src/endpoints/connection_model_schema.rs index 35dd5410..df81e8c0 100644 --- a/api/src/endpoints/connection_model_schema.rs +++ b/api/src/endpoints/connection_model_schema.rs @@ -1,32 +1,23 @@ -use super::{ - create, delete, read, update, ApiError, ApiResult, CrudHook, CrudRequest, ReadResponse, -}; +use super::{create, delete, read, update, ApiResult, CrudHook, CrudRequest}; use crate::{ - api_payloads::ErrorResponse, internal_server_error, server::{AppState, AppStores}, - util::shape_mongo_filter, }; use axum::{ - extract::{Path, Query, State}, + extract::{Path, State}, routing::{patch, post}, - Extension, Json, Router, + Json, Router, }; -use http::StatusCode; use integrationos_domain::{ algebra::{MongoStore, StoreExt}, - connection_model_schema::{ - ConnectionModelSchema, Mappings, PublicConnectionModelSchema, SchemaPaths, - }, - event_access::EventAccess, + connection_model_schema::{ConnectionModelSchema, Mappings, SchemaPaths}, id::{prefix::IdPrefix, Id}, json_schema::JsonSchema, }; use mongodb::bson::doc; -use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use serde::{Deserialize, Serialize}; use serde_json::Value; -use std::{collections::BTreeMap, sync::Arc}; -use tokio::try_join; +use std::sync::Arc; use tracing::error; pub fn get_router() -> Router> { @@ -43,74 +34,7 @@ pub fn get_router() -> Router> { ) } -#[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] -#[cfg_attr(feature = "dummy", derive(fake::Dummy))] -#[serde(rename_all = "camelCase")] -pub struct PublicGetConnectionModelSchema { - pub connection_definition_id: Id, -} - -pub async fn public_get_connection_model_schema( - event_access: Option>>, - query: Option>>, - State(state): State>, -) -> Result>, ApiError> -where - T: CrudRequest + 'static, - U: Serialize + DeserializeOwned + Unpin + Sync + Send + 'static, -{ - match query.as_ref().and_then(|q| q.get("connectionDefinitionId")) { - Some(id) => id.to_string(), - None => { - return Err(( - StatusCode::BAD_REQUEST, - Json(ErrorResponse { - error: "connectionDefinitionId is required".to_string(), - }), - )) - } - }; - - let mut query = shape_mongo_filter( - query, - event_access.map(|e| { - let Extension(e) = e; - e - }), - None, - ); - - query.filter.remove("ownership.buildableId"); - query.filter.remove("environment"); - query.filter.insert("mapping", doc! { "$ne": null }); - - let store = T::get_store(state.app_stores.clone()); - let count = store.count(query.filter.clone(), None); - let find = store.get_many( - Some(query.filter), - None, - None, - Some(query.limit), - Some(query.skip), - ); - - let res = match try_join!(count, find) { - Ok((total, rows)) => ReadResponse { - rows, - skip: query.skip, - limit: query.limit, - total, - }, - Err(e) => { - error!("Error reading from store: {e}"); - return Err(internal_server_error!()); - } - }; - - Ok(Json(res)) -} - -pub async fn public_get_platform_models( +pub async fn get_platform_models( Path(platform_name): Path, State(state): State>, ) -> ApiResult> { @@ -142,14 +66,6 @@ pub async fn public_get_platform_models( Ok(Json(common_model_names)) } -impl CrudRequest for PublicGetConnectionModelSchema { - type Output = PublicConnectionModelSchema; - - fn get_store(stores: AppStores) -> MongoStore { - stores.public_model_schema.clone() - } -} - #[derive(Debug, Clone, PartialEq, Deserialize, Serialize)] #[cfg_attr(feature = "dummy", derive(fake::Dummy))] #[serde(rename_all = "camelCase")] @@ -172,6 +88,10 @@ impl CrudHook for CreateRequest {} impl CrudRequest for CreateRequest { type Output = ConnectionModelSchema; + fn filterable() -> bool { + false + } + fn output(&self) -> Option { let key = format!( "api::{}::{}::{}", diff --git a/api/src/endpoints/connection_oauth_definition.rs b/api/src/endpoints/connection_oauth_definition.rs index 8a82edc9..936580a6 100644 --- a/api/src/endpoints/connection_oauth_definition.rs +++ b/api/src/endpoints/connection_oauth_definition.rs @@ -67,6 +67,10 @@ fn default_separator() -> Option { impl CrudRequest for CreateRequest { type Output = ConnectionOAuthDefinition; + fn filterable() -> bool { + false + } + fn output(&self) -> Option { Some(Self::Output { id: Id::new(IdPrefix::ConnectionOAuthDefinition, Utc::now()), diff --git a/api/src/endpoints/metrics.rs b/api/src/endpoints/metrics.rs index 35401005..af6dabae 100644 --- a/api/src/endpoints/metrics.rs +++ b/api/src/endpoints/metrics.rs @@ -89,10 +89,6 @@ pub async fn get_metrics( let query_params = query_params.unwrap_or_default(); let metric_type = query_params.metric_type.unwrap_or(MetricType::Unified); - println!( - "metric type: {:?} - {}", - query_params.metric_type, metric_type - ); let Ok(doc) = doc.get_document(metric_type.to_string()) else { return Ok(Json(MetricResponse { count: 0 })); }; diff --git a/api/src/endpoints/mod.rs b/api/src/endpoints/mod.rs index 051a59c5..86e189c0 100644 --- a/api/src/endpoints/mod.rs +++ b/api/src/endpoints/mod.rs @@ -20,7 +20,7 @@ use integrationos_domain::{ use moka::future::Cache; use mongodb::options::FindOneOptions; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use std::{collections::BTreeMap, sync::Arc}; +use std::{collections::BTreeMap, fmt::Debug, sync::Arc}; use tokio::try_join; use tracing::error; @@ -63,8 +63,15 @@ pub trait CrudRequest: Sized { None } - /// + /// Update the output of the request based on the input. fn update(&self, _: &mut Self::Output) -> Unit {} + + /// Whether the Output can be filtered by the environment and ownership. + fn filterable() -> bool { + true + } + + /// Get the store for the request. fn get_store(stores: AppStores) -> MongoStore; } @@ -118,18 +125,14 @@ pub async fn create( ) -> ApiResult where T: CrudRequest + CrudHook + 'static, - U: Serialize + DeserializeOwned + Unpin + Sync + Send + 'static, + U: Serialize + DeserializeOwned + Unpin + Sync + Send + Debug + 'static, { - let output = if let Some(Extension(event_access)) = event_access { - req.event_access(event_access) - } else { - req.output() - }; - - let output = match output { - Some(output) => output, - None => return Err(not_found!("Record")), - }; + let output = event_access + .map_or_else( + || req.output(), + |event_access| req.event_access(event_access.0).or(req.output()), + ) + .ok_or_else(|| not_found!("Record"))?; match T::get_store(state.app_stores.clone()) .create_one(&output) @@ -168,7 +171,7 @@ pub async fn read( ) -> Result>, ApiError> where T: CrudRequest + 'static, - U: Serialize + DeserializeOwned + Unpin + Sync + Send + 'static, + U: Serialize + DeserializeOwned + Unpin + Sync + Send + Debug + 'static, { let query = shape_mongo_filter( query, @@ -177,6 +180,7 @@ where e }), Some(headers), + T::filterable(), ); let store = T::get_store(state.app_stores.clone()); @@ -198,6 +202,7 @@ where }, Err(e) => { error!("Error reading from store: {e}"); + println!("{:?}", e); return Err(internal_server_error!()); } }; @@ -211,14 +216,15 @@ pub async fn read_cached( ) -> Result>>, ApiError> where T: CachedRequest + 'static, - U: Clone + Serialize + DeserializeOwned + Unpin + Sync + Send + 'static, + U: Clone + Serialize + DeserializeOwned + Unpin + Sync + Send + Debug + 'static, { let cache = T::get_cache(state.clone()); let res = cache .try_get_with(query.as_ref().map(|q| q.0.clone()), async { - let query = shape_mongo_filter(query, None, None); + let query = shape_mongo_filter(query, None, None, T::filterable()); + println!("{:?}", query); let store = T::get_store(state.app_stores.clone()); let count = store.count(query.filter.clone(), None); let find = store.get_many( @@ -230,12 +236,16 @@ where ); let res = match try_join!(count, find) { - Ok((total, rows)) => Arc::new(ReadResponse { - rows, - skip: query.skip, - limit: query.limit, - total, - }), + Ok((total, rows)) => { + println!("{:?}", total); + + Arc::new(ReadResponse { + rows, + skip: query.skip, + limit: query.limit, + total, + }) + } Err(e) => { error!("Error reading from store: {e}"); return Err(internal_server_error!()); @@ -272,6 +282,7 @@ where e }), None, + T::filterable(), ); query.filter.insert("_id", id.clone()); @@ -337,6 +348,7 @@ where e }), None, + T::filterable(), ); query.filter.insert("_id", id.clone()); diff --git a/api/src/main.rs b/api/src/main.rs index 097860d5..ae068d80 100644 --- a/api/src/main.rs +++ b/api/src/main.rs @@ -10,13 +10,8 @@ use tracing::info; fn main() -> Result<()> { dotenv().ok(); let config = Config::init_from_env()?; - let name = if config.is_admin { - "admin-api" - } else { - "event-api" - }; - let subscriber = get_subscriber(name.into(), "info".into(), std::io::stdout); + let subscriber = get_subscriber("connections-api".into(), "info".into(), std::io::stdout); init_subscriber(subscriber); info!("Starting API with config:\n{config}"); diff --git a/api/src/metrics.rs b/api/src/metrics.rs index 546c6dea..88e0c04c 100644 --- a/api/src/metrics.rs +++ b/api/src/metrics.rs @@ -1,11 +1,10 @@ -use std::sync::Arc; - use chrono::{DateTime, Datelike, Utc}; use http::HeaderValue; use integrationos_domain::{event_access::EventAccess, ownership::Ownership, Connection}; use segment::message::{Track, User}; use serde::Deserialize; use serde_json::json; +use std::sync::Arc; pub const TOTAL_KEY: &str = "total"; pub const DAILY_KEY: &str = "daily"; diff --git a/api/src/middleware/auth.rs b/api/src/middleware/auth.rs index ffa8ea63..13b38c61 100644 --- a/api/src/middleware/auth.rs +++ b/api/src/middleware/auth.rs @@ -1,6 +1,4 @@ -use crate::{ - endpoints::ApiError, internal_server_error, not_found, server::AppState, unauthorized, -}; +use crate::{endpoints::ApiError, internal_server_error, server::AppState, unauthorized}; use axum::{body::Body, extract::State, middleware::Next, response::Response}; use http::Request; use integrationos_domain::{algebra::StoreExt, ApplicationError, InternalError}; @@ -23,7 +21,7 @@ pub async fn auth( // auth header value starts with either id_ or sk_ and then the environment // Make sure the environments match, or we return 404 if conn_header.as_bytes()[..4] != auth_header.as_bytes()[3..7] { - return Err(not_found!("Connection")); + return Err(unauthorized!()); } } diff --git a/api/src/routes/admin.rs b/api/src/routes/admin.rs deleted file mode 100644 index a5554c03..00000000 --- a/api/src/routes/admin.rs +++ /dev/null @@ -1,34 +0,0 @@ -use crate::{ - endpoints::{ - common_model, connection_definition, connection_model_definition, connection_model_schema, - connection_oauth_definition, metrics, openapi, - }, - server::AppState, -}; -use axum::{routing::post, Router}; -use std::sync::Arc; -use tower_http::trace::TraceLayer; - -pub fn get_router() -> Router> { - Router::new() - .nest( - "/connection-definitions", - connection_definition::get_router(), - ) - .nest( - "/connection-oauth-definitions", - connection_oauth_definition::get_router(), - ) - .nest( - "/connection-model-definitions", - connection_model_definition::get_router(), - ) - .route("/openapi", post(openapi::refresh_openapi)) - .nest( - "/connection-model-schemas", - connection_model_schema::get_router(), - ) - .nest("/common-models", common_model::get_router()) - .layer(TraceLayer::new_for_http()) - .nest("/metrics", metrics::get_router()) -} diff --git a/api/src/routes/mod.rs b/api/src/routes/mod.rs index e336085f..e7d6ff8d 100644 --- a/api/src/routes/mod.rs +++ b/api/src/routes/mod.rs @@ -1,4 +1,3 @@ -pub mod admin; pub mod protected; pub mod public; @@ -11,17 +10,7 @@ use http::StatusCode; use std::sync::Arc; use tower_http::cors::CorsLayer; -pub fn get_admin_router(state: &Arc) -> Router> { - let path = format!("/{}", state.config.api_version); - Router::new() - .nest(&path, admin::get_router()) - .nest(&path, public::get_router(state)) - .route("/", get(get_root)) - .fallback(not_found_handler) - .layer(CorsLayer::permissive()) -} - -pub async fn get_public_router(state: &Arc) -> Router> { +pub async fn get_router(state: &Arc) -> Router> { let path = format!("/{}", state.config.api_version); let public_path = format!("{path}/public"); Router::new() diff --git a/api/src/routes/protected.rs b/api/src/routes/protected.rs index e833dd25..c974e438 100644 --- a/api/src/routes/protected.rs +++ b/api/src/routes/protected.rs @@ -1,9 +1,9 @@ use crate::{ endpoints::{ - connection, - connection_model_definition::test_connection_model_definition, - connection_model_schema::{self, public_get_connection_model_schema}, - event_access, events, oauth, passthrough, pipeline, transactions, unified, + common_model, connection, connection_definition, + connection_model_definition::{self, test_connection_model_definition}, + connection_model_schema, connection_oauth_definition, event_access, events, metrics, oauth, + openapi, passthrough, pipeline, transactions, unified, }, middleware::{ auth, @@ -13,12 +13,9 @@ use crate::{ server::AppState, }; use axum::{ - error_handling::HandleErrorLayer, - routing::{get, post}, - Router, + error_handling::HandleErrorLayer, middleware::from_fn_with_state, routing::post, Router, }; use http::HeaderName; -use integrationos_domain::connection_model_schema::PublicConnectionModelSchema; use std::{iter::once, sync::Arc}; use tower::{filter::FilterLayer, ServiceBuilder}; use tower_governor::{governor::GovernorConfigBuilder, GovernorLayer}; @@ -34,17 +31,30 @@ pub async fn get_router(state: &Arc) -> Router> { "/connection-model-definitions/test/:id", post(test_connection_model_definition), ) - .route( - "/connection-model-schemas", - get(public_get_connection_model_schema::< - connection_model_schema::PublicGetConnectionModelSchema, - PublicConnectionModelSchema, - >), - ) .nest("/event-access", event_access::get_router()) .nest("/passthrough", passthrough::get_router()) .nest("/oauth", oauth::get_router()) - .nest("/unified", unified::get_router()); + .nest("/unified", unified::get_router()) + .nest( + "/connection-definitions", + connection_definition::get_router(), + ) + .nest( + "/connection-oauth-definitions", + connection_oauth_definition::get_router(), + ) + .nest( + "/connection-model-definitions", + connection_model_definition::get_router(), + ) + .route("/openapi", post(openapi::refresh_openapi)) + .nest( + "/connection-model-schemas", + connection_model_schema::get_router(), + ) + .nest("/common-models", common_model::get_router()) + .layer(TraceLayer::new_for_http()) + .nest("/metrics", metrics::get_router()); let config = Box::new( GovernorConfigBuilder::default() @@ -60,10 +70,7 @@ pub async fn get_router(state: &Arc) -> Router> { .layer(GovernorLayer { config: Box::leak(config), }) - .layer(axum::middleware::from_fn_with_state( - state.clone(), - auth::auth, - )) + .layer(from_fn_with_state(state.clone(), auth::auth)) .layer(TraceLayer::new_for_http()) .layer(SetSensitiveRequestHeadersLayer::new(once( HeaderName::from_lowercase(state.config.headers.auth_header.as_bytes()).unwrap(), diff --git a/api/src/routes/public.rs b/api/src/routes/public.rs index 83552fdc..f94ff2e7 100644 --- a/api/src/routes/public.rs +++ b/api/src/routes/public.rs @@ -1,32 +1,25 @@ -use std::sync::Arc; - -use axum::{ - routing::{get, post}, - Router, -}; -use integrationos_domain::{ - common_model::CommonModel, connection_definition::ConnectionDefinition, -}; -use tower_http::trace::TraceLayer; - use crate::{ endpoints::{ - common_enum, common_model, connection_definition, connection_model_schema, - connection_oauth_definition, event_access::create_event_access_for_new_user, openapi, read, - read_cached, + connection_definition, connection_model_schema, connection_oauth_definition, + event_access::create_event_access_for_new_user, openapi, read_cached, }, middleware::jwt_auth::{self, JwtState}, server::AppState, }; - -const OBFUSCATED_ENDPOINT: &str = - "/e7262bf18c81bc1ff7f726e6d1a6da59f6e77dde0d63d9b60c041af57be8c197"; +use axum::{ + middleware::from_fn_with_state, + routing::{get, post}, + Router, +}; +use integrationos_domain::connection_definition::ConnectionDefinition; +use std::sync::Arc; +use tower_http::trace::TraceLayer; pub fn get_router(state: &Arc) -> Router> { Router::new() .route( "/event-access/default", - post(create_event_access_for_new_user).layer(axum::middleware::from_fn_with_state( + post(create_event_access_for_new_user).layer(from_fn_with_state( Arc::new(JwtState::new(state)), jwt_auth::jwt_auth, )), @@ -45,20 +38,11 @@ pub fn get_router(state: &Arc) -> Router> { .route("/openapi", get(openapi::get_openapi)) .route( "/connection-data/models/:platform_name", - get(connection_model_schema::public_get_platform_models), + get(connection_model_schema::get_platform_models), ) .route( "/connection-data/:model/:platform_name", get(connection_definition::public_get_connection_details), ) - .nest( - OBFUSCATED_ENDPOINT, - Router::new() - .route( - "/common-models", - get(read::), - ) - .route("/common-enums", get(common_enum::read)), - ) .layer(TraceLayer::new_for_http()) } diff --git a/api/src/server.rs b/api/src/server.rs index 40b54dd1..e946840f 100644 --- a/api/src/server.rs +++ b/api/src/server.rs @@ -282,7 +282,7 @@ impl Server { } pub async fn run(&self) -> Result<()> { - let app = self.get_router().await; + let app = routes::get_router(&self.state).await; let app: Router<()> = app.with_state(self.state.clone()); @@ -294,12 +294,4 @@ impl Server { .await .map_err(|e| anyhow!("Server error: {}", e)) } - - async fn get_router(&self) -> Router> { - if self.state.config.is_admin { - routes::get_admin_router(&self.state) - } else { - routes::get_public_router(&self.state).await - } - } } diff --git a/api/src/util/shape_mongo_filter.rs b/api/src/util/shape_mongo_filter.rs index 1322103a..ae237608 100644 --- a/api/src/util/shape_mongo_filter.rs +++ b/api/src/util/shape_mongo_filter.rs @@ -22,6 +22,7 @@ pub fn shape_mongo_filter( query: Option>>, event_access: Option>, headers: Option, + is_filterable: bool, ) -> MongoQuery { let mut filter = doc! {}; let mut skip = 0; @@ -45,9 +46,15 @@ pub fn shape_mongo_filter( filter.insert(DELETED_STR, false); - if let Some(event_access) = event_access { - filter.insert(OWNERSHIP_STR, event_access.ownership.id.to_string()); - filter.insert(ENVIRONMENT_STR, event_access.environment.to_string()); + if is_filterable && event_access.is_some() { + filter.insert( + OWNERSHIP_STR, + event_access.as_ref().unwrap().ownership.id.to_string(), + ); + filter.insert( + ENVIRONMENT_STR, + event_access.as_ref().unwrap().environment.to_string(), + ); if let Some(headers) = headers { if let Some(show_dual_envs) = headers.get(DUAL_ENVIRONMENT_HEADER) { @@ -67,8 +74,11 @@ pub fn shape_mongo_filter( #[cfg(test)] mod test { - use std::{collections::BTreeMap, sync::Arc}; - + use super::shape_mongo_filter; + use crate::util::shape_mongo_filter::{ + MongoQuery, DELETED_STR, DUAL_ENVIRONMENT_HEADER, ENVIRONMENT_STR, LIMIT_STR, + OWNERSHIP_STR, SKIP_STR, + }; use axum::extract::Query; use http::HeaderMap; use integrationos_domain::{ @@ -81,13 +91,7 @@ mod test { record_metadata::RecordMetadata, }, }; - - use crate::util::shape_mongo_filter::{ - MongoQuery, DELETED_STR, DUAL_ENVIRONMENT_HEADER, ENVIRONMENT_STR, LIMIT_STR, - OWNERSHIP_STR, SKIP_STR, - }; - - use super::shape_mongo_filter; + use std::{collections::BTreeMap, sync::Arc}; #[test] fn test_shape_mongo_filter() { @@ -103,7 +107,7 @@ mod test { filter: mut doc, skip, limit, - } = shape_mongo_filter(Some(Query(params.clone())), None, None); + } = shape_mongo_filter(Some(Query(params.clone())), None, None, false); assert_eq!(doc.get_str(OWNERSHIP_STR).unwrap(), "foo"); assert_eq!(doc.get_str(ENVIRONMENT_STR).unwrap(), "bar"); assert!(!doc.get_bool(DELETED_STR).unwrap()); @@ -130,7 +134,7 @@ mod test { }); let MongoQuery { filter: doc, .. } = - shape_mongo_filter(Some(Query(params)), Some(event_access), None); + shape_mongo_filter(Some(Query(params)), Some(event_access), None, true); assert_eq!(doc.get_str(OWNERSHIP_STR).unwrap(), "baz"); assert_eq!(doc.get_str(ENVIRONMENT_STR).unwrap(), "test"); } @@ -166,6 +170,7 @@ mod test { Some(Query(params.clone())), Some(event_access), Some(headers), + true, ); assert!(!doc.contains_key(ENVIRONMENT_STR)); diff --git a/api/tests/api_tests/auth_tests.rs b/api/tests/api_tests/auth_tests.rs index b8182d36..a84c1eee 100644 --- a/api/tests/api_tests/auth_tests.rs +++ b/api/tests/api_tests/auth_tests.rs @@ -1,3 +1,4 @@ +use super::test_server::{ApiResponse, TestServer, PUBLIC_PATHS}; use api::endpoints::event_access::CreateEventAccessPayloadWithOwnership; use fake::{Fake, Faker}; use http::{ @@ -6,11 +7,9 @@ use http::{ }; use serde_json::{json, Value}; -use super::test_server::{ApiResponse, TestServer, AUTH_PATHS, PUBLIC_PATHS}; - #[tokio::test] async fn test_root() { - let server = TestServer::new(false, None).await; + let server = TestServer::new(None).await; let res = server .send_request::("", Method::GET, None, None) @@ -19,69 +18,9 @@ async fn test_root() { assert_eq!(res.code, StatusCode::OK); } -#[tokio::test] -async fn test_authorized() { - let server = TestServer::new(false, None).await; - - for path in AUTH_PATHS { - let res = server - .send_request::(&format!("v1/{path}"), Method::GET, None, None) - .await - .unwrap(); - assert_eq!( - res, - ApiResponse { - code: StatusCode::UNAUTHORIZED, - data: json!({"error": "Unauthorized"}) - } - ); - - let res = server - .send_request::( - &format!("v1/{path}"), - Method::GET, - Some("invalid_access_key"), - None, - ) - .await - .unwrap(); - assert_eq!( - res, - ApiResponse { - code: StatusCode::UNAUTHORIZED, - data: json!({"error": "Unauthorized"}) - } - ); - - let res = server - .send_request::( - &format!("v1/{path}"), - Method::GET, - Some(&server.live_key), - None, - ) - .await - .unwrap(); - - assert_eq!(res.code, StatusCode::OK); - - let res = server - .send_request::( - &format!("v1/{path}"), - Method::GET, - Some(&server.test_key), - None, - ) - .await - .unwrap(); - - assert_eq!(res.code, StatusCode::OK); - } -} - #[tokio::test] async fn test_unauthorized() { - let server = TestServer::new(false, None).await; + let server = TestServer::new(None).await; for path in PUBLIC_PATHS { let res = server @@ -94,7 +33,7 @@ async fn test_unauthorized() { #[tokio::test] async fn test_404() { - let server = TestServer::new(false, None).await; + let server = TestServer::new(None).await; for method in [Method::GET, Method::POST, Method::DELETE] { let res = server @@ -114,10 +53,8 @@ async fn test_404() { #[tokio::test] async fn test_jwt() { - let server = TestServer::new(false, None).await; - + let server = TestServer::new(None).await; let jwt_token = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2NTc5ZDUxMGE2ZTQyMTAyMzM0NjI0ZjAiLCJlbWFpbCI6ImVtYWlsQHRlc3QuY29tIiwidXNlcm5hbWUiOiJ1c2VybmFtZSIsInVzZXJLZXkiOiJ1c2VyS2V5IiwiZmlyc3ROYW1lIjoiUGF1bCIsImxhc3ROYW1lIjoiSy4iLCJidWlsZGFibGVJZCI6ImJ1aWxkLTI2MTU4YWFlNzNjMDQ4YTU4YzdhNzU2NjcyNmU4OGY0IiwiY29udGFpbmVySWQiOiJjb250YWluZXItZDRmMGY4YjktMWE1Ni00ODQxLTg1OTctZmQzZDkwZGQ0OWI5IiwicG9pbnRlcnMiOlsiXzFfazFjbkI0Y1hGMzYtYUJJc2gtY1ZWTlZNZllGeE41MWlFTlQ1azlqcXFEbURWZlpJTjVVREhlN0JKRnJaUVJqTm54aEdaOUJNUGdlNjB6RVdVUnROaTUxdTIwdDJiYVJoQ3ZkYms5TkNIblNSV010WldhMmFlVW0wWUpreU1PNGNEUjdVUW5oVmNac3RqUEdfN0lfcV9ya015cjlwaFZoZ1VBa3BCaDVDTlQ2VDIwTDJGTFpoMFVtdldLVzloV3IzN0JWV19tb0hZODFZeUEiLCJfMV81WVU2Uk1kMHRwUVh3YnNvUWtHaUkzT1hPRlhrbms3TUVhaVdTQ1hoUWZKYzZ5N3RqZGROZGRjbXdWRjJmcTRSTktla0ZXRk80M0FMQWNJTVdIYkdYbW9IVVRaelV1eXhMalJ5MDI5Z0tGMlViRTFmTzZVRzR5QWhzbFBJMlpOZXNnT2NiakY1eUdwajdJbkdHNUFVck13NGY0bVdfR29FZVp1ZXBBd2E0WHhzNHB2TXd5d241djc1VzV0dFNJRGtLTHFqUlNUQlczaHpLUSJdLCJpc0J1aWxkYWJsZUNvcmUiOnRydWUsImlhdCI6MTcwMzEwODkwNCwiZXhwIjozMTU3NDYzMTA4OTA0LCJhdWQiOiJidWlsZGFibGUtdXNlcnMiLCJpc3MiOiJidWlsZGFibGUifQ.ecKXIGxXLWd6OearftRZVpGRhyDUVZFrYlwzhr-iG0A"; - let event_access: CreateEventAccessPayloadWithOwnership = Faker.fake(); let event_access = serde_json::to_value(&event_access).unwrap(); diff --git a/api/tests/api_tests/get_tests.rs b/api/tests/api_tests/get_tests.rs index 9aa0af79..24634413 100644 --- a/api/tests/api_tests/get_tests.rs +++ b/api/tests/api_tests/get_tests.rs @@ -13,7 +13,7 @@ use crate::test_server::{test_gateway::TestGateway, TestServer}; #[tokio::test] async fn test_get_events() { - let server = TestServer::new(false, None).await; + let server = TestServer::new(None).await; let gateway = TestGateway::new(&server.config).await; @@ -39,7 +39,7 @@ async fn test_get_events() { #[tokio::test] async fn test_get_expanded_common_model() { - let server = TestServer::new(true, None).await; + let server = TestServer::new(None).await; let reference: String = Faker.fake(); @@ -84,7 +84,7 @@ async fn test_get_expanded_common_model() { .send_request::( "v1/common-models", Method::POST, - None, + Some(&server.live_key), Some(&serde_json::to_value(expandable).unwrap()), ) .await @@ -97,7 +97,7 @@ async fn test_get_expanded_common_model() { .send_request::( "v1/common-models", Method::POST, - None, + Some(&server.live_key), Some(&serde_json::to_value(base).unwrap()), ) .await @@ -121,7 +121,7 @@ async fn test_get_expanded_common_model() { .send_request::( &format!("v1/common-models/{}/expand", base.id), Method::GET, - None, + Some(&server.live_key), None, ) .await @@ -168,7 +168,7 @@ async fn test_get_expanded_common_model() { .send_request::( &format!("v1/common-models/{}/schema", base.id), Method::GET, - None, + Some(&server.live_key), None, ) .await diff --git a/api/tests/api_tests/pagination_tests.rs b/api/tests/api_tests/pagination_tests.rs index 4ad65c45..1316d909 100644 --- a/api/tests/api_tests/pagination_tests.rs +++ b/api/tests/api_tests/pagination_tests.rs @@ -11,7 +11,7 @@ use crate::test_server::TestServer; #[tokio::test] async fn test_pagination() { - let server = TestServer::new(false, None).await; + let server = TestServer::new(None).await; let mut pipelines = vec![]; for _ in 0..10 { diff --git a/api/tests/api_tests/passthrough_tests.rs b/api/tests/api_tests/passthrough_tests.rs index 9437395d..7434a0a0 100644 --- a/api/tests/api_tests/passthrough_tests.rs +++ b/api/tests/api_tests/passthrough_tests.rs @@ -1,3 +1,4 @@ +use crate::test_server::TestServer; use api::endpoints::connection_model_definition::CreateRequest as CreateConnectionModelDefinitionRequest; use fake::{faker::filesystem::raw::DirPath, locales::EN, Fake, Faker}; use http::{ @@ -12,14 +13,9 @@ use integrationos_domain::{ use mockito::Server; use serde_json::Value; -use crate::test_server::TestServer; - #[tokio::test] async fn test_passthrough_api() { - let mut server = TestServer::new(false, None).await; - let admin_server = - TestServer::new(true, Some(server.config.db_config.control_db_name.clone())).await; - + let mut server = TestServer::new(None).await; let (connection, conn_def) = server.create_connection(Environment::Live).await; let mut mock_server = Server::new_async().await; @@ -75,11 +71,11 @@ async fn test_passthrough_api() { mapping: None, }; - let create_model_definition_response = admin_server + let create_model_definition_response = server .send_request::( "v1/connection-model-definitions", Method::POST, - None, + Some(&server.live_key), Some(&serde_json::to_value(&create_model_definition_payload).unwrap()), ) .await diff --git a/api/tests/api_tests/schema_tests.rs b/api/tests/api_tests/schema_tests.rs index e9cea3c6..93f29f0d 100644 --- a/api/tests/api_tests/schema_tests.rs +++ b/api/tests/api_tests/schema_tests.rs @@ -1,95 +1,10 @@ -use api::endpoints::{connection_model_schema::CreateRequest, ReadResponse}; -use fake::{Fake, Faker}; +use crate::test_server::TestServer; use http::{Method, StatusCode}; -use integrationos_domain::{ - id::{prefix::IdPrefix, Id}, - { - connection_model_schema::{ConnectionModelSchema, Mappings}, - environment::Environment, - json_schema::JsonSchema, - }, -}; use serde_json::Value; -use crate::test_server::TestServer; - -#[tokio::test] -async fn test_connection_model_schema_api() { - let mut server = TestServer::new(false, None).await; - let admin_server = - TestServer::new(true, Some(server.config.db_config.control_db_name.clone())).await; - - let (_connection, conn_def) = server.create_connection(Environment::Live).await; - - let common_model_name = Faker.fake(); - - let mut create_connection_model_schema: CreateRequest = Faker.fake(); - create_connection_model_schema.connection_definition_id = conn_def.id; - create_connection_model_schema.mapping = Some(Mappings { - from_common_model: String::new(), - to_common_model: String::new(), - common_model_name, - common_model_id: Id::now(IdPrefix::ConnectionModelSchema), - unmapped_fields: JsonSchema::default(), - }); - - let create_response = admin_server - .send_request::( - "v1/connection-model-schemas", - Method::POST, - None, - Some(&create_connection_model_schema), - ) - .await - .unwrap(); - - assert_eq!(create_response.code, StatusCode::OK); - - let public_connection_model_schema = server - .send_request::>( - format!( - "v1/connection-model-schemas?connectionDefinitionId={}", - conn_def.id - ) - .as_str(), - Method::GET, - Some(&server.live_key), - None, - ) - .await - .unwrap(); - - assert_eq!(public_connection_model_schema.code, StatusCode::OK); - - let first_row = public_connection_model_schema - .data - .rows - .first() - .expect("No rows in response"); - - let mapping = first_row.get("mapping").expect("No mapping in row"); - - assert!( - mapping.get("fromCommonModel").is_none(), - "fromCommonModel should not be present" - ); - assert!( - mapping.get("toCommonModel").is_none(), - "toCommonModel should not be present" - ); - assert!( - mapping.get("commonModelId").is_none(), - "commonModelId should not be present" - ); - assert!( - mapping.get("unmappedFields").is_none(), - "unmappedFields should not be present" - ); -} - #[tokio::test] async fn test_connection_oauth_definition_schema_api() { - let server = TestServer::new(false, None).await; + let server = TestServer::new(None).await; let res = server .send_request::( "v1/public/connection-oauth-definition-schema", diff --git a/api/tests/api_tests/test_crud.rs b/api/tests/api_tests/test_crud.rs index 2b15a5ec..3d2ff332 100644 --- a/api/tests/api_tests/test_crud.rs +++ b/api/tests/api_tests/test_crud.rs @@ -1,5 +1,3 @@ -use std::collections::HashMap; - use crate::test_server::TestServer; use api::endpoints::{ common_model, connection_definition, connection_model_definition, connection_model_schema, @@ -13,12 +11,13 @@ use integrationos_domain::{ connection_model_schema::ConnectionModelSchema, }; use serde_json::Value; +use std::collections::HashMap; -macro_rules! test_crud { - ($test:ident, $model:ty, $path:ident, $endpoint:expr) => { - #[tokio::test] +macro_rules! crud { + ($(#[$m:meta])*, $test:ident, $model:ty, $path:ident, $endpoint:expr) => { + $(#[$m])* async fn $test() { - let server = TestServer::new(true, None).await; + let server = TestServer::new(None).await; let payload: $path::CreateRequest = Faker.fake(); let payload = serde_json::to_value(&payload).unwrap(); @@ -26,16 +25,16 @@ macro_rules! test_crud { const ENDPOINT: &str = $endpoint; let res = server - .send_request::(ENDPOINT, Method::POST, None, Some(&payload)) + .send_request::(ENDPOINT, Method::POST, Some(&server.live_key), Some(&payload)) .await .unwrap(); assert_eq!(res.code, StatusCode::OK); - let model: $model = serde_json::from_value(res.data).unwrap(); + let model: $model = serde_json::from_value(res.data).expect("Failed to deserialize model"); let res = server - .send_request::(ENDPOINT, Method::GET, None, None) + .send_request::(ENDPOINT, Method::GET, Some(&server.live_key), None) .await .unwrap(); @@ -51,7 +50,7 @@ macro_rules! test_crud { let path = format!("{ENDPOINT}/{}", model.id); let res = server - .send_request::(&path, Method::PATCH, None, Some(&payload)) + .send_request::(&path, Method::PATCH, Some(&server.live_key), Some(&payload)) .await; let res = res.unwrap(); @@ -59,7 +58,7 @@ macro_rules! test_crud { assert_eq!(res.code, StatusCode::OK); let res = server - .send_request::(&path, Method::DELETE, None, None) + .send_request::(&path, Method::DELETE, Some(&server.live_key), None) .await .unwrap(); @@ -69,7 +68,7 @@ macro_rules! test_crud { assert_eq!(deleted.id, model.id); let res = server - .send_request::(ENDPOINT, Method::GET, None, None) + .send_request::(ENDPOINT, Method::GET, Some(&server.live_key), None) .await .unwrap(); @@ -81,21 +80,24 @@ macro_rules! test_crud { }; } -test_crud!( +crud!( + #[tokio::test], test_connection_definitions_crud, ConnectionDefinition, connection_definition, "v1/connection-definitions" ); -test_crud!( +crud!( + #[tokio::test], test_connection_model_definitions_crud, ConnectionModelDefinition, connection_model_definition, "v1/connection-model-definitions" ); -test_crud!( +crud!( + #[tokio::test], test_connection_model_schema_crud, ConnectionModelSchema, connection_model_schema, @@ -104,7 +106,7 @@ test_crud!( #[tokio::test] async fn test_common_model_crud() { - let server = TestServer::new(true, None).await; + let server = TestServer::new(None).await; let payload: common_model::CreateRequest = Faker.fake(); let payload = serde_json::to_value(&payload).unwrap(); @@ -112,7 +114,12 @@ async fn test_common_model_crud() { const ENDPOINT: &str = "v1/common-models"; let res = server - .send_request::(ENDPOINT, Method::POST, None, Some(&payload)) + .send_request::( + ENDPOINT, + Method::POST, + Some(&server.live_key), + Some(&payload), + ) .await .unwrap(); @@ -122,7 +129,7 @@ async fn test_common_model_crud() { model.interface = HashMap::new(); let res = server - .send_request::(ENDPOINT, Method::GET, None, None) + .send_request::(ENDPOINT, Method::GET, Some(&server.live_key), None) .await .unwrap(); @@ -143,7 +150,7 @@ async fn test_common_model_crud() { let path = format!("{ENDPOINT}/{}", model.id); let res = server - .send_request::(&path, Method::PATCH, None, Some(&payload)) + .send_request::(&path, Method::PATCH, Some(&server.live_key), Some(&payload)) .await; let res = res.unwrap(); @@ -151,7 +158,7 @@ async fn test_common_model_crud() { assert_eq!(res.code, StatusCode::OK); let res = server - .send_request::(&path, Method::DELETE, None, None) + .send_request::(&path, Method::DELETE, Some(&server.live_key), None) .await .unwrap(); @@ -163,7 +170,7 @@ async fn test_common_model_crud() { assert_eq!(deleted.id, model.id); let res = server - .send_request::(ENDPOINT, Method::GET, None, None) + .send_request::(ENDPOINT, Method::GET, Some(&server.live_key), None) .await .unwrap(); diff --git a/api/tests/api_tests/test_server/mod.rs b/api/tests/api_tests/test_server/mod.rs index 893732d7..ddf9359d 100644 --- a/api/tests/api_tests/test_server/mod.rs +++ b/api/tests/api_tests/test_server/mod.rs @@ -60,15 +60,6 @@ pub mod test_core; #[cfg(test)] pub mod test_gateway; -#[allow(dead_code)] -pub const AUTH_PATHS: &[&str] = &[ - "pipelines", - "events", - "transactions", - "connections", - "event-access", -]; - #[allow(dead_code)] pub const PUBLIC_PATHS: &[&str] = &["connection-definitions", "openapi"]; @@ -135,7 +126,7 @@ pub struct ApiResponse { } impl TestServer { - pub async fn new(is_admin: bool, dn_name: Option) -> Self { + pub async fn new(db_name: Option) -> Self { // init tracing once TRACING.get_or_init(|| { let filter = EnvFilter::builder() @@ -164,7 +155,7 @@ impl TestServer { .port(); // Random database name - let db_name = dn_name.unwrap_or_else(|| Uuid::new_v4().to_string()); + let db_name = db_name.unwrap_or_else(|| Uuid::new_v4().to_string()); let config = Config::init_from_hashmap(&HashMap::from([ ("CONTROL_DATABASE_URL".to_string(), db.clone()), @@ -177,8 +168,6 @@ impl TestServer { "INTERNAL_SERVER_ADDRESS".to_string(), format!("0.0.0.0:{port}"), ), - ("IS_ADMIN".to_string(), is_admin.to_string()), - ("CLAUDE_API_KEY".to_string(), "".to_string()), ("OPENAI_API_KEY".to_string(), "".to_string()), ("MOCK_LLM".to_string(), "true".to_string()), ("CACHE_SIZE".to_string(), "0".to_string()), @@ -189,6 +178,8 @@ impl TestServer { let secrets_client = Arc::new(MockSecretsClient::default()); let data: AccessKeyData = Faker.fake(); + // this is missing a setup part + let ownership_id = data.id.clone(); let prefix = AccessKeyPrefix { environment: Environment::Live, @@ -311,18 +302,15 @@ impl TestServer { #[allow(dead_code)] pub async fn create_connection( &mut self, - env: Environment, + environment: Environment, ) -> (Connection, ConnectionModelDefinition) { - let (key, access_key) = match env { + let (key, access_key) = match environment { Environment::Live => (self.live_key.as_ref(), &self.live_access_key), Environment::Development => (self.live_key.as_ref(), &self.test_access_key), Environment::Test => (self.test_key.as_ref(), &self.test_access_key), Environment::Production => (self.live_key.as_ref(), &self.live_access_key), }; - let admin_server = - TestServer::new(true, Some(self.config.db_config.control_db_name.clone())).await; - let bearer_key: String = Faker.fake(); let template: String = Faker.fake(); let handlebar_template = format!("{{{{{template}}}}}"); @@ -336,11 +324,11 @@ impl TestServer { }; test_connection.http_method = Method::GET; - let res = admin_server + let res = self .send_request::( "v1/connection-model-definitions", http::Method::POST, - None, + Some(key), Some(&test_connection), ) .await @@ -394,11 +382,11 @@ impl TestServer { let payload = to_value(&connection_def).unwrap(); - let res = admin_server + let res = self .send_request::( "v1/connection-definitions", http::Method::POST, - None, + Some(key), Some(&payload), ) .await @@ -491,11 +479,11 @@ impl TestServer { }), }; - let res = admin_server + let res = self .send_request::( "v1/connection-model-definitions", http::Method::POST, - None, + Some(self.live_key.as_ref()), Some(&model_def), ) .await diff --git a/api/tests/api_tests/transaction_tests.rs b/api/tests/api_tests/transaction_tests.rs index 6149741b..20fca8a0 100644 --- a/api/tests/api_tests/transaction_tests.rs +++ b/api/tests/api_tests/transaction_tests.rs @@ -11,9 +11,10 @@ use serde_json::{json, Value}; use crate::test_server::{test_core::TestCore, test_gateway::TestGateway, TestServer}; -#[tokio::test] +#[tokio::test(flavor = "multi_thread")] +#[ignore = "Prometheus GlobalRecorder conflicts with other tests. It passes when run individually."] async fn test_event_core() { - let mut server = TestServer::new(false, None).await; + let mut server = TestServer::new(None).await; let (connection, conn_def) = server.create_connection(Environment::Live).await; diff --git a/api/tests/api_tests/unified_tests.rs b/api/tests/api_tests/unified_tests.rs index 11014377..4d98e221 100644 --- a/api/tests/api_tests/unified_tests.rs +++ b/api/tests/api_tests/unified_tests.rs @@ -1,5 +1,4 @@ -use std::time::Duration; - +use crate::test_server::TestServer; use api::endpoints::{ connection_model_definition::CreateRequest as CreateConnectionModelDefinitionRequest, connection_model_schema::CreateRequest as CreateConnectionModelSchemaRequest, @@ -23,12 +22,11 @@ use integrationos_domain::{ }; use mockito::Mock; use serde_json::Value; - -use crate::test_server::TestServer; +use std::time::Duration; #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_unified_api_get_many() { - let mut server = TestServer::new(false, None).await; + let mut server = TestServer::new(None).await; let (connection, _) = server.create_connection(Environment::Live).await; let name = "Model".to_string(); @@ -78,6 +76,8 @@ async fn test_unified_api_get_many() { .await .unwrap(); + println!("{:?}", res); + assert_eq!(res.code, StatusCode::OK); mock.assert_async().await; @@ -85,7 +85,7 @@ async fn test_unified_api_get_many() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_unified_api_get_one() { - let mut server = TestServer::new(false, None).await; + let mut server = TestServer::new(None).await; let (connection, _) = server.create_connection(Environment::Live).await; let name = "Model".to_string(); @@ -143,7 +143,7 @@ async fn test_unified_api_get_one() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_unified_api_get_count() { - let mut server = TestServer::new(false, None).await; + let mut server = TestServer::new(None).await; let (connection, _) = server.create_connection(Environment::Live).await; let name = "Model".to_string(); @@ -199,7 +199,7 @@ async fn test_unified_api_get_count() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_unified_api_update() { - let mut server = TestServer::new(false, None).await; + let mut server = TestServer::new(None).await; let (connection, _) = server.create_connection(Environment::Live).await; let name = "Model".to_string(); @@ -259,7 +259,7 @@ async fn test_unified_api_update() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_unified_api_delete() { - let mut server = TestServer::new(false, None).await; + let mut server = TestServer::new(None).await; let (connection, _) = server.create_connection(Environment::Live).await; let name = "Model".to_string(); @@ -317,7 +317,7 @@ async fn test_unified_api_delete() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_unified_api_create() { - let mut server = TestServer::new(false, None).await; + let mut server = TestServer::new(None).await; let (connection, _) = server.create_connection(Environment::Live).await; let name = "Model".to_string(); @@ -375,7 +375,7 @@ async fn test_unified_api_create() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_unified_metrics() { - let mut server = TestServer::new(false, None).await; + let mut server = TestServer::new(None).await; let (connection, _) = server.create_connection(Environment::Live).await; let name = "Model".to_string(); @@ -420,11 +420,8 @@ async fn test_unified_metrics() { tokio::time::sleep(Duration::from_millis(100)).await; - let admin_server = - TestServer::new(true, Some(server.config.db_config.control_db_name.clone())).await; - - let res = admin_server - .send_request::<(), MetricResponse>("v1/metrics", Method::GET, None, None) + let res = server + .send_request::<(), MetricResponse>("v1/metrics", Method::GET, Some(&server.live_key), None) .await .unwrap(); @@ -454,11 +451,11 @@ async fn test_unified_metrics() { tokio::time::sleep(Duration::from_millis(100)).await; - let res = admin_server + let res = server .send_request::<(), MetricResponse>( format!("v1/metrics/{}", connection.ownership.client_id).as_str(), Method::GET, - None, + Some(&server.live_key), None, ) .await @@ -473,7 +470,7 @@ async fn test_unified_metrics() { let daily_key = format!("{year}-{month:02}-{day:02}"); let monthly_key = format!("{year}-{month:02}"); - let res = admin_server + let res = server .send_request::<(), MetricResponse>( format!( "v1/metrics/{}?day={daily_key}", @@ -481,7 +478,7 @@ async fn test_unified_metrics() { ) .as_str(), Method::GET, - None, + Some(&server.live_key), None, ) .await @@ -489,7 +486,7 @@ async fn test_unified_metrics() { assert_eq!(res.data.count, 2); - let res = admin_server + let res = server .send_request::<(), MetricResponse>( format!( "v1/metrics/{}?month={monthly_key}&apiType=unified", @@ -497,7 +494,7 @@ async fn test_unified_metrics() { ) .as_str(), Method::GET, - None, + Some(&server.live_key), None, ) .await @@ -505,11 +502,11 @@ async fn test_unified_metrics() { assert_eq!(res.data.count, 2); - let res = admin_server + let res = server .send_request::<(), MetricResponse>( format!("v1/metrics?platform={}", connection.platform).as_str(), Method::GET, - None, + Some(&server.live_key), None, ) .await @@ -517,11 +514,11 @@ async fn test_unified_metrics() { assert_eq!(res.data.count, 2); - let res = admin_server + let res = server .send_request::<(), MetricResponse>( "v1/metrics?apiType=passthrough", Method::GET, - None, + Some(&server.live_key), None, ) .await @@ -589,13 +586,11 @@ async fn create_connection_model_definition( mapping: Some(mapping.clone()), }; - let admin_server = - TestServer::new(true, Some(server.config.db_config.control_db_name.clone())).await; - let create_model_definition_response = admin_server + let create_model_definition_response = server .send_request::( "v1/connection-model-definitions", Method::POST, - None, + Some(&server.live_key), Some(&create_model_definition_payload), ) .await @@ -613,11 +608,11 @@ async fn create_connection_model_definition( unmapped_fields: Default::default(), }); - let res = admin_server + let res = server .send_request::( "v1/connection-model-schemas", Method::POST, - None, + Some(&server.live_key), Some(&schema), ) .await diff --git a/docker-compose.yml b/docker-compose.yml index 8912867c..2c1037a2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,24 +1,6 @@ version: "3.8" services: - admin-api: - platform: linux/amd64 - image: us-docker.pkg.dev/integrationos/docker-oss/api:1.0.0 - ports: - - 3004:3004 - environment: - - CACHE_SIZE=0 - - CLAUDE_API_KEY= - - CONTROL_DATABASE_NAME=events-service - - CONTROL_DATABASE_URL=mongodb://integrationos:${MONGO_PASSWORD}@mongo:27017 - - EVENT_ACCESS_PASSWORD=${EVENT_ACCESS_PASSWORD} - - INTERNAL_SERVER_ADDRESS=0.0.0.0:3004 - - IS_ADMIN=true - - OPENAI_API_KEY= - - RUST_LOG=api=info,tower_http=info,udm=info - - SECRETS_SERVICE_BASE_URL=http://secrets-service:3006/ - - WORKER_THREADS=4 - typescript-services: platform: linux/amd64 image: us-docker.pkg.dev/integrationos/docker-oss/typescript-services:1.0.0 @@ -53,7 +35,6 @@ services: environment: - ACCESS_KEY_WHITELIST_REFRESH_INTERVAL_SECS=30 - CACHE_SIZE=1000 - - CLAUDE_API_KEY= - CONTROL_DATABASE_NAME=events-service - CONTROL_DATABASE_URL=mongodb://integrationos:${MONGO_PASSWORD}@mongo:27017 - DEBUG_MODE=false @@ -61,7 +42,6 @@ services: - EVENT_ACCESS_PASSWORD=${EVENT_ACCESS_PASSWORD} - INTERNAL_SERVER_ADDRESS=0.0.0.0:3005 - JWT_SECRET=${JWT_SECRET} - - OPENAI_API_KEY= - REDIS_URL=redis://redis:6379 - RUST_LOG=api=info,tower_http=info,udm=info,integrationos_domain=info - SECRETS_SERVICE_BASE_URL=http://secrets-service:3006/