From 4afe1df9b982b7f9dd54fc7db78d85c06ac4081b Mon Sep 17 00:00:00 2001 From: Brent Schroeter Date: Fri, 2 May 2025 23:48:54 -0700 Subject: [PATCH] initial commit --- .dockerignore | 8 + .gitignore | 3 + Cargo.lock | 3755 +++++++++++++++++ Cargo.toml | 37 + Dockerfile | 22 + bacon.toml | 114 + catalogs/Cargo.lock | 199 + catalogs/Cargo.toml | 8 + catalogs/Makefile | 4 + catalogs/diesel.toml | 11 + catalogs/src/catalogs_schema.rs | 195 + catalogs/src/lib.rs | 6 + catalogs/src/pg_attribute.rs | 32 + catalogs/src/pg_class.rs | 25 + catalogs/src/pg_namespace.rs | 23 + catalogs/src/pg_roles.rs | 50 + catalogs/src/table_privileges.rs | 38 + diesel.toml | 9 + migrations/.keep | 0 .../down.sql | 6 + .../up.sql | 36 + migrations/2024-11-25-232658_init/down.sql | 1 + migrations/2024-11-25-232658_init/up.sql | 6 + .../2025-01-08-211839_sessions/down.sql | 1 + migrations/2025-01-08-211839_sessions/up.sql | 8 + src/abstract_.rs | 46 + src/app_error.rs | 81 + src/app_state.rs | 90 + src/auth.rs | 217 + src/cli.rs | 94 + src/main.rs | 55 + src/middleware.rs | 17 + src/migrations.rs | 3 + src/nav.rs | 236 ++ src/router.rs | 136 + src/schema.rs | 23 + src/sessions.rs | 173 + src/settings.rs | 107 + src/users.rs | 175 + src/worker.rs | 10 + static/_404.html | 9 + static/favicon.ico | Bin 0 -> 2965 bytes static/logo.svg | 41 + static/main.css | 13 + templates/base.html | 12 + templates/meta_tags.html | 4 + templates/nav.html | 7 + templates/tmp.html | 18 + 48 files changed, 6164 insertions(+) create mode 100644 .dockerignore create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 Dockerfile create mode 100644 bacon.toml create mode 100644 catalogs/Cargo.lock create mode 100644 catalogs/Cargo.toml create mode 100644 catalogs/Makefile create mode 100644 catalogs/diesel.toml create mode 100644 catalogs/src/catalogs_schema.rs create mode 100644 catalogs/src/lib.rs create mode 100644 catalogs/src/pg_attribute.rs create mode 100644 catalogs/src/pg_class.rs create mode 100644 catalogs/src/pg_namespace.rs create mode 100644 catalogs/src/pg_roles.rs create mode 100644 catalogs/src/table_privileges.rs create mode 100644 diesel.toml create mode 100644 migrations/.keep create mode 100644 migrations/00000000000000_diesel_initial_setup/down.sql create mode 100644 migrations/00000000000000_diesel_initial_setup/up.sql create mode 100644 migrations/2024-11-25-232658_init/down.sql create mode 100644 migrations/2024-11-25-232658_init/up.sql create mode 100644 migrations/2025-01-08-211839_sessions/down.sql create mode 100644 migrations/2025-01-08-211839_sessions/up.sql create mode 100644 src/abstract_.rs create mode 100644 src/app_error.rs create mode 100644 src/app_state.rs create mode 100644 src/auth.rs create mode 100644 src/cli.rs create mode 100644 src/main.rs create mode 100644 src/middleware.rs create mode 100644 src/migrations.rs create mode 100644 src/nav.rs create mode 100644 src/router.rs create mode 100644 src/schema.rs create mode 100644 src/sessions.rs create mode 100644 src/settings.rs create mode 100644 src/users.rs create mode 100644 src/worker.rs create mode 100644 static/_404.html create mode 100644 static/favicon.ico create mode 100644 static/logo.svg create mode 100644 static/main.css create mode 100644 templates/base.html create mode 100644 templates/meta_tags.html create mode 100644 templates/nav.html create mode 100644 templates/tmp.html diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a97be14 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.git/ +.env +example.env +build +dev-services +bacon.toml +target +.DS_Store diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..839bf78 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +target +.env +.DS_Store diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..d89b516 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,3755 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy 0.7.35", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anstyle-parse" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +dependencies = [ + "anstyle", + "once_cell", + "windows-sys 0.59.0", +] + +[[package]] +name = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + +[[package]] +name = "arrayref" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "askama" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" +dependencies = [ + "askama_derive", + "askama_escape", + "humansize", + "num-traits", + "percent-encoding", +] + +[[package]] +name = "askama_derive" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" +dependencies = [ + "askama_parser", + "basic-toml", + "mime", + "mime_guess", + "proc-macro2", + "quote", + "serde", + "syn", +] + +[[package]] +name = "askama_escape" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" + +[[package]] +name = "askama_parser" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" +dependencies = [ + "nom", +] + +[[package]] +name = "async-compression" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "310c9bcae737a48ef5cdee3174184e6d548b292739ede61a1f955ef76a738861" +dependencies = [ + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener", +] + +[[package]] +name = "async-session" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07da4ce523b4e2ebaaf330746761df23a465b951a83d84bbce4233dabedae630" +dependencies = [ + "anyhow", + "async-lock", + "async-trait", + "base64 0.13.1", + "bincode", + "blake3", + "chrono", + "hmac", + "log", + "rand", + "serde", + "serde_json", + "sha2 0.9.9", +] + +[[package]] +name = "async-trait" +version = "0.1.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "axum" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d6fd624c75e18b3b4c6b9caf42b1afe24437daaee904069137d8bab077be8b8" +dependencies = [ + "axum-core", + "axum-macros", + "bytes", + "form_urlencoded", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df1362f362fd16024ae199c1970ce98f9661bf5ef94b9808fee734bc3698b733" +dependencies = [ + "bytes", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-extra" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "460fc6f625a1f7705c6cf62d0d070794e94668988b1c38111baeec177c715f7b" +dependencies = [ + "axum", + "axum-core", + "bytes", + "cookie", + "form_urlencoded", + "futures-util", + "headers", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "serde", + "serde_html_form", + "serde_path_to_error", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "604fde5e028fea851ce1d8570bbdc034bec850d157f7569d10f347d06808c05c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "basic-toml" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" +dependencies = [ + "serde", +] + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +dependencies = [ + "serde", +] + +[[package]] +name = "blake3" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if 0.1.10", + "constant_time_eq", + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "catalogs" +version = "0.1.0" +dependencies = [ + "chrono", + "diesel", +] + +[[package]] +name = "cc" +version = "1.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[package]] +name = "clap" +version = "4.5.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_derive" +version = "4.5.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "colorchoice" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" + +[[package]] +name = "config" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68578f196d2a33ff61b27fae256c3164f65e36382648e30666dde05b8cc9dfdf" +dependencies = [ + "async-trait", + "convert_case", + "json5", + "nom", + "pathdiff", + "ron", + "rust-ini", + "serde", + "serde_json", + "toml", + "yaml-rust2", +] + +[[package]] +name = "const-random" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87e00182fe74b066627d63b85fd550ac2998d4b0bd86bfed477a0ae4c7c71359" +dependencies = [ + "const-random-macro", +] + +[[package]] +name = "const-random-macro" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" +dependencies = [ + "getrandom 0.2.15", + "once_cell", + "tiny-keccak", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "cookie" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ddef33a339a91ea89fb53151bd0a4689cfce27055c291dfa69945475d22c747" +dependencies = [ + "percent-encoding", + "time", + "version_check", +] + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "darling" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "deadpool" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ed5957ff93768adf7a65ab167a17835c3d2c3c50d084fe305174c112f468e2f" +dependencies = [ + "deadpool-runtime", + "num_cpus", + "serde", + "tokio", +] + +[[package]] +name = "deadpool-diesel" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590573e9e29c5190a5ff782136f871e6e652e35d598a349888e028693601adf1" +dependencies = [ + "deadpool", + "deadpool-sync", + "diesel", +] + +[[package]] +name = "deadpool-runtime" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "092966b41edc516079bdf31ec78a2e0588d1d0c08f78b91d8307215928642b2b" +dependencies = [ + "tokio", +] + +[[package]] +name = "deadpool-sync" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524bc3df0d57e98ecd022e21ba31166c2625e7d3e5bcc4510efaeeab4abcab04" +dependencies = [ + "deadpool-runtime", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn", +] + +[[package]] +name = "diesel" +version = "2.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff3e1edb1f37b4953dd5176916347289ed43d7119cc2e6c7c3f7849ff44ea506" +dependencies = [ + "bitflags 2.9.0", + "byteorder", + "chrono", + "diesel_derives", + "itoa", + "pq-sys", + "serde_json", + "uuid", +] + +[[package]] +name = "diesel_derives" +version = "2.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a93958254b70bea63b4187ff73d10180599d9d8d177071b7f91e6da4e0c0ad55" +dependencies = [ + "diesel_table_macro_syntax", + "dsl_auto_type", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "diesel_migrations" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a73ce704bad4231f001bff3314d91dce4aba0770cee8b233991859abc15c1f6" +dependencies = [ + "diesel", + "migrations_internals", + "migrations_macros", +] + +[[package]] +name = "diesel_table_macro_syntax" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +dependencies = [ + "syn", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dlv-list" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "442039f5147480ba31067cb00ada1adae6892028e40e45fc5de7b7df6dcc1b5f" +dependencies = [ + "const-random", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "dsl_auto_type" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" +dependencies = [ + "darling", + "either", + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "flate2" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "h2" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 0.2.12", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.3.1", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] +name = "headers" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9" +dependencies = [ + "base64 0.21.7", + "bytes", + "headers-core", + "http 1.3.1", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" +dependencies = [ + "http 1.3.1", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.0", + "digest 0.9.0", +] + +[[package]] +name = "http" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.3.1", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http 1.3.1", + "http-body 1.0.1", + "pin-project-lite", +] + +[[package]] +name = "http-range-header" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9171a2ea8a68358193d15dd5d70c1c10a2afc3e7e4c5bc92bc9f025cebd7359c" + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "humansize" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] + +[[package]] +name = "hyper" +version = "0.14.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.8", + "http 1.3.1", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +dependencies = [ + "futures-util", + "http 0.2.12", + "hyper 0.14.32", + "rustls 0.21.12", + "tokio", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http 1.3.1", + "hyper 1.6.0", + "hyper-util", + "rustls 0.23.23", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.2", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.6.0", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "hyper 1.6.0", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +dependencies = [ + "equivalent", + "hashbrown 0.15.2", +] + +[[package]] +name = "interim" +version = "0.0.1" +dependencies = [ + "anyhow", + "askama", + "async-session", + "axum", + "axum-extra", + "catalogs", + "chrono", + "clap", + "config", + "deadpool-diesel", + "derive_builder", + "diesel", + "diesel_migrations", + "dotenvy", + "futures", + "oauth2", + "percent-encoding", + "rand", + "reqwest 0.12.14", + "serde", + "serde_json", + "tokio", + "tower", + "tower-http", + "tracing", + "tracing-subscriber", + "uuid", + "validator", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json5" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" +dependencies = [ + "pest", + "pest_derive", + "serde", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "libc" +version = "0.2.171" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" + +[[package]] +name = "libm" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" + +[[package]] +name = "linux-raw-sys" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" + +[[package]] +name = "litemap" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "migrations_internals" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd01039851e82f8799046eabbb354056283fb265c8ec0996af940f4e85a380ff" +dependencies = [ + "serde", + "toml", +] + +[[package]] +name = "migrations_macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb161cc72176cb37aa47f1fc520d3ef02263d67d661f44f05d05a079e1237fd" +dependencies = [ + "migrations_internals", + "proc-macro2", + "quote", +] + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mime_guess" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "oauth2" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c38841cdd844847e3e7c8d29cef9dcfed8877f8f56f9071f77843ecf3baf937f" +dependencies = [ + "base64 0.13.1", + "chrono", + "getrandom 0.2.15", + "http 0.2.12", + "rand", + "reqwest 0.11.27", + "serde", + "serde_json", + "serde_path_to_error", + "sha2 0.10.8", + "thiserror 1.0.69", + "url", +] + +[[package]] +name = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" + +[[package]] +name = "opaque-debug" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" + +[[package]] +name = "openssl" +version = "0.10.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +dependencies = [ + "bitflags 2.9.0", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "ordered-multimap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49203cdcae0030493bad186b28da2fa25645fa276a51b6fec8010d281e02ef79" +dependencies = [ + "dlv-list", + "hashbrown 0.14.5", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "pathdiff" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pest" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" +dependencies = [ + "memchr", + "thiserror 2.0.12", + "ucd-trie", +] + +[[package]] +name = "pest_derive" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" +dependencies = [ + "pest", + "pest_generator", +] + +[[package]] +name = "pest_generator" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" +dependencies = [ + "pest", + "pest_meta", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pest_meta" +version = "2.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" +dependencies = [ + "once_cell", + "pest", + "sha2 0.10.8", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy 0.8.23", +] + +[[package]] +name = "pq-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c852911b98f5981956037b2ca976660612e548986c30af075e753107bc3400" +dependencies = [ + "libc", + "vcpkg", +] + +[[package]] +name = "proc-macro-error-attr2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96de42df36bb9bba5542fe9f1a054b8cc87e172759a1868aa05c1f3acc89dfc5" +dependencies = [ + "proc-macro2", + "quote", +] + +[[package]] +name = "proc-macro-error2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ec05c52be0a07b08061f7dd003e7d7092e0472bc731b4af7bb1ef876109802" +dependencies = [ + "proc-macro-error-attr2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.11.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +dependencies = [ + "base64 0.21.7", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper-rustls 0.24.2", + "ipnet", + "js-sys", + "log", + "mime", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile 1.0.4", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration 0.5.1", + "tokio", + "tokio-rustls 0.24.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots", + "winreg", +] + +[[package]] +name = "reqwest" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2 0.4.8", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "hyper 1.6.0", + "hyper-rustls 0.27.5", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.2.0", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "system-configuration 0.6.1", + "tokio", + "tokio-native-tls", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.15", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ron" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" +dependencies = [ + "base64 0.21.7", + "bitflags 2.9.0", + "serde", + "serde_derive", +] + +[[package]] +name = "rust-ini" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e0698206bcb8882bf2a9ecb4c1e7785db57ff052297085a6efd4fe42302068a" +dependencies = [ + "cfg-if 1.0.0", + "ordered-multimap", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustix" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.21.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +dependencies = [ + "log", + "ring", + "rustls-webpki 0.101.7", + "sct", +] + +[[package]] +name = "rustls" +version = "0.23.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64 0.21.7", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" + +[[package]] +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.9.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_html_form" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d2de91cf02bbc07cde38891769ccd5d4f073d22a40683aa4bc7a95781aaa2c4" +dependencies = [ + "form_urlencoded", + "indexmap", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_path_to_error" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fab13f937fa393d08645bf3a84bdfe86e296747b506ada67bb15f10f218b2a" +dependencies = [ + "itoa", + "serde", +] + +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +dependencies = [ + "libc", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" + +[[package]] +name = "socket2" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.9.0", + "core-foundation", + "system-configuration-sys 0.6.0", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tempfile" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" +dependencies = [ + "fastrand", + "getrandom 0.3.1", + "once_cell", + "rustix", + "windows-sys 0.59.0", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" + +[[package]] +name = "time-macros" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls 0.23.23", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml" +version = "0.8.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-http" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403fa3b783d4b626a8ad51d766ab03cb6d2dbfc46b1c5d4448395e6628dc9697" +dependencies = [ + "async-compression", + "bitflags 2.9.0", + "bytes", + "futures-core", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "log", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" +dependencies = [ + "chrono", + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "ucd-trie" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2896d95c02a80c6d6a5d6e953d479f5ddf2dfdb6a244441010e373ac0fb88971" + +[[package]] +name = "unicase" +version = "2.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-segmentation" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +dependencies = [ + "getrandom 0.3.1", + "serde", +] + +[[package]] +name = "validator" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43fb22e1a008ece370ce08a3e9e4447a910e92621bb49b85d6e48a45397e7cfa" +dependencies = [ + "idna", + "once_cell", + "regex", + "serde", + "serde_derive", + "serde_json", + "url", + "validator_derive", +] + +[[package]] +name = "validator_derive" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7df16e474ef958526d1205f6dda359fdfab79d9aa6d54bafcb92dcd07673dca" +dependencies = [ + "darling", + "once_cell", + "proc-macro-error2", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "valuable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + +[[package]] +name = "windows-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.53.0", +] + +[[package]] +name = "windows-result" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +dependencies = [ + "memchr", +] + +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if 1.0.0", + "windows-sys 0.48.0", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + +[[package]] +name = "yaml-rust2" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8902160c4e6f2fb145dbe9d6760a75e3c9522d8bf796ed7047c85919ac7115f8" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink", +] + +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +dependencies = [ + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +dependencies = [ + "zerocopy-derive 0.8.23", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..7f911be --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "interim" +version = "0.0.1" +edition = "2021" + +[workspace] +members = ["catalogs"] + +[dependencies] +anyhow = "1.0.91" +askama = { version = "0.12.1", features = ["urlencode"] } +async-session = "3.0.0" +axum = { version = "0.8.1", features = ["macros"] } +axum-extra = { version = "0.10.0", features = ["cookie", "form", "typed-header"] } +catalogs = { path = "./catalogs" } +chrono = { version = "0.4.39", features = ["serde"] } +clap = { version = "4.5.31", features = ["derive"] } +config = "0.14.1" +deadpool-diesel = { version = "0.6.1", features = ["postgres", "serde"] } +derive_builder = "0.20.2" +diesel = { version = "2.2.10", features = ["postgres", "chrono", "uuid", "serde_json"] } +diesel_migrations = { version = "2.2.0", features = ["postgres"] } +dotenvy = "0.15.7" +futures = "0.3.31" +oauth2 = "4.4.2" +percent-encoding = "2.3.1" +rand = "0.8.5" +reqwest = { version = "0.12.8", features = ["json"] } +serde = { version = "1.0.213", features = ["derive"] } +serde_json = "1.0.132" +tokio = { version = "1.42.0", features = ["full"] } +tower = "0.5.2" +tower-http = { version = "0.6.2", features = ["compression-gzip", "fs", "normalize-path", "set-header", "trace"] } +tracing = "0.1.40" +tracing-subscriber = { version = "0.3.19", features = ["chrono", "env-filter"] } +uuid = { version = "1.11.0", features = ["serde", "v4", "v7"] } +validator = { version = "0.20.0", features = ["derive"] } diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ceabbf8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,22 @@ +FROM lukemathwalker/cargo-chef:latest-rust-1.85.0 AS chef +WORKDIR /app + +FROM chef AS planner +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef AS builder +COPY --from=planner /app/recipe.json recipe.json +# Build dependencies - this is the caching Docker layer! +RUN cargo chef cook --release --recipe-path recipe.json +# Build application +COPY . . +RUN cargo build --release --bin interim + +# We do not need the Rust toolchain to run the binary! +FROM debian:bookworm-slim AS runtime +RUN apt-get update && apt-get install -y libpq-dev +WORKDIR /app +COPY --from=builder /app/target/release/interim /usr/local/bin +COPY ./static ./static +ENTRYPOINT ["/usr/local/bin/interim"] diff --git a/bacon.toml b/bacon.toml new file mode 100644 index 0000000..1302ff6 --- /dev/null +++ b/bacon.toml @@ -0,0 +1,114 @@ +# This is a configuration file for the bacon tool +# +# Complete help on configuration: https://dystroy.org/bacon/config/ +# +# You may check the current default at +# https://github.com/Canop/bacon/blob/main/defaults/default-bacon.toml + +default_job = "check" +env.CARGO_TERM_COLOR = "always" + +[jobs.check] +command = ["cargo", "check"] +need_stdout = false + +[jobs.check-all] +command = ["cargo", "check", "--all-targets"] +need_stdout = false + +# Run clippy on the default target +[jobs.clippy] +command = ["cargo", "clippy"] +need_stdout = false + +# Run clippy on all targets +# To disable some lints, you may change the job this way: +# [jobs.clippy-all] +# command = [ +# "cargo", "clippy", +# "--all-targets", +# "--", +# "-A", "clippy::bool_to_int_with_if", +# "-A", "clippy::collapsible_if", +# "-A", "clippy::derive_partial_eq_without_eq", +# ] +# need_stdout = false +[jobs.clippy-all] +command = ["cargo", "clippy", "--all-targets"] +need_stdout = false + +# This job lets you run +# - all tests: bacon test +# - a specific test: bacon test -- config::test_default_files +# - the tests of a package: bacon test -- -- -p config +[jobs.test] +command = ["cargo", "test"] +need_stdout = true + +[jobs.nextest] +command = [ + "cargo", "nextest", "run", + "--hide-progress-bar", "--failure-output", "final" +] +need_stdout = true +analyzer = "nextest" + +[jobs.doc] +command = ["cargo", "doc", "--no-deps"] +need_stdout = false + +# If the doc compiles, then it opens in your browser and bacon switches +# to the previous job +[jobs.doc-open] +command = ["cargo", "doc", "--no-deps", "--open"] +need_stdout = false +on_success = "back" # so that we don't open the browser at each change + +# You can run your application and have the result displayed in bacon, +# if it makes sense for this crate. +[jobs.run-worker] +command = [ + "cargo", "run", "worker", + # put launch parameters for your program behind a `--` separator +] +need_stdout = true +allow_warnings = true +background = true +default_watch = false + +# Run your long-running application (eg server) and have the result displayed in bacon. +# For programs that never stop (eg a server), `background` is set to false +# to have the cargo run output immediately displayed instead of waiting for +# program's end. +# 'on_change_strategy' is set to `kill_then_restart` to have your program restart +# on every change (an alternative would be to use the 'F5' key manually in bacon). +# If you often use this job, it makes sense to override the 'r' key by adding +# a binding `r = job:run-long` at the end of this file . +[jobs.run-server] +command = [ + "cargo", "run", "serve" + # put launch parameters for your program behind a `--` separator +] +need_stdout = true +allow_warnings = true +background = false +on_change_strategy = "kill_then_restart" +kill = ["kill", "-s", "INT"] +watch = ["src", "templates"] + +# This parameterized job runs the example of your choice, as soon +# as the code compiles. +# Call it as +# bacon ex -- my-example +[jobs.ex] +command = ["cargo", "run", "--example"] +need_stdout = true +allow_warnings = true + +# You may define here keybindings that would be specific to +# a project, for example a shortcut to launch a specific job. +# Shortcuts to internal functions (scrolling, toggling, etc.) +# should go in your personal global prefs.toml file instead. +[keybindings] +r = "job:run-server" +w = "job:run-worker" diff --git a/catalogs/Cargo.lock b/catalogs/Cargo.lock new file mode 100644 index 0000000..de1b0fa --- /dev/null +++ b/catalogs/Cargo.lock @@ -0,0 +1,199 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn", +] + +[[package]] +name = "diesel" +version = "2.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff3e1edb1f37b4953dd5176916347289ed43d7119cc2e6c7c3f7849ff44ea506" +dependencies = [ + "bitflags", + "byteorder", + "diesel_derives", + "itoa", + "pq-sys", +] + +[[package]] +name = "diesel_derives" +version = "2.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68d4216021b3ea446fd2047f5c8f8fe6e98af34508a254a01e4d6bc1e844f84d" +dependencies = [ + "diesel_table_macro_syntax", + "dsl_auto_type", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "diesel_table_macro_syntax" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209c735641a413bc68c4923a9d6ad4bcb3ca306b794edaa7eb0b3228a99ffb25" +dependencies = [ + "syn", +] + +[[package]] +name = "dsl_auto_type" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139ae9aca7527f85f26dd76483eb38533fd84bd571065da1739656ef71c5ff5b" +dependencies = [ + "darling", + "either", + "heck", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "info_schema" +version = "0.1.0" +dependencies = [ + "diesel", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "pq-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41c852911b98f5981956037b2ca976660612e548986c30af075e753107bc3400" +dependencies = [ + "libc", + "vcpkg", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "syn" +version = "2.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" diff --git a/catalogs/Cargo.toml b/catalogs/Cargo.toml new file mode 100644 index 0000000..7635468 --- /dev/null +++ b/catalogs/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "catalogs" +version = "0.1.0" +edition = "2024" + +[dependencies] +chrono = "0.4.41" +diesel = { version = "2.2.10", features = ["64-column-tables", "chrono", "postgres"], default-features = false } diff --git a/catalogs/Makefile b/catalogs/Makefile new file mode 100644 index 0000000..f6a75ad --- /dev/null +++ b/catalogs/Makefile @@ -0,0 +1,4 @@ +.PHONY: run-postgres + +run-postgres: + docker run --rm -it -e POSTGRES_PASSWORD=guest -p 127.0.0.1:5432:5432 postgres:17 diff --git a/catalogs/diesel.toml b/catalogs/diesel.toml new file mode 100644 index 0000000..06f5b1c --- /dev/null +++ b/catalogs/diesel.toml @@ -0,0 +1,11 @@ +# For documentation on how to configure this file, +# see https://diesel.rs/guides/configuring-diesel-cli + +[print_schema] +file = "src/schema.rs" +custom_type_derives = ["diesel::query_builder::QueryId", "Clone"] +schema = "information_schema" +filter = { except_tables = ["sql_features", "sql_implementation_info", "sql_parts", "sql_sizing"] } + +[migrations_directory] +dir = "migrations" diff --git a/catalogs/src/catalogs_schema.rs b/catalogs/src/catalogs_schema.rs new file mode 100644 index 0000000..b2be7e9 --- /dev/null +++ b/catalogs/src/catalogs_schema.rs @@ -0,0 +1,195 @@ +use diesel::{allow_tables_to_appear_in_same_query, joinable, table}; + +table! { + pg_class (oid) { + /// Row identifier + oid -> Oid, + /// Name of the table, index, view, etc. + relname -> Text, + /// The OID of the namespace that contains this relation + relnamespace -> Oid, + /// The OID of the data type that corresponds to this table's row type, if any; zero for indexes, sequences, and toast tables, which have no pg_type entry + reltype -> Oid, + /// For typed tables, the OID of the underlying composite type; zero for all other relations + reloftype -> Oid, + /// Owner of the relation + relowner -> Oid, + /// The access method used to access this table or index. Not meaningful if the relation is a sequence or has no on-disk file, except for partitioned tables, where, if set, it takes precedence over default_table_access_method when determining the access method to use for partitions created when one is not specified in the creation command. + relam -> Oid, + /// Name of the on-disk file of this relation; zero means this is a “mapped” relation whose disk file name is determined by low-level state + relfilenode -> Oid, + /// The tablespace in which this relation is stored. If zero, the database's default tablespace is implied. Not meaningful if the relation has no on-disk file, except for partitioned tables, where this is the tablespace in which partitions will be created when one is not specified in the creation command. + reltablespace -> Oid, + /// Size of the on-disk representation of this table in pages (of size BLCKSZ). This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX. + relpages -> Integer, + /// Number of live rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX. If the table has never yet been vacuumed or analyzed, reltuples contains -1 indicating that the row count is unknown. + reltuples -> Float, + /// Number of pages that are marked all-visible in the table's visibility map. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX. + relallvisible -> Integer, + /// OID of the TOAST table associated with this table, zero if none. The TOAST table stores large attributes “out of line” in a secondary table. + reltoastrelid -> Oid, + /// True if this is a table and it has (or recently had) any indexes + relhasindex -> Bool, + /// True if this table is shared across all databases in the cluster. Only certain system catalogs (such as pg_database) are shared. + relisshared -> Bool, + /// p = permanent table/sequence, u = unlogged table/sequence, t = temporary table/sequence + relpersistence -> CChar, + /// r = ordinary table, i = index, S = sequence, t = TOAST table, v = view, m = materialized view, c = composite type, f = foreign table, p = partitioned table, I = partitioned index + relkind -> CChar, + /// Number of user columns in the relation (system columns not counted). There must be this many corresponding entries in pg_attribute. See also pg_attribute.attnum. + relnatts -> SmallInt, + /// Number of CHECK constraints on the table; see pg_constraint catalog + relchecks -> SmallInt, + /// True if table has (or once had) rules; see pg_rewrite catalog + relhasrules -> Bool, + /// True if table has (or once had) triggers; see pg_trigger catalog + relhastriggers -> Bool, + /// True if table or index has (or once had) any inheritance children or partitions + relhassubclass -> Bool, + /// True if table has row-level security enabled; see pg_policy catalog + relrowsecurity -> Bool, + /// True if row-level security (when enabled) will also apply to table owner; see pg_policy catalog + relforcerowsecurity -> Bool, + /// True if relation is populated (this is true for all relations other than some materialized views) + relispopulated -> Bool, + /// Columns used to form “replica identity” for rows: d = default (primary key, if any), n = nothing, f = all columns, i = index with indisreplident set (same as nothing if the index used has been dropped) + relreplident -> CChar, + /// True if table or index is a partition + relispartition -> Bool, + /// For new relations being written during a DDL operation that requires a table rewrite, this contains the OID of the original relation; otherwise zero. That state is only visible internally; this field should never contain anything other than zero for a user-visible relation. + relrewrite -> Oid, + /// All transaction IDs before this one have been replaced with a permanent (“frozen”) transaction ID in this table. This is used to track whether the table needs to be vacuumed in order to prevent transaction ID wraparound or to allow pg_xact to be shrunk. Zero (InvalidTransactionId) if the relation is not a table. + /// Access-method-specific options, as “keyword=value” strings + reloptions -> Array, + } +} + +table! { + pg_roles (oid) { + /// Role name + rolname -> Text, + /// Role has superuser privileges + rolsuper -> Bool, + /// Role automatically inherits privileges of roles it is a member of + rolinherit -> Bool, + /// Role can create more roles + rolcreaterole -> Bool, + /// Role can create databases + rolcreatedb -> Bool, + /// Role can log in. That is, this role can be given as the initial session authorization identifier + rolcanlogin -> Bool, + /// Role is a replication role. A replication role can initiate replication connections and create and drop replication slots. + rolreplication -> Bool, + /// For roles that can log in, this sets maximum number of concurrent connections this role can make. -1 means no limit. + rolconnlimit -> Integer, + /// Not the password (always reads as ********) + rolpassword -> Text, + /// Password expiry time (only used for password authentication); null if no expiration + rolvaliduntil -> Nullable, + /// Role bypasses every row-level security policy, see Section 5.9 for more information. + rolbypassrls -> Bool, + /// Role-specific defaults for run-time configuration variables + rolconfig -> Nullable>, + /// ID of role + oid -> Oid, + } +} + +table! { + pg_namespace (oid) { + /// Row identifier + oid -> Oid, + /// Name of the namespace + nspname -> Text, + /// Onwer of the namespace + nspowner -> Oid, + /// Access privileges; see Section 5.8 for details + nspacl -> Array, + } +} + +table! { + pg_attribute (attrelid, attname) { + /// The table this column belongs to + attrelid -> Oid, + /// The column name + attname -> Text, + /// The data type of this column (zero for a dropped column) + atttypid -> Oid, + /// A copy of pg_type.typlen of this column's type + attlen -> SmallInt, + /// The number of the column. Ordinary columns are numbered from 1 up. System columns, such as ctid, have (arbitrary) negative numbers. + attnum -> SmallInt, + /// Always -1 in storage, but when loaded into a row descriptor in memory this might be updated to cache the offset of the attribute within the row + attcacheoff -> Integer, + /// atttypmod records type-specific data supplied at table creation time (for example, the maximum length of a varchar column). It is passed to type-specific input functions and length coercion functions. The value will generally be -1 for types that do not need atttypmod. + atttypmod -> Integer, + /// Number of dimensions, if the column is an array type; otherwise 0. (Presently, the number of dimensions of an array is not enforced, so any nonzero value effectively means “it's an array”.) + attndims -> SmallInt, + /// A copy of pg_type.typbyval of this column's type + attbyval -> Bool, + /// A copy of pg_type.typalign of this column's type + attalign -> CChar, + /// Normally a copy of pg_type.typstorage of this column's type. For TOAST-able data types, this can be altered after column creation to control storage policy. + attstorage -> CChar, + /// The current compression method of the column. Typically this is '\0' to specify use of the current default setting (see default_toast_compression). Otherwise, 'p' selects pglz compression, while 'l' selects LZ4 compression. However, this field is ignored whenever attstorage does not allow compression. + attcompression -> CChar, + /// This represents a not-null constraint. + attnotnull -> Bool, + /// This column has a default expression or generation expression, in which case there will be a corresponding entry in the pg_attrdef catalog that actually defines the expression. (Check attgenerated to determine whether this is a default or a generation expression.) + atthasdef -> Bool, + /// This column has a value which is used where the column is entirely missing from the row, as happens when a column is added with a non-volatile DEFAULT value after the row is created. The actual value used is stored in the attmissingval column. + atthasmissing -> Bool, + /// If a zero byte (''), then not an identity column. Otherwise, a = generated always, d = generated by default. + attidentity -> CChar, + /// If a zero byte (''), then not a generated column. Otherwise, s = stored. (Other values might be added in the future.) + attgenerated -> CChar, + /// This column has been dropped and is no longer valid. A dropped column is still physically present in the table, but is ignored by the parser and so cannot be accessed via SQL. + attisdropped -> Bool, + /// This column is defined locally in the relation. Note that a column can be locally defined and inherited simultaneously. + attislocal -> Bool, + /// The number of direct ancestors this column has. A column with a nonzero number of ancestors cannot be dropped nor renamed. + attinhcount -> SmallInt, + /// The defined collation of the column, or zero if the column is not of a collatable data type + attcollation -> Oid, + /// attstattarget controls the level of detail of statistics accumulated for this column by ANALYZE. A zero value indicates that no statistics should be collected. A null value says to use the system default statistics target. The exact meaning of positive values is data type-dependent. For scalar data types, attstattarget is both the target number of “most common values” to collect, and the target number of histogram bins to create. + attstattarget -> SmallInt, + /// Column-level access privileges, if any have been granted specifically on this column + attacl -> Array, + /// Attribute-level options, as “keyword=value” strings + attoptions -> Array, + /// Attribute-level foreign data wrapper options, as “keyword=value” strings + attfdwoptions -> Array, + } +} + +table! { + information_schema.table_privileges (table_catalog, table_schema, table_name, grantor, grantee) { + /// Name of the role that granted the privilege + grantor -> Text, + /// Name of the role that the privilege was granted to + grantee -> Text, + /// Name of the database that contains the table (always the current database) + table_catalog -> Text, + /// Name of the schema that contains the table + table_schema -> Text, + /// Name of the table + table_name -> Text, + /// Type of the privilege: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, or TRIGGER + privilege_type -> Text, + /// YES if the privilege is grantable, NO if not + is_grantable -> Text, + /// In the SQL standard, WITH HIERARCHY OPTION is a separate (sub-)privilege allowing certain operations on table inheritance hierarchies. In PostgreSQL, this is included in the SELECT privilege, so this column shows YES if the privilege is SELECT, else NO. + with_hierarchy -> Text, + } +} + +allow_tables_to_appear_in_same_query!( + pg_attribute, + pg_class, + pg_namespace, + pg_roles, + table_privileges +); +joinable!(pg_class -> pg_roles (relowner)); +joinable!(pg_attribute -> pg_class (attrelid)); diff --git a/catalogs/src/lib.rs b/catalogs/src/lib.rs new file mode 100644 index 0000000..5c0763a --- /dev/null +++ b/catalogs/src/lib.rs @@ -0,0 +1,6 @@ +mod catalogs_schema; +pub mod pg_attribute; +pub mod pg_class; +pub mod pg_namespace; +pub mod pg_roles; +pub mod table_privileges; diff --git a/catalogs/src/pg_attribute.rs b/catalogs/src/pg_attribute.rs new file mode 100644 index 0000000..f33b0a5 --- /dev/null +++ b/catalogs/src/pg_attribute.rs @@ -0,0 +1,32 @@ +use diesel::{ + dsl::{AsSelect, auto_type}, + pg::Pg, + prelude::*, +}; + +use crate::catalogs_schema::pg_attribute; + +pub use crate::catalogs_schema::pg_attribute::{dsl, table}; + +#[derive(Clone, Debug, Queryable, Selectable)] +#[diesel(table_name = pg_attribute)] +#[diesel(primary_key(attrelid, attname))] +pub struct PgAttribute { + pub attrelid: u32, + pub attname: String, + pub atttypid: u32, + pub attnum: i16, + pub attndims: i16, + pub attnotnull: bool, + pub atthasdef: bool, + pub attisdropped: bool, + pub attacl: Vec, +} + +impl PgAttribute { + #[auto_type(no_type_alias)] + pub fn all() -> _ { + let select: AsSelect = Self::as_select(); + table.select(select) + } +} diff --git a/catalogs/src/pg_class.rs b/catalogs/src/pg_class.rs new file mode 100644 index 0000000..8102401 --- /dev/null +++ b/catalogs/src/pg_class.rs @@ -0,0 +1,25 @@ +use diesel::{ + dsl::{AsSelect, auto_type}, + pg::Pg, + prelude::*, +}; + +use crate::catalogs_schema::pg_class; + +pub use crate::catalogs_schema::pg_class::{dsl, table}; + +#[derive(Clone, Debug, Queryable, Selectable)] +#[diesel(table_name = pg_class)] +#[diesel(primary_key(oid))] +pub struct PgClass { + pub oid: u32, + pub relname: String, +} + +impl PgClass { + #[auto_type(no_type_alias)] + pub fn all() -> _ { + let select: AsSelect = Self::as_select(); + table.select(select) + } +} diff --git a/catalogs/src/pg_namespace.rs b/catalogs/src/pg_namespace.rs new file mode 100644 index 0000000..0dd5a44 --- /dev/null +++ b/catalogs/src/pg_namespace.rs @@ -0,0 +1,23 @@ +use diesel::{ + dsl::{AsSelect, auto_type}, + pg::Pg, + prelude::*, +}; + +use crate::catalogs_schema::pg_namespace; + +pub use crate::catalogs_schema::pg_namespace::{dsl, table}; + +#[derive(Clone, Debug, Queryable, Selectable)] +#[diesel(table_name = pg_namespace)] +pub struct PgNamespace { + pub oid: u32, +} + +impl PgNamespace { + #[auto_type(no_type_alias)] + pub fn all() -> _ { + let select: AsSelect = Self::as_select(); + table.select(select) + } +} diff --git a/catalogs/src/pg_roles.rs b/catalogs/src/pg_roles.rs new file mode 100644 index 0000000..812b7a3 --- /dev/null +++ b/catalogs/src/pg_roles.rs @@ -0,0 +1,50 @@ +use chrono::{DateTime, Utc}; +use diesel::{ + dsl::{AsSelect, auto_type}, + pg::Pg, + prelude::*, +}; + +use crate::catalogs_schema::pg_roles; + +pub use crate::catalogs_schema::pg_roles::{dsl, table}; + +#[derive(Clone, Debug, Queryable, Selectable)] +#[diesel(table_name = pg_roles)] +#[diesel(primary_key(oid))] +pub struct PgRole { + /// Role name + rolname: String, + /// Role has superuser privileges + rolsuper: bool, + /// Role automatically inherits privileges of roles it is a member of + rolinherit: bool, + /// Role can create more roles + rolcreaterole: bool, + /// Role can create databases + rolcreatedb: bool, + /// Role can log in. That is, this role can be given as the initial session authorization identifier + rolcanlogin: bool, + /// Role is a replication role. A replication role can initiate replication connections and create and drop replication slots. + rolreplication: bool, + /// For roles that can log in, this sets maximum number of concurrent connections this role can make. -1 means no limit. + rolconnlimit: i32, + /// Not the password (always reads as ********) + rolpassword: String, + /// Password expiry time (only used for password authentication); null if no expiration + rolvaliduntil: Option>, + /// Role bypasses every row-level security policy, see Section 5.9 for more information. + rolbypassrls: bool, + /// Role-specific defaults for run-time configuration variables + rolconfig: Option>, + /// ID of role + oid: u32, +} + +impl PgRole { + #[auto_type(no_type_alias)] + pub fn all() -> _ { + let select: AsSelect = Self::as_select(); + table.select(select) + } +} diff --git a/catalogs/src/table_privileges.rs b/catalogs/src/table_privileges.rs new file mode 100644 index 0000000..37e32b4 --- /dev/null +++ b/catalogs/src/table_privileges.rs @@ -0,0 +1,38 @@ +use diesel::{ + dsl::{AsSelect, auto_type}, + pg::Pg, + prelude::*, +}; + +use crate::catalogs_schema::table_privileges; + +pub use crate::catalogs_schema::table_privileges::{dsl, table}; + +#[derive(Clone, Debug, Queryable, Selectable)] +#[diesel(table_name = table_privileges)] +pub struct TablePrivilege { + /// Name of the role that granted the privilege + grantor: String, + /// Name of the role that the privilege was granted to + grantee: String, + /// Name of the database that contains the table (always the current database) + table_catalog: String, + /// Name of the schema that contains the table + table_schema: String, + /// Name of the table + table_name: String, + /// Type of the privilege: SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES, or TRIGGER + privilege_type: String, + /// YES if the privilege is grantable, NO if not + is_grantable: String, + /// In the SQL standard, WITH HIERARCHY OPTION is a separate (sub-)privilege allowing certain operations on table inheritance hierarchies. In PostgreSQL, this is included in the SELECT privilege, so this column shows YES if the privilege is SELECT, else NO. + with_hierarchy: String, +} + +impl TablePrivilege { + #[auto_type(no_type_alias)] + pub fn all() -> _ { + let select: AsSelect = Self::as_select(); + table.select(select) + } +} diff --git a/diesel.toml b/diesel.toml new file mode 100644 index 0000000..a0d61bf --- /dev/null +++ b/diesel.toml @@ -0,0 +1,9 @@ +# For documentation on how to configure this file, +# see https://diesel.rs/guides/configuring-diesel-cli + +[print_schema] +file = "src/schema.rs" +custom_type_derives = ["diesel::query_builder::QueryId", "Clone"] + +[migrations_directory] +dir = "migrations" diff --git a/migrations/.keep b/migrations/.keep new file mode 100644 index 0000000..e69de29 diff --git a/migrations/00000000000000_diesel_initial_setup/down.sql b/migrations/00000000000000_diesel_initial_setup/down.sql new file mode 100644 index 0000000..a9f5260 --- /dev/null +++ b/migrations/00000000000000_diesel_initial_setup/down.sql @@ -0,0 +1,6 @@ +-- This file was automatically created by Diesel to setup helper functions +-- and other internal bookkeeping. This file is safe to edit, any future +-- changes will be added to existing projects as new migrations. + +DROP FUNCTION IF EXISTS diesel_manage_updated_at(_tbl regclass); +DROP FUNCTION IF EXISTS diesel_set_updated_at(); diff --git a/migrations/00000000000000_diesel_initial_setup/up.sql b/migrations/00000000000000_diesel_initial_setup/up.sql new file mode 100644 index 0000000..d68895b --- /dev/null +++ b/migrations/00000000000000_diesel_initial_setup/up.sql @@ -0,0 +1,36 @@ +-- This file was automatically created by Diesel to setup helper functions +-- and other internal bookkeeping. This file is safe to edit, any future +-- changes will be added to existing projects as new migrations. + + + + +-- Sets up a trigger for the given table to automatically set a column called +-- `updated_at` whenever the row is modified (unless `updated_at` was included +-- in the modified columns) +-- +-- # Example +-- +-- ```sql +-- CREATE TABLE users (id SERIAL PRIMARY KEY, updated_at TIMESTAMP NOT NULL DEFAULT NOW()); +-- +-- SELECT diesel_manage_updated_at('users'); +-- ``` +CREATE OR REPLACE FUNCTION diesel_manage_updated_at(_tbl regclass) RETURNS VOID AS $$ +BEGIN + EXECUTE format('CREATE TRIGGER set_updated_at BEFORE UPDATE ON %s + FOR EACH ROW EXECUTE PROCEDURE diesel_set_updated_at()', _tbl); +END; +$$ LANGUAGE plpgsql; + +CREATE OR REPLACE FUNCTION diesel_set_updated_at() RETURNS trigger AS $$ +BEGIN + IF ( + NEW IS DISTINCT FROM OLD AND + NEW.updated_at IS NOT DISTINCT FROM OLD.updated_at + ) THEN + NEW.updated_at := current_timestamp; + END IF; + RETURN NEW; +END; +$$ LANGUAGE plpgsql; diff --git a/migrations/2024-11-25-232658_init/down.sql b/migrations/2024-11-25-232658_init/down.sql new file mode 100644 index 0000000..c99ddcd --- /dev/null +++ b/migrations/2024-11-25-232658_init/down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS users; diff --git a/migrations/2024-11-25-232658_init/up.sql b/migrations/2024-11-25-232658_init/up.sql new file mode 100644 index 0000000..a876762 --- /dev/null +++ b/migrations/2024-11-25-232658_init/up.sql @@ -0,0 +1,6 @@ +CREATE TABLE IF NOT EXISTS users ( + id UUID NOT NULL PRIMARY KEY, + uid TEXT UNIQUE NOT NULL, + email TEXT NOT NULL +); +CREATE INDEX ON users (uid); diff --git a/migrations/2025-01-08-211839_sessions/down.sql b/migrations/2025-01-08-211839_sessions/down.sql new file mode 100644 index 0000000..e51c609 --- /dev/null +++ b/migrations/2025-01-08-211839_sessions/down.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS browser_sessions; diff --git a/migrations/2025-01-08-211839_sessions/up.sql b/migrations/2025-01-08-211839_sessions/up.sql new file mode 100644 index 0000000..8cba36c --- /dev/null +++ b/migrations/2025-01-08-211839_sessions/up.sql @@ -0,0 +1,8 @@ +CREATE TABLE browser_sessions ( + id TEXT NOT NULL PRIMARY KEY, + serialized TEXT NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + expiry TIMESTAMPTZ +); +CREATE INDEX ON browser_sessions (expiry); +CREATE INDEX ON browser_sessions (created_at); diff --git a/src/abstract_.rs b/src/abstract_.rs new file mode 100644 index 0000000..4c21665 --- /dev/null +++ b/src/abstract_.rs @@ -0,0 +1,46 @@ +use catalogs::{ + pg_class::{self, PgClass}, + pg_namespace, + table_privileges::{self, TablePrivilege}, +}; +use diesel::{ + dsl::{auto_type, AsSelect}, + pg::Pg, + prelude::*, +}; + +pub fn escape_identifier(identifier: &str) -> String { + // Escaping identifiers for Postgres is fairly easy, provided that the input is + // already known to contain no invalid multi-byte sequences. Backslashes may + // remain as-is, and embedded double quotes are escaped simply by doubling + // them (`"` becomes `""`). Refer to the PQescapeInternal() function in + // libpq (fe-exec.c) and Diesel's PgQueryBuilder::push_identifier(). + // Here we also add spaces before and after the identifier quotes so that + // the identifier isn't inadvertently merged into a token immediately + // leading or following it. + format!(" \"{}\" ", identifier.replace('"', "\"\"")) +} + +// Still waiting for Postgres to gain class consciousness +#[derive(Clone, Queryable, Selectable)] +pub struct PgClassPrivilege { + #[diesel(embed)] + pub class: PgClass, + #[diesel(embed)] + pub privilege: TablePrivilege, +} + +#[auto_type(no_type_alias)] +pub fn class_privileges_for_grantees(grantees: Vec) -> _ { + let select: AsSelect = PgClassPrivilege::as_select(); + pg_class::table + .inner_join(pg_namespace::table.on(pg_namespace::dsl::oid.eq(pg_class::dsl::relnamespace))) + .inner_join( + table_privileges::table.on(table_privileges::dsl::table_schema + .eq(pg_namespace::dsl::nspname) + .and(table_privileges::dsl::table_name.eq(pg_class::dsl::relname))), + ) + .filter(pg_class::dsl::relkind.eq(b'r')) + .filter(table_privileges::dsl::grantee.eq_any(grantees)) + .select(select) +} diff --git a/src/app_error.rs b/src/app_error.rs new file mode 100644 index 0000000..67681d4 --- /dev/null +++ b/src/app_error.rs @@ -0,0 +1,81 @@ +use std::fmt::{self, Display}; + +use axum::http::StatusCode; +use axum::response::{IntoResponse, Response}; +use validator::ValidationErrors; + +/// Custom error type that maps to appropriate HTTP responses. +#[derive(Debug)] +pub enum AppError { + InternalServerError(anyhow::Error), + Forbidden(String), + NotFound(String), + BadRequest(String), + TooManyRequests(String), +} + +impl AppError { + pub fn from_validation_errors(errs: ValidationErrors) -> Self { + // TODO: customize validation errors formatting + Self::BadRequest(serde_json::to_string(&errs).unwrap_or("validation error".to_string())) + } +} + +impl IntoResponse for AppError { + fn into_response(self) -> Response { + match self { + Self::InternalServerError(err) => { + tracing::error!("Application error: {:?}", err); + (StatusCode::INTERNAL_SERVER_ERROR, "Something went wrong").into_response() + } + Self::Forbidden(client_message) => { + tracing::info!("Forbidden: {}", client_message); + (StatusCode::FORBIDDEN, client_message).into_response() + } + Self::NotFound(client_message) => { + tracing::info!("Not found: {}", client_message); + (StatusCode::NOT_FOUND, client_message).into_response() + } + Self::TooManyRequests(client_message) => { + // Debug level so that if this is from a runaway loop, it won't + // overwhelm server logs + tracing::debug!("Too many requests: {}", client_message); + (StatusCode::TOO_MANY_REQUESTS, client_message).into_response() + } + Self::BadRequest(client_message) => { + tracing::info!("Bad user input: {}", client_message); + (StatusCode::BAD_REQUEST, client_message).into_response() + } + } + } +} + +// Easily convert semi-arbitrary errors to InternalServerError +impl From for AppError +where + E: Into, +{ + fn from(err: E) -> Self { + Self::InternalServerError(Into::::into(err)) + } +} + +impl Display for AppError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + AppError::InternalServerError(inner) => inner.fmt(f), + AppError::Forbidden(client_message) => { + write!(f, "ForbiddenError: {}", client_message) + } + AppError::NotFound(client_message) => { + write!(f, "NotFoundError: {}", client_message) + } + AppError::BadRequest(client_message) => { + write!(f, "BadRequestError: {}", client_message) + } + AppError::TooManyRequests(client_message) => { + write!(f, "TooManyRequestsError: {}", client_message) + } + } + } +} diff --git a/src/app_state.rs b/src/app_state.rs new file mode 100644 index 0000000..33516ef --- /dev/null +++ b/src/app_state.rs @@ -0,0 +1,90 @@ +use std::sync::Arc; + +use anyhow::Result; +use axum::{ + extract::{FromRef, FromRequestParts}, + http::request::Parts, +}; +use deadpool_diesel::postgres::{Connection, Pool}; +use oauth2::basic::BasicClient; + +use crate::{ + abstract_::escape_identifier, app_error::AppError, auth, nav::NavbarBuilder, sessions::PgStore, + settings::Settings, +}; + +/// Global app configuration +pub struct App { + pub db_pool: Pool, + pub navbar_template: NavbarBuilder, + pub oauth_client: BasicClient, + pub reqwest_client: reqwest::Client, + pub session_store: PgStore, + pub settings: Settings, +} + +impl App { + /// Initialize global application functions based on config values + pub async fn from_settings(settings: Settings) -> Result { + let database_url = settings.database_url.clone(); + let manager = deadpool_diesel::postgres::Manager::from_config( + database_url, + deadpool_diesel::Runtime::Tokio1, + deadpool_diesel::ManagerConfig { + // Reset role after each interaction is recycled so that user + // sessions remain isolated by deadpool interaction + recycling_method: deadpool_diesel::RecyclingMethod::CustomQuery( + std::borrow::Cow::Owned(format!( + "SET ROLE {}", + escape_identifier(&settings.pg_root_role) + )), + ), + }, + ); + let db_pool = deadpool_diesel::postgres::Pool::builder(manager).build()?; + + let session_store = PgStore::new(db_pool.clone()); + let reqwest_client = reqwest::ClientBuilder::new().https_only(true).build()?; + let oauth_client = auth::new_oauth_client(&settings)?; + + Ok(Self { + db_pool, + navbar_template: NavbarBuilder::default().with_base_path(&settings.base_path), + oauth_client, + reqwest_client, + session_store, + settings, + }) + } +} + +/// Global app configuration, arced for relatively inexpensive clones +pub type AppState = Arc; + +/// State extractor for shared reqwest client +#[derive(Clone)] +pub struct ReqwestClient(pub reqwest::Client); + +impl FromRef for ReqwestClient +where + S: Into + Clone, +{ + fn from_ref(state: &S) -> Self { + ReqwestClient(Into::::into(state.clone()).reqwest_client.clone()) + } +} + +/// Extractor to automatically obtain a Deadpool database connection +pub struct DbConn(pub Connection); + +impl FromRequestParts for DbConn +where + S: Into + Clone + Sync, +{ + type Rejection = AppError; + + async fn from_request_parts(_: &mut Parts, state: &S) -> Result { + let conn = Into::::into(state.clone()).db_pool.get().await?; + Ok(Self(conn)) + } +} diff --git a/src/auth.rs b/src/auth.rs new file mode 100644 index 0000000..18381b0 --- /dev/null +++ b/src/auth.rs @@ -0,0 +1,217 @@ +use anyhow::{Context, Result}; +use async_session::{Session, SessionStore}; +use axum::{ + extract::{Query, State}, + response::{IntoResponse, Redirect}, + routing::get, + Router, +}; +use axum_extra::extract::cookie::{Cookie, CookieJar, SameSite}; +use oauth2::{ + basic::BasicClient, reqwest::async_http_client, AuthUrl, AuthorizationCode, ClientId, + ClientSecret, CsrfToken, RedirectUrl, RefreshToken, TokenResponse, TokenUrl, +}; +use serde::{Deserialize, Serialize}; + +use crate::{ + app_error::AppError, + app_state::{AppState, ReqwestClient}, + sessions::{AppSession, PgStore}, + settings::Settings, +}; + +const SESSION_KEY_AUTH_CSRF_TOKEN: &str = "oauth_csrf_token"; +const SESSION_KEY_AUTH_REFRESH_TOKEN: &str = "oauth_refresh_token"; +pub const SESSION_KEY_AUTH_INFO: &str = "auth"; +pub const SESSION_KEY_AUTH_REDIRECT: &str = "post_auth_redirect"; + +/// Creates a new OAuth2 client to be stored in global application state. +pub fn new_oauth_client(settings: &Settings) -> Result { + Ok(BasicClient::new( + ClientId::new(settings.auth.client_id.clone()), + Some(ClientSecret::new(settings.auth.client_secret.clone())), + AuthUrl::new(settings.auth.auth_url.clone()) + .context("failed to create new authorization server URL")?, + Some( + TokenUrl::new(settings.auth.token_url.clone()) + .context("failed to create new token endpoint URL")?, + ), + ) + .set_redirect_uri( + RedirectUrl::new(format!( + "{}{}/auth/callback", + settings.frontend_host, settings.base_path + )) + .context("failed to create new redirection URL")?, + )) +} + +/// Creates a router which can be nested within the higher level app router. +pub fn new_router() -> Router { + Router::new() + .route("/login", get(start_login)) + .route("/callback", get(callback)) + .route("/logout", get(logout)) +} + +/// HTTP get handler for /login +async fn start_login( + State(state): State, + State(Settings { + auth: auth_settings, + base_path, + .. + }): State, + State(session_store): State, + AppSession(maybe_session): AppSession, + jar: CookieJar, +) -> Result { + let mut session = if let Some(value) = maybe_session { + value + } else { + Session::new() + }; + + if session.get::(SESSION_KEY_AUTH_INFO).is_some() { + tracing::debug!("already logged in, redirecting..."); + return Ok(Redirect::to(&format!("{}/", base_path)).into_response()); + } + assert!(session.get_raw(SESSION_KEY_AUTH_REFRESH_TOKEN).is_none()); + + let csrf_token = CsrfToken::new_random(); + session.insert(SESSION_KEY_AUTH_CSRF_TOKEN, &csrf_token)?; + let (auth_url, _csrf_token) = state.oauth_client.authorize_url(|| csrf_token).url(); + let jar = if let Some(cookie_value) = session_store.store_session(session).await? { + tracing::debug!("adding session cookie to jar"); + jar.add( + Cookie::build((auth_settings.cookie_name.clone(), cookie_value)) + .same_site(SameSite::Lax) + .http_only(true) + .path("/"), + ) + } else { + tracing::debug!("inferred that session cookie already in jar"); + jar + }; + Ok((jar, Redirect::to(auth_url.as_ref())).into_response()) +} + +/// HTTP get handler for /logout +async fn logout( + State(Settings { + base_path, + auth: auth_settings, + .. + }): State, + State(ReqwestClient(reqwest_client)): State, + State(session_store): State, + AppSession(session): AppSession, + jar: CookieJar, +) -> Result { + if let Some(session) = session { + tracing::debug!("Session {} loaded.", session.id()); + if let Some(logout_url) = auth_settings.logout_url { + tracing::debug!("attempting to send logout request to oauth provider"); + let refresh_token: Option = session.get(SESSION_KEY_AUTH_REFRESH_TOKEN); + if let Some(refresh_token) = refresh_token { + tracing::debug!("Sending logout request to OAuth provider."); + #[derive(Serialize)] + struct LogoutRequestBody { + refresh_token: String, + } + reqwest_client + .post(logout_url) + .json(&LogoutRequestBody { + refresh_token: refresh_token.secret().to_owned(), + }) + .send() + .await? + .error_for_status()?; + tracing::debug!("Sent logout request to OAuth provider successfully."); + } + } + session_store.destroy_session(session).await?; + } + let jar = jar.remove(Cookie::from(auth_settings.cookie_name)); + tracing::debug!("Removed session cookie from jar."); + Ok((jar, Redirect::to(&format!("{}/", base_path)))) +} + +#[derive(Debug, Deserialize)] +struct AuthRequestQuery { + code: String, + /// CSRF token + state: String, +} + +/// HTTP get handler for /callback +async fn callback( + Query(query): Query, + State(state): State, + State(Settings { + auth: auth_settings, + base_path, + .. + }): State, + State(ReqwestClient(reqwest_client)): State, + AppSession(session): AppSession, +) -> Result { + let mut session = session.ok_or_else(|| { + tracing::debug!("unable to load session"); + AppError::Forbidden( + "our apologies: authentication session expired or lost, please try again".to_owned(), + ) + })?; + let session_csrf_token: String = session.get(SESSION_KEY_AUTH_CSRF_TOKEN).ok_or_else(|| { + tracing::debug!("oauth csrf token not found on session"); + AppError::Forbidden( + "our apologies: authentication session expired or lost, please try again".to_owned(), + ) + })?; + if session_csrf_token != query.state { + tracing::debug!("oauth csrf tokens did not match"); + return Err(AppError::Forbidden( + "OAuth CSRF tokens do not match.".to_string(), + )); + } + tracing::debug!("exchanging authorization code"); + let response = state + .oauth_client + .exchange_code(AuthorizationCode::new(query.code.clone())) + .request_async(async_http_client) + .await?; + tracing::debug!("fetching user info"); + let auth_info: AuthInfo = reqwest_client + .get(auth_settings.userinfo_url.as_str()) + .bearer_auth(response.access_token().secret()) + .send() + .await? + .json() + .await?; + tracing::debug!("updating session"); + + let redirect_target: Option = session.get(SESSION_KEY_AUTH_REDIRECT); + // Remove this since we don't need or want it sticking around, for both UX + // and security hygiene reasons + session.remove(SESSION_KEY_AUTH_REDIRECT); + + session.insert(SESSION_KEY_AUTH_INFO, &auth_info)?; + session.insert(SESSION_KEY_AUTH_REFRESH_TOKEN, response.refresh_token())?; + if state.session_store.store_session(session).await?.is_some() { + return Err(anyhow::anyhow!( + "expected cookie value returned by store_session() to be None for existing session" + ) + .into()); + } + tracing::debug!("successfully authenticated"); + Ok(Redirect::to( + &redirect_target.unwrap_or(format!("{}/", base_path)), + )) +} + +/// Data stored in the visitor's session upon successful authentication. +#[derive(Debug, Deserialize, Serialize)] +pub struct AuthInfo { + pub sub: String, + pub email: String, +} diff --git a/src/cli.rs b/src/cli.rs new file mode 100644 index 0000000..a5a3bd3 --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,94 @@ +use anyhow::Result; +use axum::{ + extract::Request, + http::{header::CONTENT_SECURITY_POLICY, HeaderValue}, + middleware::map_request, + ServiceExt, +}; +use chrono::{TimeDelta, Utc}; +use clap::{Parser, Subcommand}; +use tokio::time::sleep; +use tower::ServiceBuilder; +use tower_http::{ + compression::CompressionLayer, normalize_path::NormalizePathLayer, + set_header::response::SetResponseHeaderLayer, trace::TraceLayer, +}; + +use crate::{ + app_state::AppState, middleware::lowercase_uri_path, router::new_router, worker::run_worker, +}; + +#[derive(Parser)] +#[command(version, about, long_about = None)] +pub struct Cli { + #[command(subcommand)] + pub command: Commands, +} + +#[derive(Parser)] +pub struct WorkerArgs { + /// Loop the every n seconds instead of exiting after execution + #[arg(long)] + auto_loop_seconds: Option, +} + +#[derive(Subcommand)] +pub enum Commands { + /// Run web server + Serve, + /// Run background worker + Worker(WorkerArgs), + // TODO: add a low-frequency worker task exclusively for self-healing + // mechanisms like Governor::reset_all() +} + +pub async fn serve_command(state: AppState) -> Result<()> { + let router = ServiceBuilder::new() + .layer(map_request(lowercase_uri_path)) + .layer(TraceLayer::new_for_http()) + .layer(CompressionLayer::new()) + .layer(SetResponseHeaderLayer::if_not_present( + CONTENT_SECURITY_POLICY, + HeaderValue::from_static("frame-ancestors 'none'"), + )) + .layer(NormalizePathLayer::trim_trailing_slash()) + .service(new_router(state.clone())); + + let listener = + tokio::net::TcpListener::bind((state.settings.host.clone(), state.settings.port)) + .await + .unwrap(); + tracing::info!( + "App running at http://{}:{}{}", + state.settings.host, + state.settings.port, + state.settings.base_path + ); + + axum::serve(listener, ServiceExt::::into_make_service(router)) + .await + .map_err(Into::into) +} + +pub async fn worker_command(args: &WorkerArgs, state: AppState) -> Result<()> { + if let Some(loop_seconds) = args.auto_loop_seconds { + let loop_delta = TimeDelta::seconds(i64::from(loop_seconds)); + loop { + let t_next_loop = Utc::now() + loop_delta; + + if let Err(err) = run_worker(state.clone()).await { + tracing::error!("{}", err) + } + + let sleep_delta = t_next_loop - Utc::now(); + match sleep_delta.to_std() { + Ok(duration) => { + sleep(duration).await; + } + Err(_) => { /* sleep_delta was < 0, so don't sleep */ } + } + } + } else { + run_worker(state).await + } +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..5e51c97 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,55 @@ +use clap::Parser as _; +use diesel_migrations::MigrationHarness; +use dotenvy::dotenv; +use tracing_subscriber::EnvFilter; + +use crate::{ + app_state::{App, AppState}, + cli::{serve_command, worker_command, Cli, Commands}, + migrations::MIGRATIONS, + settings::Settings, +}; + +mod abstract_; +mod app_error; +mod app_state; +mod auth; +mod cli; +mod middleware; +mod migrations; +mod nav; +mod router; +mod schema; +mod sessions; +mod settings; +mod users; +mod worker; + +/// Run CLI +#[tokio::main] +async fn main() { + // Attempt to pre-load .env in case it contains a RUST_LOG variable + dotenv().ok(); + tracing_subscriber::fmt() + .with_env_filter(EnvFilter::from_default_env()) + .init(); + + let settings = Settings::load().unwrap(); + + let state: AppState = App::from_settings(settings.clone()).await.unwrap().into(); + + if settings.run_database_migrations == Some(1) { + // Run migrations on server startup + let conn = state.db_pool.get().await.unwrap(); + conn.interact(|conn| conn.run_pending_migrations(MIGRATIONS).and(Ok(()))) + .await + .unwrap() + .unwrap(); + } + + let cli = Cli::parse(); + match &cli.command { + Commands::Serve => serve_command(state).await.unwrap(), + Commands::Worker(args) => worker_command(args, state).await.unwrap(), + } +} diff --git a/src/middleware.rs b/src/middleware.rs new file mode 100644 index 0000000..a61079a --- /dev/null +++ b/src/middleware.rs @@ -0,0 +1,17 @@ +use axum::http::Request; + +/// Pass to axum::middleware::map_request() to transform the entire URI path +/// (but not search query) to lowercase. +pub async fn lowercase_uri_path(mut request: Request) -> Request { + let path = request.uri().path().to_lowercase(); + let path_and_query = match request.uri().query() { + Some(query) => format!("{}?{}", path, query), + None => path, + }; + let builder = + axum::http::uri::Builder::from(request.uri().clone()).path_and_query(path_and_query); + *request.uri_mut() = builder + .build() + .expect("lowercasing URI path should not break it"); + request +} diff --git a/src/migrations.rs b/src/migrations.rs new file mode 100644 index 0000000..9c47191 --- /dev/null +++ b/src/migrations.rs @@ -0,0 +1,3 @@ +use diesel_migrations::{embed_migrations, EmbeddedMigrations}; + +pub const MIGRATIONS: EmbeddedMigrations = embed_migrations!("migrations/"); diff --git a/src/nav.rs b/src/nav.rs new file mode 100644 index 0000000..136e33d --- /dev/null +++ b/src/nav.rs @@ -0,0 +1,236 @@ +use std::collections::HashMap; + +use axum::extract::FromRef; + +use crate::app_state::AppState; + +pub const NAVBAR_ITEM_TEAMS: &str = "teams"; +pub const NAVBAR_ITEM_PROJECTS: &str = "projects"; +pub const NAVBAR_ITEM_CHANNELS: &str = "channels"; +pub const NAVBAR_ITEM_TEAM_MEMBERS: &str = "team-members"; + +#[derive(Clone, Debug)] +pub struct BreadcrumbTrail { + base_path: String, + breadcrumbs: Vec, +} + +impl BreadcrumbTrail { + /// Initialize with a non-empty base path. + pub fn from_base_path(base_path: &str) -> Self { + Self { + base_path: base_path.to_owned(), + breadcrumbs: Vec::new(), + } + } + + /// Append an i18n path segment to the base path. + pub fn with_i18n_slug(mut self, language_code: &str) -> Self { + self.base_path.push('/'); + self.base_path.push_str(language_code); + self + } + + /// Add a breadcrumb by name and slug. If other breadcrumbs have already + /// been added, href will be generated by appending it to the previous href + /// as "/". Otherwise, it will be appended to the base path + /// with i18n slug (if any). + pub fn push_slug(mut self, label: &str, slug: &str) -> Self { + let href = if let Some(prev_breadcrumb) = self.iter().last() { + format!( + "{}/{}", + prev_breadcrumb.href, + percent_encoding::percent_encode( + slug.as_bytes(), + percent_encoding::NON_ALPHANUMERIC + ) + ) + } else { + format!("{}/{}", self.base_path, slug) + }; + self.breadcrumbs.push(Breadcrumb { + label: label.to_owned(), + href, + }); + self + } + + pub fn iter(&self) -> std::slice::Iter<'_, Breadcrumb> { + self.breadcrumbs.iter() + } + + /// Get an absolute URI path, starting from the child of the last + /// breadcrumb. For example, if the last breadcrumb has an href of + /// "/en/teams/team123" and the relative path is "../team456", the result + /// will be "/en/teams/team456". If no breadcrumbs exist, the base path + /// with i18n slug (if any) will be used. + pub fn join(&self, rel_path: &str) -> String { + let base = if let Some(breadcrumb) = self.iter().last() { + &breadcrumb.href + } else { + &self.base_path + }; + let mut path_buf: Vec<&str> = base.split('/').collect(); + for rel_segment in rel_path.split('/') { + if rel_segment == "." { + continue; + } else if rel_segment == ".." { + path_buf.pop(); + } else { + path_buf.push(rel_segment); + } + } + path_buf.join("/") + } +} + +impl IntoIterator for BreadcrumbTrail { + type Item = Breadcrumb; + type IntoIter = std::vec::IntoIter; + + fn into_iter(self) -> Self::IntoIter { + self.breadcrumbs.into_iter() + } +} + +#[derive(Clone, Debug)] +pub struct Breadcrumb { + pub href: String, + pub label: String, +} + +#[derive(Clone, Debug)] +pub struct NavbarBuilder { + base_path: String, + items: Vec, + active_item: Option, + params: HashMap, +} + +impl NavbarBuilder { + pub fn new() -> Self { + Self { + base_path: "".to_owned(), + items: Vec::new(), + active_item: None, + params: HashMap::new(), + } + } + + pub fn with_base_path(mut self, base_path: &str) -> Self { + self.base_path = base_path.to_owned(); + self + } + + /// Add a navbar item. Subpath is a path relative to the base path, and it + /// may contain placeholders for path params, such as "/{lang}/teams". + /// The navbar item will only be displayed if all corresponding path params + /// are registered using .with_param(). + pub fn push_item(mut self, id: &str, label: &str, subpath: &str) -> Self { + self.items.push(NavbarItem { + id: id.to_owned(), + href: subpath.to_owned(), + label: label.to_owned(), + }); + self + } + + /// Registers a path param with the navbar builder. + pub fn with_param(mut self, k: &str, v: &str) -> Self { + self.params.insert(k.to_owned(), v.to_owned()); + self + } + + /// If a visible navbar item matches the provided ID, it will render as + /// active. Calling this method overrides any previously specified value. + pub fn with_active_item(mut self, item_id: &str) -> Self { + self.active_item = Some(item_id.to_owned()); + self + } + + pub fn build(self) -> Navbar { + let mut built_items: Vec = Vec::with_capacity(self.items.len()); + for item in self.items { + let path_segments = item.href.split('/'); + let substituted_segments: Vec> = path_segments + .map(|segment| { + if segment.starts_with("{") && segment.ends_with("}") { + let param_k = segment[1..segment.len() - 1].trim(); + self.params.get(param_k).map(|v| v.as_str()) + } else { + Some(segment) + } + }) + .collect(); + if substituted_segments.iter().all(|segment| segment.is_some()) { + built_items.push(NavbarItem { + id: item.id, + href: format!( + "{}{}", + self.base_path, + substituted_segments + .into_iter() + .map(|segment| { + segment.expect( + "should already have checked that all path segments are Some", + ) + }) + .collect::>() + .join("/") + ), + label: item.label, + }); + } + } + Navbar { + active_item: self.active_item, + items: built_items, + } + } +} + +impl Default for NavbarBuilder { + fn default() -> Self { + Self::new() + .push_item(NAVBAR_ITEM_TEAMS, "Teams", "/en/teams") + .push_item( + NAVBAR_ITEM_PROJECTS, + "Projects", + "/en/teams/{team_id}/projects", + ) + .push_item( + NAVBAR_ITEM_CHANNELS, + "Channels", + "/en/teams/{team_id}/channels", + ) + .push_item( + NAVBAR_ITEM_TEAM_MEMBERS, + "Team Members", + "/en/teams/{team_id}/members", + ) + } +} + +impl FromRef for NavbarBuilder +where + S: Into + Clone, +{ + fn from_ref(state: &S) -> Self { + Into::::into(state.clone()) + .navbar_template + .clone() + } +} + +#[derive(Clone, Debug)] +pub struct Navbar { + pub items: Vec, + pub active_item: Option, +} + +#[derive(Clone, Debug)] +pub struct NavbarItem { + pub href: String, + pub id: String, + pub label: String, +} diff --git a/src/router.rs b/src/router.rs new file mode 100644 index 0000000..069a778 --- /dev/null +++ b/src/router.rs @@ -0,0 +1,136 @@ +use anyhow::{Context as _, Result}; +use askama::Template; +use axum::{ + extract::State, + http::{header::CACHE_CONTROL, HeaderValue}, + response::{Html, IntoResponse as _, Response}, + routing::get, + Router, +}; +use catalogs::{ + pg_class::{self, PgClass}, + pg_namespace, + pg_roles::{self, PgRole}, + table_privileges::{self, TablePrivilege}, +}; +use diesel::{prelude::*, sql_query}; +use tower::ServiceBuilder; +use tower_http::{ + services::{ServeDir, ServeFile}, + set_header::SetResponseHeaderLayer, +}; + +use crate::{ + abstract_::{class_privileges_for_grantees, escape_identifier}, + app_error::AppError, + app_state::{AppState, DbConn}, + auth, + settings::Settings, + users::CurrentUser, +}; + +pub fn new_router(state: AppState) -> Router<()> { + let base_path = state.settings.base_path.clone(); + let app = Router::new() + .route("/", get(landing_page)) + .nest("/auth", auth::new_router()) + .layer(SetResponseHeaderLayer::if_not_present( + CACHE_CONTROL, + HeaderValue::from_static("no-cache"), + )) + .fallback_service( + ServiceBuilder::new() + .layer(SetResponseHeaderLayer::if_not_present( + CACHE_CONTROL, + HeaderValue::from_static("max-age=21600, stale-while-revalidate=86400"), + )) + .service( + ServeDir::new("static").not_found_service( + ServiceBuilder::new() + .layer(SetResponseHeaderLayer::if_not_present( + CACHE_CONTROL, + HeaderValue::from_static("no-cache"), + )) + .service(ServeFile::new("static/_404.html")), + ), + ), + ) + .with_state(state); + if base_path.is_empty() { + app + } else { + Router::new().nest(&base_path, app).fallback_service( + ServeDir::new("static").not_found_service(ServeFile::new("static/_404.html")), + ) + } +} + +async fn landing_page( + State(Settings { + base_path, + pg_user_role_prefix, + .. + }): State, + DbConn(db_conn): DbConn, + CurrentUser(current_user): CurrentUser, +) -> Result { + let grantees = vec![format!( + "{}{}", + pg_user_role_prefix, + current_user.id.simple() + )]; + let visible_tables = db_conn + .interact(move |conn| -> Result> { + let role = PgRole::all() + .filter(pg_roles::dsl::rolname.eq(format!( + "{}{}", + pg_user_role_prefix, + current_user.id.simple() + ))) + .first(conn) + .optional() + .context("error reading role")?; + if role.is_none() { + sql_query(format!( + "CREATE ROLE {}", + escape_identifier(&format!( + "{}{}", + pg_user_role_prefix, + current_user.id.simple() + )) + )) + .execute(conn) + .context("error creating role")?; + } + sql_query(format!( + "SET ROLE {}", + escape_identifier(&format!( + "{}{}", + pg_user_role_prefix, + current_user.id.simple() + )) + )) + .execute(conn) + .context("error setting role to user")?; + let privileges = class_privileges_for_grantees(grantees) + .load(conn) + .context("error reading classes")?; + Ok(privileges.into_iter().map(|value| value.class).collect()) + }) + .await + .unwrap()?; + #[derive(Template)] + #[template(path = "tmp.html")] + struct ResponseTemplate { + base_path: String, + relations: Vec, + } + Ok(Html( + ResponseTemplate { + base_path, + relations: visible_tables, + } + .render()?, + ) + .into_response()) +} diff --git a/src/schema.rs b/src/schema.rs new file mode 100644 index 0000000..fedb061 --- /dev/null +++ b/src/schema.rs @@ -0,0 +1,23 @@ +// @generated automatically by Diesel CLI. + +diesel::table! { + browser_sessions (id) { + id -> Text, + serialized -> Text, + created_at -> Timestamptz, + expiry -> Nullable, + } +} + +diesel::table! { + users (id) { + id -> Uuid, + uid -> Text, + email -> Text, + } +} + +diesel::allow_tables_to_appear_in_same_query!( + browser_sessions, + users, +); diff --git a/src/sessions.rs b/src/sessions.rs new file mode 100644 index 0000000..d1a299f --- /dev/null +++ b/src/sessions.rs @@ -0,0 +1,173 @@ +use anyhow::Result; +use async_session::{async_trait, Session, SessionStore}; +use axum::{ + extract::{FromRef, FromRequestParts}, + http::request::Parts, + RequestPartsExt as _, +}; +use axum_extra::extract::CookieJar; +use chrono::{DateTime, TimeDelta, Utc}; +use diesel::{pg::Pg, prelude::*, upsert::excluded}; +use tracing::{trace_span, Instrument}; + +use crate::{app_error::AppError, app_state::AppState, schema::browser_sessions}; + +const EXPIRY_DAYS: i64 = 7; + +#[derive(Clone, Debug, Identifiable, Queryable, Selectable)] +#[diesel(table_name = browser_sessions)] +#[diesel(check_for_backend(Pg))] +pub struct BrowserSession { + pub id: String, + pub serialized: String, + pub expiry: Option>, +} + +#[derive(Clone)] +pub struct PgStore { + pool: deadpool_diesel::postgres::Pool, +} + +impl PgStore { + pub fn new(pool: deadpool_diesel::postgres::Pool) -> PgStore { + Self { pool } + } +} + +impl std::fmt::Debug for PgStore { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "PgStore")?; + Ok(()) + } +} + +impl FromRef for PgStore { + fn from_ref(state: &AppState) -> Self { + state.session_store.clone() + } +} + +#[async_trait] +impl SessionStore for PgStore { + async fn load_session(&self, cookie_value: String) -> Result> { + let session_id = Session::id_from_cookie_value(&cookie_value)?; + let conn = self.pool.get().await?; + let row = conn + .interact(move |conn| { + // Drop all sessions without recent activity + diesel::delete( + browser_sessions::table.filter(browser_sessions::expiry.lt(diesel::dsl::now)), + ) + .execute(conn)?; + browser_sessions::table + .filter(browser_sessions::id.eq(session_id)) + .select(BrowserSession::as_select()) + .first(conn) + .optional() + }) + .await + .unwrap()?; + Ok(match row { + Some(session) => Some(serde_json::from_str::( + session.serialized.as_str(), + )?), + None => None, + }) + } + + async fn store_session(&self, session: Session) -> Result> { + let serialized_data = serde_json::to_string(&session)?; + let session_id = session.id().to_string(); + let expiry = session.expiry().copied(); + let conn = self.pool.get().await?; + conn.interact(move |conn| { + diesel::insert_into(browser_sessions::table) + .values(( + browser_sessions::id.eq(session_id), + browser_sessions::serialized.eq(serialized_data), + browser_sessions::expiry.eq(expiry), + )) + .on_conflict(browser_sessions::id) + .do_update() + .set(( + browser_sessions::serialized.eq(excluded(browser_sessions::serialized)), + browser_sessions::expiry.eq(excluded(browser_sessions::expiry)), + )) + .execute(conn) + }) + .await + .unwrap()?; + Ok(session.into_cookie_value()) + } + + async fn destroy_session(&self, session: Session) -> Result<()> { + let session_id = session.id().to_owned(); + let conn = self.pool.get().await?; + conn.interact(move |conn| { + diesel::delete( + browser_sessions::table.filter(browser_sessions::id.eq(session.id().to_string())), + ) + .execute(conn) + }) + .await + .unwrap()?; + tracing::debug!("destroyed session {}", session_id); + Ok(()) + } + + async fn clear_store(&self) -> Result<()> { + let conn = self.pool.get().await?; + conn.interact(move |conn| diesel::delete(browser_sessions::table).execute(conn)) + .await + .unwrap()?; + Ok(()) + } +} + +#[derive(Clone)] +pub struct AppSession(pub Option); + +impl FromRequestParts for AppSession { + type Rejection = AppError; + + async fn from_request_parts( + parts: &mut Parts, + state: &AppState, + ) -> Result>::Rejection> { + async move { + let jar = parts.extract::().await.unwrap(); + let session_cookie = match jar.get(&state.settings.auth.cookie_name) { + Some(cookie) => cookie, + None => { + tracing::debug!("no session cookie present"); + return Ok(AppSession(None)); + } + }; + tracing::debug!("session cookie loaded"); + let maybe_session = state + .session_store + .load_session(session_cookie.value().to_string()) + .await?; + if let Some(mut session) = maybe_session { + tracing::debug!("session {} loaded", session.id()); + session.expire_in(TimeDelta::days(EXPIRY_DAYS).to_std()?); + if state + .session_store + .store_session(session.clone()) + .await? + .is_some() + { + return Err(anyhow::anyhow!( + "expected cookie value returned by store_session() to be None for existing session" + ) + .into()); + } + Ok(AppSession(Some(session))) + } else { + tracing::debug!("no matching session found in database"); + Ok(AppSession(None)) + } + // The Span.enter() guard pattern doesn't play nicely async + }.instrument(trace_span!("AppSession::from_request_parts()")).await + } +} diff --git a/src/settings.rs b/src/settings.rs new file mode 100644 index 0000000..47fd0e3 --- /dev/null +++ b/src/settings.rs @@ -0,0 +1,107 @@ +use anyhow::{Context as _, Result}; +use axum::extract::FromRef; +use config::{Config, Environment}; +use dotenvy::dotenv; +use serde::Deserialize; + +use crate::app_state::AppState; + +#[derive(Clone, Debug, Deserialize)] +pub struct Settings { + /// Prefix under which to nest all routes. If specified, include leading + /// slash but no trailing slash, for example "/app". For default behavior, + /// leave as empty string. + #[serde(default)] + pub base_path: String, + + /// postgresql:// URL. + pub database_url: String, + + /// Super-user role the server will use to create new user roles and manage + /// database resources. + pub pg_root_role: String, + + #[serde(default = "default_pg_user_role_prefix")] + pub pg_user_role_prefix: String, + + /// When set to 1, embedded Diesel migrations will be run on startup. + pub run_database_migrations: Option, + + /// Address for server to bind to + #[serde(default = "default_host")] + pub host: String, + + /// Port for server to bind to + #[serde(default = "default_port")] + pub port: u16, + + /// Host visible to end users, for example "https://shout.dev" + pub frontend_host: String, + + pub auth: AuthSettings, +} + +fn default_port() -> u16 { + 8080 +} + +fn default_host() -> String { + "127.0.0.1".to_owned() +} + +fn default_pg_user_role_prefix() -> String { + "__interim_user__".to_owned() +} + +#[derive(Clone, Debug, Deserialize)] +pub struct AuthSettings { + pub client_id: String, + pub client_secret: String, + pub auth_url: String, + pub token_url: String, + pub userinfo_url: String, + pub logout_url: Option, + + #[serde(default = "default_cookie_name")] + pub cookie_name: String, +} + +fn default_cookie_name() -> String { + "INTERIM_SESSION".to_string() +} + +impl Settings { + pub fn load() -> Result { + match dotenv() { + Err(err) => { + if err.not_found() { + tracing::info!("no .env file found"); + } else { + return Err(err).context("dotenvy error"); + } + } + Ok(pathbuf) => { + tracing::info!( + "using env file {}", + pathbuf + .to_str() + .ok_or(anyhow::anyhow!("pathbuf is not valid unicode"))? + ); + } + } + let s = Config::builder() + .add_source(Environment::default().separator("__")) + .build() + .context("config error")?; + s.try_deserialize().context("deserialize error") + } +} + +impl FromRef for Settings +where + S: Into + Clone, +{ + fn from_ref(state: &S) -> Self { + Into::::into(state.clone()).settings.clone() + } +} diff --git a/src/users.rs b/src/users.rs new file mode 100644 index 0000000..ad8114b --- /dev/null +++ b/src/users.rs @@ -0,0 +1,175 @@ +use anyhow::Context; +use async_session::{Session, SessionStore as _}; +use axum::{ + extract::{FromRequestParts, OriginalUri}, + http::{request::Parts, Method}, + response::{IntoResponse, Redirect, Response}, + RequestPartsExt, +}; +use axum_extra::extract::{ + cookie::{Cookie, SameSite}, + CookieJar, +}; +use diesel::{ + associations::Identifiable, + deserialize::Queryable, + dsl::{auto_type, insert_into, AsSelect, Eq, Select}, + pg::Pg, + prelude::*, + Selectable, +}; +use uuid::Uuid; + +use crate::{ + app_error::AppError, + app_state::AppState, + auth::{AuthInfo, SESSION_KEY_AUTH_INFO, SESSION_KEY_AUTH_REDIRECT}, + schema::users, + sessions::AppSession, +}; + +#[allow(unused_imports)] +pub use crate::schema::users::{dsl, table}; + +#[derive(Clone, Debug, Identifiable, Insertable, Queryable, Selectable)] +#[diesel(table_name = users)] +#[diesel(check_for_backend(Pg))] +pub struct User { + pub id: Uuid, + pub uid: String, + pub email: String, +} + +impl User { + pub fn all() -> Select> { + users::table.select(User::as_select()) + } + + #[auto_type(no_type_alias)] + pub fn with_uid(uid_value: &str) -> _ { + users::uid.eq(uid_value) + } +} + +#[derive(Clone, Debug)] +pub struct CurrentUser(pub User); + +impl FromRequestParts for CurrentUser +where + S: Into + Clone + Sync, +{ + type Rejection = CurrentUserRejection; + + async fn from_request_parts(parts: &mut Parts, state: &S) -> Result { + let app_state: AppState = state.clone().into(); + let mut session = + if let AppSession(Some(value)) = parts.extract_with_state(&app_state).await? { + value + } else { + Session::new() + }; + let auth_info = if let Some(value) = session.get::(SESSION_KEY_AUTH_INFO) { + value + } else { + let jar: CookieJar = parts.extract().await?; + let method: Method = parts.extract().await?; + let jar = if method == Method::GET { + let OriginalUri(uri) = parts.extract().await?; + session.insert( + SESSION_KEY_AUTH_REDIRECT, + uri.path_and_query() + .map(|value| value.to_string()) + .unwrap_or(format!("{}/", app_state.settings.base_path)), + )?; + if let Some(cookie_value) = app_state.session_store.store_session(session).await? { + tracing::debug!("adding session cookie to jar"); + jar.add( + Cookie::build((app_state.settings.auth.cookie_name.clone(), cookie_value)) + .same_site(SameSite::Lax) + .http_only(true) + .path("/"), + ) + } else { + tracing::debug!("inferred that session cookie already in jar"); + jar + } + } else { + // If request method is not GET then do not attempt to infer the + // redirect target, as there may be no GET handler defined for + // it. + jar + }; + return Err(Self::Rejection::SetCookiesAndRedirect( + jar, + format!("{}/auth/login", app_state.settings.base_path), + )); + }; + let db_conn = app_state.db_pool.get().await?; + let current_user = db_conn + .interact(move |conn| { + let maybe_current_user = User::all() + .filter(User::with_uid(&auth_info.sub)) + .first(conn) + .optional() + .context("failed to load maybe_current_user")?; + if let Some(current_user) = maybe_current_user { + return Ok(current_user); + } + let new_user = User { + id: Uuid::now_v7(), + uid: auth_info.sub.clone(), + email: auth_info.email, + }; + match insert_into(users::table) + .values(new_user) + .on_conflict(users::uid) + .do_nothing() + .returning(User::as_returning()) + .get_result(conn) + { + QueryResult::Err(diesel::result::Error::NotFound) => { + tracing::debug!("detected race to insert current user record"); + User::all() + .filter(User::with_uid(&auth_info.sub)) + .first(conn) + .context( + "failed to load record after detecting race to insert current user", + ) + } + QueryResult::Err(err) => { + Err(err).context("failed to insert current user record") + } + QueryResult::Ok(result) => Ok(result), + } + }) + .await + .unwrap()?; + Ok(CurrentUser(current_user)) + } +} + +pub enum CurrentUserRejection { + AppError(AppError), + SetCookiesAndRedirect(CookieJar, String), +} + +// Easily convert semi-arbitrary errors to InternalServerError +impl From for CurrentUserRejection +where + E: Into, +{ + fn from(err: E) -> Self { + Self::AppError(err.into()) + } +} + +impl IntoResponse for CurrentUserRejection { + fn into_response(self) -> Response { + match self { + Self::AppError(err) => err.into_response(), + Self::SetCookiesAndRedirect(jar, redirect_to) => { + (jar, Redirect::to(&redirect_to)).into_response() + } + } + } +} diff --git a/src/worker.rs b/src/worker.rs new file mode 100644 index 0000000..ad2ccff --- /dev/null +++ b/src/worker.rs @@ -0,0 +1,10 @@ +use anyhow::Result; +use tracing::Instrument as _; + +use crate::app_state::AppState; + +pub async fn run_worker(_state: AppState) -> Result<()> { + async move { Ok(()) } + .instrument(tracing::debug_span!("run_worker()")) + .await +} diff --git a/static/_404.html b/static/_404.html new file mode 100644 index 0000000..407c863 --- /dev/null +++ b/static/_404.html @@ -0,0 +1,9 @@ + + + + Not found + + + Page not found. + + diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..d212a9c85be93aacff371fbc8cf6e9d959f187b8 GIT binary patch literal 2965 zcmV;G3u^RStO&>uS)ve<0AYj>5AR{$W90N^4L=L-RlQUJ&DC0@ZjPh;=*jPLSYvv5M~MFBAl0-BNIsH z15C~g000{K(ZT*WKal6<?_01!^k@7iDG<<3=fuAC~28EsPoqkpK{9G%|Vj005J}`Hw&=0RYXHq~ibpyyzHQsFW8>#s~laM4*8xut5h5 z!4#~(4xGUqyucR%VFpA%3?#rj5JCpzfE)^;7?wd9RKPme1hudO8lVxH;SjXJF*pt9 z;1XPc>u?taU>Kgl7`%oF1VP9M6Ja4bh!J9r*dopd7nzO(B4J20l7OTj>4+3jBE`sZ zqynizYLQ(?Bl0bB6giDtK>Co|$RIL`{EECsF_eL_Q3KQhbwIhO9~z3rpmWi5G!I>X zmZEFX8nhlgfVQHi(M#xcbO3#dj$?q)F%D*o*1Pf{>6$SWH+$s3q(pv=X`qR|$iJF~TPzlc-O$C3+J1 z#CT#lv5;6stS0Uu9wDA3UMCI{Uz12A4#|?_P6{CkNG+sOq(0IRX`DyT~9-sA|ffUF>wk++Z!kWZ5P$;0Hg6gtI-;!FvmBvPc55=u2?Kjj3apE5$3psG>L zsh-pbs)#zDT1jo7c2F-(3)vyY4>O^>2$gY-Gd%Qm(Z8e zYv>2*=jns=cMJ`N4THx>VkjAF8G9M07`GWOnM|ey)0dgZR4~^v8<}UA514ONSSt1^ zd=-((5|uiYR+WC0=c-gyb5%dpd8!Lkt5pxHURHgkMpd&=fR^vEcAI*_=wwAG2sV%zY%w@v@XU~7=xdm1xY6*0;iwVIXu6TaXrs|dqbIl~ z?uTdNHFy_3W~^@g_pF#!K2~{F^;XxcN!DEJEbDF7 zS8PxlSDOr*I-AS3sI8l=#CDr)-xT5$k15hA^;2%zG3@;83hbKf2JJcaVfH2VZT8O{ z%p4LO);n}Nd~$Sk%yw*Wyz8XlG{dRHsl(}4XB%gsbDi@w7p6;)%MzD%mlsoQr;4X; zpL)xc%+^yMd)ZNTI#eJ*$O)i@o$z8)e??LqN_gLa_%;TM>o2SC_ zkmoO6c3xRt`@J4dvz#WL)-Y|z+r(Soy~}%GIzByR`p)SCKE^%*pL(B%zNWq+-#xw~ ze%5}Oeh2)X`#bu}{g3#+;d$~F@lFL`0l@*~0lk45fwKc^10MvL1f>Tx1&sx}1}_Xg z6+#RN4Ot&@lW)Km@*DYMGu&q^n$Z=?2%QyL8~QNJCQKgI5srq>2;UHXZ>IT7>CCnW zh~P(Th`1kV8JQRPeH1AwGO8}>QM6NZadh`A)~w`N`)9q5@sFvDxjWlxwsLl7tZHmh zY-8-3xPZ8-xPf?w_(k!T5_A(J3GIpG#Ms0=iQ{tu=WLoYoaCBRmULsT<=mpV7v|~C z%bs^USv6UZd^m-e5|^?+<%1wXP%juy<)>~<9TW0|n}ttBzM_qyQL(qUN<5P0omQ3h zINdvaL;7fjPeygdGYL;pD|wL_lDQ-EO;$wK-mK5raoH_7l$?~Dqf!lNmb5F^Ft;eT zPi8AClMUo~=55LwlZVRpxOiFd;3B_8yA~shQx|tGF!j;$toK>JuS&gYLDkTP@C~gS@r~shUu{a>bfJ1` z^^VQ7&C1OKHDNXFTgC{M|V%fo{xK_dk6MK@9S!GZ*1JJzrV5xZBjOk z9!NTH<(q(S+MDf~ceQX@Dh|Ry<-sT4rhI$jQ0Sq~!`#Eo-%($2E^vo}is5J@NVEf|KK?WT&2;PCq@=ncR8z zO#GQ^T~S@VXG71PKNocFOt)Y6$@AXlk6rM*aP%VgV%sIRORYVwJx6|U{ozQjTW{-S z_si{9Jg#)~P3t?+@6&(!YQWWV*Z9{iU7vZq@5byKw{9lg9JnRA_4s!7?H6|n?o8ZW zdXIRo{Jz@#>IeD{>VLHUv1Pz*;P_y`V9&!@5AO~Mho1hF|I>%z(nrik)gwkDjgOrl z9~%uCz4Bzvli{bbrxVZ0epdf^>vOB;-~HnIOV3#R*zgPai_gEVd8zYq@2jb=I>#f& zAH2?aJ@KaetN-Qi@LHzdFPqG+J zJig1N(dNL+lYAPK)tjF+o(HdYqaFdPcNb%h_yh3NcUxeg`TBnVy%`@()^TOI00000 LNkvXXu0mjf7I~F{ literal 0 HcmV?d00001 diff --git a/static/logo.svg b/static/logo.svg new file mode 100644 index 0000000..86c5126 --- /dev/null +++ b/static/logo.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/main.css b/static/main.css new file mode 100644 index 0000000..d8dd13d --- /dev/null +++ b/static/main.css @@ -0,0 +1,13 @@ +:root { + --bs-font-sans-serif: Geist, "Noto Sans", Roboto, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji"; +} + +[data-bs-theme="dark"] { + --bs-body-bg: rgb(27, 28, 30); + --bs-tertiary-bg-rgb: 36, 38, 40; +} + +@font-face { + font-family: Geist; + src: url("./geist/geist_variable.ttf"); +} diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..ed4843c --- /dev/null +++ b/templates/base.html @@ -0,0 +1,12 @@ + + + + {% block title %}Interim{% endblock %} + {% include "meta_tags.html" %} + + + + {% include "nav.html" %} + {% block main %}{% endblock main %} + + diff --git a/templates/meta_tags.html b/templates/meta_tags.html new file mode 100644 index 0000000..605426e --- /dev/null +++ b/templates/meta_tags.html @@ -0,0 +1,4 @@ + + + + diff --git a/templates/nav.html b/templates/nav.html new file mode 100644 index 0000000..9c348dd --- /dev/null +++ b/templates/nav.html @@ -0,0 +1,7 @@ + diff --git a/templates/tmp.html b/templates/tmp.html new file mode 100644 index 0000000..24d82b2 --- /dev/null +++ b/templates/tmp.html @@ -0,0 +1,18 @@ +{% extends "base.html" %} + +{% block main %} + + + + + + + + {% for relation in relations %} + + + + {% endfor %} + +
Name
{{ relation.relname }}
+{% endblock %}