From fc6b66f2e65aa7ec1afec8e3f188a06bb19be828 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 13 Apr 2025 18:38:38 +0000 Subject: [PATCH 01/18] Docker changes (#31) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/31 Co-authored-by: phoenix Co-committed-by: phoenix --- .dockerignore.yaml | 2 ++ .env.sample | 8 ++++++-- Dockerfile | 4 ---- READEME.md | 20 ++++++++++++++++++++ docker-compose.yaml | 27 ++++++++------------------- docker_run.txt | 6 +++--- src/lib.rs | 1 - 7 files changed, 39 insertions(+), 29 deletions(-) create mode 100644 READEME.md diff --git a/.dockerignore.yaml b/.dockerignore.yaml index 9b144ce..dfcd3fa 100644 --- a/.dockerignore.yaml +++ b/.dockerignore.yaml @@ -5,6 +5,8 @@ pkg/ # Ignore git directory .git/ +.gitea/ + # Ignore environment files (configure via docker-compose instead) .env* diff --git a/.env.sample b/.env.sample index c7494ce..30ccbb4 100644 --- a/.env.sample +++ b/.env.sample @@ -1,2 +1,6 @@ -DATABASE_URL=postgres://username:password@localhost/database_name -SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h \ No newline at end of file +SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h +POSTGRES_USER=icarus_op_test +POSTGRES_PASSWORD=password +POSTGRES_DB=icarus_auth_test_db +POSTGRES_HOST=localhost +DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 48e6b75..c1b1081 100644 --- a/Dockerfile +++ b/Dockerfile @@ -34,8 +34,6 @@ RUN --mount=type=ssh mkdir src && \ # Copy the actual source code COPY src ./src # If you have other directories like `templates` or `static`, copy them too -# COPY templates ./templates -# COPY static ./static COPY .env ./.env COPY migrations ./migrations @@ -64,8 +62,6 @@ COPY --from=builder /usr/src/app/target/release/icarus_auth . # It's generally better to configure via environment variables in Docker though COPY --from=builder /usr/src/app/.env . COPY --from=builder /usr/src/app/migrations ./migrations -# COPY --from=builder /usr/src/app/templates ./templates -# COPY --from=builder /usr/src/app/static ./static # Expose the port your Axum app listens on (e.g., 3000 or 8000) EXPOSE 3000 diff --git a/READEME.md b/READEME.md new file mode 100644 index 0000000..5ba9a07 --- /dev/null +++ b/READEME.md @@ -0,0 +1,20 @@ + + +# Getting started +Take notice of the .env.sample file and create copies without the .sample in the name. + +`.env.sample` -> `.env` + +Ensure that all variables are populated and is correct. + +## Docker + +Build the images +``` +docker compose build --ssh default auth_api +``` + +Bring it up +``` +docker compose up -d --force-recreate auth_api +``` \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index 38c1b41..8dd5162 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,43 +2,32 @@ version: '3.8' # Use a recent version services: # Your Rust Application Service - app: + auth_api: build: . # Tells docker-compose to build the Dockerfile in the current directory container_name: icarus_auth # Optional: Give the container a specific name ports: # Map host port 8000 to container port 3000 (adjust as needed) - # Format: "HOST_PORT:CONTAINER_PORT" - "8000:3000" - environment: - # Pass environment variables to your Rust application - # RUST_LOG: info # Example: Set log level - # IMPORTANT: Configure DATABASE_URL to connect to the 'db' service - # The hostname 'db' matches the service name defined below. - DATABASE_URL: postgresql://icarus_op:password@db:5432/icarus_auth - # Add any other environment variables your app needs - # APP_HOST: 0.0.0.0 - # APP_PORT: 3000 + env_file: + - .env depends_on: - db: + auth_db: condition: service_healthy # Wait for the DB to be healthy before starting the app restart: unless-stopped # Optional: Restart policy # PostgreSQL Database Service - db: + auth_db: image: postgres:17.4-alpine # Use an official Postgres image (Alpine variant is smaller) container_name: icarus_auth_db # Optional: Give the container a specific name environment: # These MUST match the user, password, and database name in the DATABASE_URL above - POSTGRES_USER: icarus_op - POSTGRES_PASSWORD: password - POSTGRES_DB: icarus_auth + POSTGRES_USER: ${POSTGRES_USER:-icarus_op} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} + POSTGRES_DB: ${POSTGRES_DB:-icarus_auth} volumes: # Persist database data using a named volume - postgres_data:/var/lib/postgresql/data ports: [] - # Optional: Expose port 5432 ONLY if you need to connect directly from your host machine (e.g., for debugging) - # - "5432:5432" - # pass: healthcheck: # Checks if Postgres is ready to accept connections test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"] diff --git a/docker_run.txt b/docker_run.txt index bc0f021..7f319e4 100644 --- a/docker_run.txt +++ b/docker_run.txt @@ -1,13 +1,13 @@ # Docker stuff #Build app -docker-compose build --ssh default app +docker compose build --ssh default auth_api # Rebuild and bring up -docker-compose up -d --force-recreate app +docker compose up -d --force-recreate auth_api # Bring it down -docker-compose down -v +docker compose down -v # Pruning docker system prune -a \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs index 9ab8f4d..ca334c5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,7 +36,6 @@ pub mod db { async fn get_db_url() -> String { #[cfg(debug_assertions)] // Example: Only load .env in debug builds dotenvy::dotenv().ok(); - env::var(keys::DBURL).expect(keys::error::ERROR) } -- 2.43.0 From 31be156be34d8cb48f90fda21e91f78477dc02a8 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 27 Apr 2025 16:31:11 +0000 Subject: [PATCH 02/18] Added ssh default for building docker image (#33) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/33 Co-authored-by: phoenix Co-committed-by: phoenix --- READEME.md | 20 -------------------- README.md | 26 ++++++++++++++++++++++++++ docker-compose.yaml | 6 ++++-- docker_run.txt | 13 ------------- 4 files changed, 30 insertions(+), 35 deletions(-) delete mode 100644 READEME.md create mode 100644 README.md delete mode 100644 docker_run.txt diff --git a/READEME.md b/READEME.md deleted file mode 100644 index 5ba9a07..0000000 --- a/READEME.md +++ /dev/null @@ -1,20 +0,0 @@ - - -# Getting started -Take notice of the .env.sample file and create copies without the .sample in the name. - -`.env.sample` -> `.env` - -Ensure that all variables are populated and is correct. - -## Docker - -Build the images -``` -docker compose build --ssh default auth_api -``` - -Bring it up -``` -docker compose up -d --force-recreate auth_api -``` \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b56d1e1 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ + + +# Getting Started +Copy the `.env.sample` file to `.env` and ensure that the variables are populated. This project +can be used with regular hosting or with docker. For the sake of getting up to speed quickly, +Docker will be covered. Make sure docker is running and your ssh identity has been loaded. + +Build image +``` +docker compose build +``` + +Start images +``` +docker compose up -d --force-recreate +``` + +Bring it down +``` +docker compose down -v +``` + +Pruning +``` +docker system prune -a +``` diff --git a/docker-compose.yaml b/docker-compose.yaml index 8dd5162..ed72c2b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -3,7 +3,9 @@ version: '3.8' # Use a recent version services: # Your Rust Application Service auth_api: - build: . # Tells docker-compose to build the Dockerfile in the current directory + build: # Tells docker-compose to build the Dockerfile in the current directory + context: . + ssh: ["default"] # Uses host's SSH agent container_name: icarus_auth # Optional: Give the container a specific name ports: # Map host port 8000 to container port 3000 (adjust as needed) @@ -40,4 +42,4 @@ services: # Define the named volume for data persistence volumes: postgres_data: - driver: local # Use the default local driver \ No newline at end of file + driver: local # Use the default local driver diff --git a/docker_run.txt b/docker_run.txt deleted file mode 100644 index 7f319e4..0000000 --- a/docker_run.txt +++ /dev/null @@ -1,13 +0,0 @@ - -# Docker stuff -#Build app -docker compose build --ssh default auth_api - -# Rebuild and bring up -docker compose up -d --force-recreate auth_api - -# Bring it down -docker compose down -v - -# Pruning -docker system prune -a \ No newline at end of file -- 2.43.0 From 1817ab01d69f3211950fbb0eb7c1dcc9d5398454 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 27 Apr 2025 18:06:13 +0000 Subject: [PATCH 03/18] Test fix (#35) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/35 Co-authored-by: phoenix Co-committed-by: phoenix --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 48239d6..27b8bb1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -74,6 +74,7 @@ mod tests { pub const LIMIT: usize = 6; pub async fn get_pool() -> Result { + dotenvy::dotenv().ok(); // Load .env file if it exists let tm_db_url = std::env::var(keys::DBURL).expect("DATABASE_URL must be present"); let tm_options = sqlx::postgres::PgConnectOptions::from_str(&tm_db_url).unwrap(); sqlx::PgPool::connect_with(tm_options).await -- 2.43.0 From 2c30abb5c6d6191aaf33aae1e0d4d1c799cd5415 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 27 May 2025 20:23:50 +0000 Subject: [PATCH 04/18] Updated gitignore (#36) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/36 Co-authored-by: phoenix Co-committed-by: phoenix --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e551aa3..7394036 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /target Cargo.lock .env +.env.docker -- 2.43.0 From ed77cab7009ae659cc3b12b1e2c091099b8be088 Mon Sep 17 00:00:00 2001 From: phoenix Date: Tue, 27 May 2025 20:55:53 +0000 Subject: [PATCH 05/18] Environment and docker changes (#37) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/37 Co-authored-by: phoenix Co-committed-by: phoenix --- .env.docker.sample | 6 ++++++ .env.sample | 10 +++++----- .gitignore | 1 - docker-compose.yaml | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) create mode 100644 .env.docker.sample diff --git a/.env.docker.sample b/.env.docker.sample new file mode 100644 index 0000000..5c0ad33 --- /dev/null +++ b/.env.docker.sample @@ -0,0 +1,6 @@ +SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h +POSTGRES_AUTH_USER=icarus_op +POSTGRES_AUTH_PASSWORD=password +POSTGRES_AUTH_DB=icarus_auth_db +POSTGRES_AUTH_HOST=auth_db +DATABASE_URL=postgresql://${POSTGRES_AUTH_USER}:${POSTGRES_AUTH_PASSWORD}@${POSTGRES_AUTH_HOST}:5432/${POSTGRES_AUTH_DB} diff --git a/.env.sample b/.env.sample index 30ccbb4..b556c08 100644 --- a/.env.sample +++ b/.env.sample @@ -1,6 +1,6 @@ SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h -POSTGRES_USER=icarus_op_test -POSTGRES_PASSWORD=password -POSTGRES_DB=icarus_auth_test_db -POSTGRES_HOST=localhost -DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:5432/${POSTGRES_DB} \ No newline at end of file +POSTGRES_AUTH_USER=icarus_op_test +POSTGRES_AUTH_PASSWORD=password +POSTGRES_AUTH_DB=icarus_auth_test_db +POSTGRES_AUTH_HOST=localhost +DATABASE_URL=postgresql://${POSTGRES_AUTH_USER}:${POSTGRES_AUTH_PASSWORD}@${POSTGRES_AUTH_HOST}:5432/${POSTGRES_AUTH_DB} diff --git a/.gitignore b/.gitignore index 7394036..e551aa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /target Cargo.lock .env -.env.docker diff --git a/docker-compose.yaml b/docker-compose.yaml index ed72c2b..c87e8d9 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -23,9 +23,9 @@ services: container_name: icarus_auth_db # Optional: Give the container a specific name environment: # These MUST match the user, password, and database name in the DATABASE_URL above - POSTGRES_USER: ${POSTGRES_USER:-icarus_op} - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} - POSTGRES_DB: ${POSTGRES_DB:-icarus_auth} + POSTGRES_USER: ${POSTGRES_AUTH_USER:-icarus_op} + POSTGRES_PASSWORD: ${POSTGRES_AUTH_PASSWORD:-password} + POSTGRES_DB: ${POSTGRES_AUTH_DB:-icarus_auth_db} volumes: # Persist database data using a named volume - postgres_data:/var/lib/postgresql/data -- 2.43.0 From d4faa7976e1094df96d33e5038437efeb515f446 Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 28 May 2025 23:26:17 +0000 Subject: [PATCH 06/18] Update icarus_models (#38) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/38 Co-authored-by: phoenix Co-committed-by: phoenix --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c4d8cf2..9980193 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ argon2 = { version = "0.5.3", features = ["std"] } # Use the latest 0.5.x versio rand = { version = "0.9" } time = { version = "0.3.41", features = ["macros", "serde"] } josekit = { version = "0.10.1" } -icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.4.1" } +icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.4.3" } [dev-dependencies] http-body-util = { version = "0.1.3" } -- 2.43.0 From 02697b2fd9955c8800315324278439864cc28960 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 1 Jun 2025 23:02:09 +0000 Subject: [PATCH 07/18] Adding icarus_envy (#39) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/39 Co-authored-by: phoenix Co-committed-by: phoenix --- Cargo.toml | 2 +- run_migrations.txt | 2 ++ src/callers/login.rs | 2 +- src/lib.rs | 19 ++--------------- src/main.rs | 46 +++++++++++++++++------------------------- src/token_stuff/mod.rs | 14 ++++++------- 6 files changed, 30 insertions(+), 55 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9980193..74088df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,13 +13,13 @@ tracing-subscriber = { version = "0.3.19" } tower = { version = "0.5.2" } hyper = { version = "1.6.0" } sqlx = { version = "0.8.3", features = ["postgres", "runtime-tokio-native-tls", "time", "uuid"] } -dotenvy = { version = "0.15.7" } uuid = { version = "1.16.0", features = ["v4", "serde"] } argon2 = { version = "0.5.3", features = ["std"] } # Use the latest 0.5.x version rand = { version = "0.9" } time = { version = "0.3.41", features = ["macros", "serde"] } josekit = { version = "0.10.1" } icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.4.3" } +icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.2.0-devel-dbe4dc67cb-950" } [dev-dependencies] http-body-util = { version = "0.1.3" } diff --git a/run_migrations.txt b/run_migrations.txt index 927b280..00583ef 100644 --- a/run_migrations.txt +++ b/run_migrations.txt @@ -1,3 +1,5 @@ +TODO: At some point, move this somewhere that is appropriate + # Make sure role has CREATEDB ALTER ROLE username_that_needs_permission CREATEDB; diff --git a/src/callers/login.rs b/src/callers/login.rs index 83347e1..7c391e4 100644 --- a/src/callers/login.rs +++ b/src/callers/login.rs @@ -47,7 +47,7 @@ pub mod endpoint { Ok(user) => { if hashing::verify_password(&payload.password, user.password.clone()).unwrap() { // Create token - let key = token_stuff::get_key().unwrap(); + let key = icarus_envy::environment::get_secret_key().await; let (token_literal, duration) = token_stuff::create_token(&key).unwrap(); if token_stuff::verify_token(&key, &token_literal) { diff --git a/src/lib.rs b/src/lib.rs index ca334c5..ada99d7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,14 +4,6 @@ pub mod hashing; pub mod repo; pub mod token_stuff; -pub mod keys { - pub const DBURL: &str = "DATABASE_URL"; - - pub mod error { - pub const ERROR: &str = "DATABASE_URL must be set in .env"; - } -} - mod connection_settings { pub const MAXCONN: u32 = 5; } @@ -19,12 +11,11 @@ mod connection_settings { pub mod db { use sqlx::postgres::PgPoolOptions; - use std::env; - use crate::{connection_settings, keys}; + use crate::connection_settings; pub async fn create_pool() -> Result { - let database_url = get_db_url().await; + let database_url = icarus_envy::environment::get_db_url().await; println!("Database url: {:?}", database_url); PgPoolOptions::new() @@ -33,12 +24,6 @@ pub mod db { .await } - async fn get_db_url() -> String { - #[cfg(debug_assertions)] // Example: Only load .env in debug builds - dotenvy::dotenv().ok(); - env::var(keys::DBURL).expect(keys::error::ERROR) - } - pub async fn migrations(pool: &sqlx::PgPool) { // Run migrations using the sqlx::migrate! macro // Assumes your migrations are in a ./migrations folder relative to Cargo.toml diff --git a/src/main.rs b/src/main.rs index 27b8bb1..f12ff7c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,25 +69,23 @@ mod tests { mod db_mgr { use std::str::FromStr; - use icarus_auth::keys; - pub const LIMIT: usize = 6; pub async fn get_pool() -> Result { - dotenvy::dotenv().ok(); // Load .env file if it exists - let tm_db_url = std::env::var(keys::DBURL).expect("DATABASE_URL must be present"); + let tm_db_url = icarus_envy::environment::get_db_url().await; let tm_options = sqlx::postgres::PgConnectOptions::from_str(&tm_db_url).unwrap(); sqlx::PgPool::connect_with(tm_options).await } pub async fn generate_db_name() -> String { - let db_name = - get_database_name().unwrap() + &"_" + &uuid::Uuid::new_v4().to_string()[..LIMIT]; + let db_name = get_database_name().await.unwrap() + + &"_" + + &uuid::Uuid::new_v4().to_string()[..LIMIT]; db_name } pub async fn connect_to_db(db_name: &str) -> Result { - let db_url = std::env::var(keys::DBURL).expect("DATABASE_URL must be set for tests"); + let db_url = icarus_envy::environment::get_db_url().await; let options = sqlx::postgres::PgConnectOptions::from_str(&db_url)?.database(db_name); sqlx::PgPool::connect_with(options).await } @@ -113,29 +111,21 @@ mod tests { Ok(()) } - pub fn get_database_name() -> Result> { - dotenvy::dotenv().ok(); // Load .env file if it exists + pub async fn get_database_name() -> Result> { + let database_url = icarus_envy::environment::get_db_url().await; - match std::env::var(keys::DBURL) { - Ok(database_url) => { - let parsed_url = url::Url::parse(&database_url)?; - if parsed_url.scheme() == "postgres" || parsed_url.scheme() == "postgresql" { - match parsed_url - .path_segments() - .and_then(|segments| segments.last().map(|s| s.to_string())) - { - Some(sss) => Ok(sss), - None => Err("Error parsing".into()), - } - } else { - // Handle other database types if needed - Err("Error parsing".into()) - } - } - Err(_) => { - // DATABASE_URL environment variable not found - Err("Error parsing".into()) + let parsed_url = url::Url::parse(&database_url)?; + if parsed_url.scheme() == "postgres" || parsed_url.scheme() == "postgresql" { + match parsed_url + .path_segments() + .and_then(|segments| segments.last().map(|s| s.to_string())) + { + Some(sss) => Ok(sss), + None => Err("Error parsing".into()), } + } else { + // Handle other database types if needed + Err("Error parsing".into()) } } } diff --git a/src/token_stuff/mod.rs b/src/token_stuff/mod.rs index d189a2d..44b3117 100644 --- a/src/token_stuff/mod.rs +++ b/src/token_stuff/mod.rs @@ -12,12 +12,6 @@ pub const MESSAGE: &str = "Something random"; pub const ISSUER: &str = "icarus_auth"; pub const AUDIENCE: &str = "icarus"; -pub fn get_key() -> Result { - dotenvy::dotenv().ok(); - let key = std::env::var(KEY_ENV).expect("SECRET_KEY_NOT_FOUND"); - Ok(key) -} - pub fn get_issued() -> time::Result { Ok(time::OffsetDateTime::now_utc()) } @@ -51,7 +45,10 @@ pub fn create_token(provided_key: &String) -> Result<(String, i64), josekit::Jos payload.set_expires_at(&util::time_to_std_time(&expire).unwrap()); let key: String = if provided_key.is_empty() { - get_key().unwrap() + let rt = tokio::runtime::Runtime::new().unwrap(); + + // Block on the async function to get the result + rt.block_on(icarus_envy::environment::get_secret_key()) } else { provided_key.to_owned() }; @@ -82,7 +79,8 @@ mod tests { #[test] fn test_tokenize() { - let special_key = get_key().unwrap(); + let rt = tokio::runtime::Runtime::new().unwrap(); + let special_key = rt.block_on(icarus_envy::environment::get_secret_key()); match create_token(&special_key) { Ok((token, _duration)) => { let result = verify_token(&special_key, &token); -- 2.43.0 From 480a428e8b07b5b9d0bf07d751be972f7fa5e125 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 1 Jun 2025 23:23:24 +0000 Subject: [PATCH 08/18] Including cargo.lock in source control (#40) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/40 Co-authored-by: phoenix Co-committed-by: phoenix --- .gitignore | 1 - Cargo.lock | 2527 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 2527 insertions(+), 1 deletion(-) create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index e551aa3..fedaa2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ /target -Cargo.lock .env diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..41ba7ca --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2527 @@ +# 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 = "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 = "anyhow" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" + +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash", +] + +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" +dependencies = [ + "axum-core", + "bytes", + "form_urlencoded", + "futures-util", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "axum-core" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68464cd0412f486726fb3373129ef5d2993f90c34bc2bc1c1e9943b2f4fc7ca6" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +dependencies = [ + "serde", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[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 = "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 = "cc" +version = "1.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "concurrent-queue" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[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 = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[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 = "der" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[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 = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +dependencies = [ + "serde", +] + +[[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.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + +[[package]] +name = "event-listener" +version = "5.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flume" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da0e4dd2a88388a1f4ccc7c9ce104604dab68d9f408dc34cd45823d5a9069095" +dependencies = [ + "futures-core", + "futures-sink", + "spin", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[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-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-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + +[[package]] +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[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-core", + "futures-io", + "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", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "hashbrown" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "hashlink" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7382cf6263419f2d8df38c55d7da83da5c18aef87fc7a7fc1fb1e344edfe14c1" +dependencies = [ + "hashbrown", +] + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[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 = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[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", + "http-body", + "pin-project-lite", +] + +[[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 = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" +dependencies = [ + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "icarus_auth" +version = "0.3.4" +dependencies = [ + "argon2", + "axum", + "http-body-util", + "hyper", + "icarus_envy", + "icarus_models", + "josekit", + "once_cell", + "rand 0.9.0", + "serde", + "serde_json", + "sqlx", + "time", + "tokio", + "tower", + "tracing-subscriber", + "url", + "uuid", +] + +[[package]] +name = "icarus_envy" +version = "0.2.0" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.2.0-devel-dbe4dc67cb-950#dbe4dc67cb1baa5ae5c5f2b452ff45d388c719ea" +dependencies = [ + "dotenvy", +] + +[[package]] +name = "icarus_models" +version = "0.4.3" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.4.3#6aa4c3d74142f5fceb4a6e95078bb3ae0a2d99c5" +dependencies = [ + "rand 0.9.0", + "serde", + "serde_json", + "time", + "uuid", +] + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" + +[[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.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" + +[[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 = "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", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "josekit" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe0633782b10949cf7d5aca9ec7c87ce642cbe4fff7d34602b2ec2e890ad56e5" +dependencies = [ + "anyhow", + "base64", + "flate2", + "openssl", + "regex", + "serde", + "serde_json", + "thiserror 1.0.69", + "time", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[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 = "libsqlite3-sys" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e99fb7a497b1e3339bc746195567ed8d3e24945ecd636e3619d20b9de9e9149" +dependencies = [ + "pkg-config", + "vcpkg", +] + +[[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.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" +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 = "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-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand 0.8.5", + "smallvec", + "zeroize", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", + "libm", +] + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "openssl" +version = "0.10.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" +dependencies = [ + "bitflags", + "cfg-if", + "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.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" + +[[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", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[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 = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[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", +] + +[[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 = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", + "zerocopy", +] + +[[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 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[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 = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +dependencies = [ + "bitflags", +] + +[[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", + "regex-syntax", +] + +[[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", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "rsa" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78928ac1ed176a5ca1d17e578a1825f3d81ca54cf41053a592584b020cfd691b" +dependencies = [ + "const-oid", + "digest", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core 0.6.4", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.59.0", +] + +[[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 = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags", + "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_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "indexmap", + "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_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", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[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 = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core 0.6.4", +] + +[[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" +dependencies = [ + "serde", +] + +[[package]] +name = "socket2" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlx" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4410e73b3c0d8442c5f99b425d7a435b5ee0ae4167b3196771dd3f7a01be745f" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a007b6936676aa9ab40207cde35daab0a04b823be8ae004368c0793b96a61e0" +dependencies = [ + "bytes", + "crc", + "crossbeam-queue", + "either", + "event-listener", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashbrown", + "hashlink", + "indexmap", + "log", + "memchr", + "native-tls", + "once_cell", + "percent-encoding", + "serde", + "serde_json", + "sha2", + "smallvec", + "thiserror 2.0.12", + "time", + "tokio", + "tokio-stream", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "sqlx-macros" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3112e2ad78643fef903618d78cf0aec1cb3134b019730edb039b69eaf531f310" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e9f90acc5ab146a99bf5061a7eb4976b573f560bc898ef3bf8435448dd5e7ad" +dependencies = [ + "dotenvy", + "either", + "heck", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4560278f0e00ce64938540546f59f590d60beee33fffbd3b9cd47851e5fff233" +dependencies = [ + "atoi", + "base64", + "bitflags", + "byteorder", + "bytes", + "crc", + "digest", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand 0.8.5", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 2.0.12", + "time", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5b98a57f363ed6764d5b3a12bfedf62f07aa16e1856a7ddc2a0bb190a959613" +dependencies = [ + "atoi", + "base64", + "bitflags", + "byteorder", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand 0.8.5", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror 2.0.12", + "time", + "tracing", + "uuid", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f85ca71d3a5b24e64e1d08dd8fe36c6c95c339a896cc33068148906784620540" +dependencies = [ + "atoi", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "serde_urlencoded", + "sqlx-core", + "time", + "tracing", + "url", + "uuid", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "stringprep" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4df3d392d81bd458a8a621b8bffbd2302a12ffe288a9d931670948749463b1" +dependencies = [ + "unicode-bidi", + "unicode-normalization", + "unicode-properties", +] + +[[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 = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[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 = "tempfile" +version = "3.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +dependencies = [ + "fastrand", + "getrandom 0.3.2", + "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", + "once_cell", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.44.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "pin-project-lite", + "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-stream" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[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", + "tokio", + "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 = [ + "nu-ansi-term", + "sharded-slab", + "smallvec", + "thread_local", + "tracing-core", + "tracing-log", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-bidi" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c1cb5db39152898a79168971543b1cb5020dff7fe43c8dc468b0885f5e29df5" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-normalization" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-properties" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" + +[[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", +] + +[[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 = "uuid" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +dependencies = [ + "getrandom 0.3.2", + "serde", +] + +[[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 = "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.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "whoami" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6994d13118ab492c3c80c1f81928718159254c53c472bf9ce36f8dae4add02a7" +dependencies = [ + "redox_syscall", + "wasite", +] + +[[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-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", + "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_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_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_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_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[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_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_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_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 = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags", +] + +[[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 = "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.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" +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", +] -- 2.43.0 From 8c902b9d61988ca554c46a5ea70b915837ba98c0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 1 Jun 2025 23:41:05 +0000 Subject: [PATCH 09/18] Version bump (#41) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/41 Co-authored-by: phoenix Co-committed-by: phoenix --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41ba7ca..eb14863 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -702,7 +702,7 @@ dependencies = [ [[package]] name = "icarus_auth" -version = "0.3.4" +version = "0.3.10" dependencies = [ "argon2", "axum", diff --git a/Cargo.toml b/Cargo.toml index 74088df..8b28de7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_auth" -version = "0.3.4" +version = "0.3.10" edition = "2024" rust-version = "1.86" -- 2.43.0 From 70de6b862fc2a3b38cb3cb73aaf7ac2a5e2d09f2 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 29 Jun 2025 20:03:41 +0000 Subject: [PATCH 10/18] rust std change (#42) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/42 Co-authored-by: phoenix Co-committed-by: phoenix --- .gitea/workflows/tag_release.yml | 4 ++-- .gitea/workflows/workflow.yml | 10 +++++----- Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitea/workflows/tag_release.yml b/.gitea/workflows/tag_release.yml index 9bcd646..1e8bf7c 100644 --- a/.gitea/workflows/tag_release.yml +++ b/.gitea/workflows/tag_release.yml @@ -17,7 +17,7 @@ jobs: - name: Install Rust uses: actions-rs/toolchain@v1 with: - toolchain: 1.86.0 + toolchain: 1.88.0 components: cargo - name: Extract Version from Cargo.toml @@ -50,4 +50,4 @@ jobs: body: | Release of version ${{ steps.version.outputs.project_tag_release }} # draft: false - # prerelease: ${{ startsWith(github.ref, 'v') == false }} # prerelease if not a valid release tag \ No newline at end of file + # prerelease: ${{ startsWith(github.ref, 'v') == false }} # prerelease if not a valid release tag diff --git a/.gitea/workflows/workflow.yml b/.gitea/workflows/workflow.yml index aa3fded..2720cea 100644 --- a/.gitea/workflows/workflow.yml +++ b/.gitea/workflows/workflow.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.86.0 + toolchain: 1.88.0 - run: | mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.86.0 + toolchain: 1.88.0 # --- Add this step for explicit verification --- - name: Verify Docker Environment run: | @@ -94,7 +94,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.86.0 + toolchain: 1.88.0 - run: rustup component add rustfmt - run: | mkdir -p ~/.ssh @@ -113,7 +113,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.86.0 + toolchain: 1.88.0 - run: rustup component add clippy - run: | mkdir -p ~/.ssh @@ -132,7 +132,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.86.0 + toolchain: 1.88.0 - run: | mkdir -p ~/.ssh echo "${{ secrets.MYREPO_TOKEN }}" > ~/.ssh/icarus_models_deploy_key diff --git a/Cargo.toml b/Cargo.toml index 8b28de7..0fc4ed8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "icarus_auth" version = "0.3.10" edition = "2024" -rust-version = "1.86" +rust-version = "1.88" [dependencies] axum = { version = "0.8.3" } -- 2.43.0 From bcd0e607ef69e27ed2c001a99bc54c7ec3acdc9e Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 29 Jun 2025 20:26:58 +0000 Subject: [PATCH 11/18] Update dependencies (#43) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/43 Co-authored-by: phoenix Co-committed-by: phoenix --- Cargo.lock | 197 +++++++++++++++++++++++++++++++++++++---------------- Cargo.toml | 24 +++---- 2 files changed, 152 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb14863..22b62c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,9 +67,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" +checksum = "021e862c184ae977658b36c4500f7feac3221ca5da43e3f25bd04ab6c79a29b5" dependencies = [ "axum-core", "bytes", @@ -173,6 +173,12 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + [[package]] name = "byteorder" version = "1.5.0" @@ -215,6 +221,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -712,7 +738,7 @@ dependencies = [ "icarus_models", "josekit", "once_cell", - "rand 0.9.0", + "rand 0.9.1", "serde", "serde_json", "sqlx", @@ -726,18 +752,19 @@ dependencies = [ [[package]] name = "icarus_envy" -version = "0.2.0" -source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.2.0-devel-dbe4dc67cb-950#dbe4dc67cb1baa5ae5c5f2b452ff45d388c719ea" +version = "0.3.0" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.3.0-devel-d73fba9899-006#d73fba9899372b0655a90cb426645930135152da" dependencies = [ + "const_format", "dotenvy", ] [[package]] name = "icarus_models" -version = "0.4.3" -source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.4.3#6aa4c3d74142f5fceb4a6e95078bb3ae0a2d99c5" +version = "0.5.0" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.0-devel-7958b89abc-111#7958b89abc56bc9262015b3e201ea2906cc8a9ff" dependencies = [ - "rand 0.9.0", + "rand 0.9.1", "serde", "serde_json", "time", @@ -901,9 +928,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "josekit" -version = "0.10.1" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0633782b10949cf7d5aca9ec7c87ce642cbe4fff7d34602b2ec2e890ad56e5" +checksum = "a808e078330e6af222eb0044b71d4b1ff981bfef43e7bc8133a88234e0c86a0c" dependencies = [ "anyhow", "base64", @@ -912,10 +939,20 @@ dependencies = [ "regex", "serde", "serde_json", - "thiserror 1.0.69", + "thiserror", "time", ] +[[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 = "lazy_static" version = "1.5.0" @@ -1314,13 +1351,12 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", - "zerocopy", ] [[package]] @@ -1639,9 +1675,9 @@ dependencies = [ [[package]] name = "sqlx" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4410e73b3c0d8442c5f99b425d7a435b5ee0ae4167b3196771dd3f7a01be745f" +checksum = "1fefb893899429669dcdd979aff487bd78f4064e5e7907e4269081e0ef7d97dc" dependencies = [ "sqlx-core", "sqlx-macros", @@ -1652,10 +1688,11 @@ dependencies = [ [[package]] name = "sqlx-core" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a007b6936676aa9ab40207cde35daab0a04b823be8ae004368c0793b96a61e0" +checksum = "ee6798b1838b6a0f69c007c133b8df5866302197e404e8b6ee8ed3e3a5e68dc6" dependencies = [ + "base64", "bytes", "crc", "crossbeam-queue", @@ -1677,7 +1714,7 @@ dependencies = [ "serde_json", "sha2", "smallvec", - "thiserror 2.0.12", + "thiserror", "time", "tokio", "tokio-stream", @@ -1688,9 +1725,9 @@ dependencies = [ [[package]] name = "sqlx-macros" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3112e2ad78643fef903618d78cf0aec1cb3134b019730edb039b69eaf531f310" +checksum = "a2d452988ccaacfbf5e0bdbc348fb91d7c8af5bee192173ac3636b5fb6e6715d" dependencies = [ "proc-macro2", "quote", @@ -1701,9 +1738,9 @@ dependencies = [ [[package]] name = "sqlx-macros-core" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9f90acc5ab146a99bf5061a7eb4976b573f560bc898ef3bf8435448dd5e7ad" +checksum = "19a9c1841124ac5a61741f96e1d9e2ec77424bf323962dd894bdb93f37d5219b" dependencies = [ "dotenvy", "either", @@ -1720,16 +1757,15 @@ dependencies = [ "sqlx-postgres", "sqlx-sqlite", "syn", - "tempfile", "tokio", "url", ] [[package]] name = "sqlx-mysql" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4560278f0e00ce64938540546f59f590d60beee33fffbd3b9cd47851e5fff233" +checksum = "aa003f0038df784eb8fecbbac13affe3da23b45194bd57dba231c8f48199c526" dependencies = [ "atoi", "base64", @@ -1762,7 +1798,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.12", + "thiserror", "time", "tracing", "uuid", @@ -1771,9 +1807,9 @@ dependencies = [ [[package]] name = "sqlx-postgres" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5b98a57f363ed6764d5b3a12bfedf62f07aa16e1856a7ddc2a0bb190a959613" +checksum = "db58fcd5a53cf07c184b154801ff91347e4c30d17a3562a635ff028ad5deda46" dependencies = [ "atoi", "base64", @@ -1801,7 +1837,7 @@ dependencies = [ "smallvec", "sqlx-core", "stringprep", - "thiserror 2.0.12", + "thiserror", "time", "tracing", "uuid", @@ -1810,9 +1846,9 @@ dependencies = [ [[package]] name = "sqlx-sqlite" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f85ca71d3a5b24e64e1d08dd8fe36c6c95c339a896cc33068148906784620540" +checksum = "c2d12fe70b2c1b4401038055f90f151b78208de1f9f89a7dbfd41587a10c3eea" dependencies = [ "atoi", "flume", @@ -1827,6 +1863,7 @@ dependencies = [ "serde", "serde_urlencoded", "sqlx-core", + "thiserror", "time", "tracing", "url", @@ -1897,33 +1934,13 @@ dependencies = [ "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", + "thiserror-impl", ] [[package]] @@ -2005,9 +2022,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.1" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", @@ -2160,6 +2177,12 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "url" version = "2.5.4" @@ -2185,12 +2208,14 @@ checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" [[package]] name = "uuid" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" +checksum = "3cf4199d1e5d15ddd86a694e4d0dffa9c323ce759fea589f00fef9d81cc1931d" dependencies = [ "getrandom 0.3.2", + "js-sys", "serde", + "wasm-bindgen", ] [[package]] @@ -2232,6 +2257,64 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "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-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 = "whoami" version = "1.6.0" diff --git a/Cargo.toml b/Cargo.toml index 0fc4ed8..bff6925 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,23 +5,23 @@ edition = "2024" rust-version = "1.88" [dependencies] -axum = { version = "0.8.3" } -serde = { version = "1.0.218", features = ["derive"] } -serde_json = { version = "1.0.139" } -tokio = { version = "1.44.1", features = ["rt-multi-thread"] } +axum = { version = "0.8.4" } +serde = { version = "1.0.219", features = ["derive"] } +serde_json = { version = "1.0.140" } +tokio = { version = "1.45.1", features = ["rt-multi-thread"] } tracing-subscriber = { version = "0.3.19" } tower = { version = "0.5.2" } hyper = { version = "1.6.0" } -sqlx = { version = "0.8.3", features = ["postgres", "runtime-tokio-native-tls", "time", "uuid"] } -uuid = { version = "1.16.0", features = ["v4", "serde"] } +sqlx = { version = "0.8.6", features = ["postgres", "runtime-tokio-native-tls", "time", "uuid"] } +uuid = { version = "1.17.0", features = ["v4", "serde"] } argon2 = { version = "0.5.3", features = ["std"] } # Use the latest 0.5.x version -rand = { version = "0.9" } +rand = { version = "0.9.1" } time = { version = "0.3.41", features = ["macros", "serde"] } -josekit = { version = "0.10.1" } -icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.4.3" } -icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.2.0-devel-dbe4dc67cb-950" } +josekit = { version = "0.10.3" } +icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.0-devel-7958b89abc-111" } +icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.0-devel-d73fba9899-006" } [dev-dependencies] http-body-util = { version = "0.1.3" } -url = { version = "2.5" } -once_cell = { version = "1.19" } # Useful for lazy initialization in tests/app setup +url = { version = "2.5.4" } +once_cell = { version = "1.21.3" } # Useful for lazy initialization in tests/app setup -- 2.43.0 From c8b8d470dce9c5e1a2f86a13875c53df0de8ac28 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 29 Jun 2025 20:39:04 +0000 Subject: [PATCH 12/18] Refactoring (#44) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/44 Co-authored-by: phoenix Co-committed-by: phoenix --- .gitignore | 2 ++ src/lib.rs | 2 +- src/repo/mod.rs | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index fedaa2b..c2a0c1e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /target .env +.env.local +.env.docker diff --git a/src/lib.rs b/src/lib.rs index ada99d7..fdc78b0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,7 @@ pub mod db { pub async fn create_pool() -> Result { let database_url = icarus_envy::environment::get_db_url().await; - println!("Database url: {:?}", database_url); + println!("Database url: {database_url}"); PgPoolOptions::new() .max_connections(connection_settings::MAXCONN) diff --git a/src/repo/mod.rs b/src/repo/mod.rs index a58bab5..52e9e3c 100644 --- a/src/repo/mod.rs +++ b/src/repo/mod.rs @@ -57,7 +57,7 @@ pub mod user { .fetch_optional(pool) .await .map_err(|e| { - eprintln!("Error updating time: {}", e); + eprintln!("Error updating time: {e}"); e }); @@ -113,7 +113,7 @@ pub mod user { .fetch_one(pool) .await .map_err(|e| { - eprintln!("Error inserting item: {}", e); + eprintln!("Error inserting item: {e}"); e })?; @@ -180,7 +180,7 @@ pub mod salt { .fetch_one(pool) .await .map_err(|e| { - eprintln!("Error inserting item: {}", e); + eprintln!("Error inserting item: {e}"); e })?; -- 2.43.0 From c176d0fcf3da1325f1a048c2f9277cf88ff677d1 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 29 Jun 2025 20:50:55 +0000 Subject: [PATCH 13/18] Version bump (#45) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/45 Co-authored-by: phoenix Co-committed-by: phoenix --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 22b62c2..e5750d4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,7 +728,7 @@ dependencies = [ [[package]] name = "icarus_auth" -version = "0.3.10" +version = "0.4.0" dependencies = [ "argon2", "axum", diff --git a/Cargo.toml b/Cargo.toml index bff6925..730d787 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_auth" -version = "0.3.10" +version = "0.4.0" edition = "2024" rust-version = "1.88" -- 2.43.0 From 4353414c695fc5563d8ac84253771144ca0daef8 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sat, 12 Jul 2025 19:32:56 +0000 Subject: [PATCH 14/18] Upgrade postgresql (#47) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/47 Closes #46 Co-authored-by: phoenix Co-committed-by: phoenix --- .gitea/workflows/tag_release.yml | 2 -- .gitea/workflows/workflow.yml | 2 +- docker-compose.yaml | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/tag_release.yml b/.gitea/workflows/tag_release.yml index 1e8bf7c..d1539ef 100644 --- a/.gitea/workflows/tag_release.yml +++ b/.gitea/workflows/tag_release.yml @@ -49,5 +49,3 @@ jobs: release_name: Release ${{ steps.version.outputs.project_tag_release }} body: | Release of version ${{ steps.version.outputs.project_tag_release }} - # draft: false - # prerelease: ${{ startsWith(github.ref, 'v') == false }} # prerelease if not a valid release tag diff --git a/.gitea/workflows/workflow.yml b/.gitea/workflows/workflow.yml index 2720cea..c679baa 100644 --- a/.gitea/workflows/workflow.yml +++ b/.gitea/workflows/workflow.yml @@ -36,7 +36,7 @@ jobs: # --- Add database service definition --- services: postgres: - image: postgres:17.4 # Or pin to a more specific version like 14.9 + image: postgres:17.5 env: # Use secrets for DB init, with fallbacks for flexibility POSTGRES_USER: ${{ secrets.DB_TEST_USER || 'testuser' }} diff --git a/docker-compose.yaml b/docker-compose.yaml index c87e8d9..c6c0140 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -19,7 +19,7 @@ services: # PostgreSQL Database Service auth_db: - image: postgres:17.4-alpine # Use an official Postgres image (Alpine variant is smaller) + image: postgres:17.5-alpine # Use an official Postgres image (Alpine variant is smaller) container_name: icarus_auth_db # Optional: Give the container a specific name environment: # These MUST match the user, password, and database name in the DATABASE_URL above -- 2.43.0 From be4d1109a711488f6f09f57abff0f18d375fac76 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 13 Jul 2025 23:01:16 +0000 Subject: [PATCH 15/18] Update rust in docker (#48) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/48 Co-authored-by: phoenix Co-committed-by: phoenix --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c1b1081..d6aab7f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # Stage 1: Build the application # Use a specific Rust version for reproducibility. Choose one that matches your development environment. # Using slim variant for smaller base image -FROM rust:1.86 as builder +FROM rust:1.88 as builder # Set the working directory inside the container WORKDIR /usr/src/app @@ -68,4 +68,4 @@ EXPOSE 3000 # Set the command to run your application # Ensure this matches the binary name copied above -CMD ["./icarus_auth"] \ No newline at end of file +CMD ["./icarus_auth"] -- 2.43.0 From 5967ed5b13886ea3c46f519cf9a6b8306a22d7f0 Mon Sep 17 00:00:00 2001 From: phoenix Date: Fri, 1 Aug 2025 20:49:15 +0000 Subject: [PATCH 16/18] minor refactoring (#52) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/52 Co-authored-by: phoenix Co-committed-by: phoenix --- Cargo.lock | 7 +++--- Cargo.toml | 4 ++-- src/callers/login.rs | 2 +- src/token_stuff/mod.rs | 51 +++++++----------------------------------- 4 files changed, 15 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e5750d4..9370a38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,7 +728,7 @@ dependencies = [ [[package]] name = "icarus_auth" -version = "0.4.0" +version = "0.4.1" dependencies = [ "argon2", "axum", @@ -761,9 +761,10 @@ dependencies = [ [[package]] name = "icarus_models" -version = "0.5.0" -source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.0-devel-7958b89abc-111#7958b89abc56bc9262015b3e201ea2906cc8a9ff" +version = "0.5.4" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.4-devel-1e95822b5a-111#1e95822b5a349bd73cc501d921052f289105ec55" dependencies = [ + "josekit", "rand 0.9.1", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 730d787..71caf6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_auth" -version = "0.4.0" +version = "0.4.1" edition = "2024" rust-version = "1.88" @@ -18,7 +18,7 @@ argon2 = { version = "0.5.3", features = ["std"] } # Use the latest 0.5.x versio rand = { version = "0.9.1" } time = { version = "0.3.41", features = ["macros", "serde"] } josekit = { version = "0.10.3" } -icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.0-devel-7958b89abc-111" } +icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.4-devel-1e95822b5a-111" } icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.0-devel-d73fba9899-006" } [dev-dependencies] diff --git a/src/callers/login.rs b/src/callers/login.rs index 7c391e4..9476df5 100644 --- a/src/callers/login.rs +++ b/src/callers/login.rs @@ -62,7 +62,7 @@ pub mod endpoint { id: user.id, username: user.username.clone(), token: token_literal, - token_type: String::from(token_stuff::TOKENTYPE), + token_type: String::from(icarus_models::token::TOKEN_TYPE), expiration: duration, }], }), diff --git a/src/token_stuff/mod.rs b/src/token_stuff/mod.rs index 44b3117..ea2f412 100644 --- a/src/token_stuff/mod.rs +++ b/src/token_stuff/mod.rs @@ -1,12 +1,11 @@ use josekit::{ self, - jws::{JwsHeader, alg::hmac::HmacJwsAlgorithm::Hs256}, - jwt::{self, JwtPayload}, + jws::alg::hmac::HmacJwsAlgorithm::Hs256, + jwt::{self}, }; use time; -pub const TOKENTYPE: &str = "JWT"; pub const KEY_ENV: &str = "SECRET_KEY"; pub const MESSAGE: &str = "Something random"; pub const ISSUER: &str = "icarus_auth"; @@ -21,46 +20,13 @@ pub fn get_expiration(issued: &time::OffsetDateTime) -> Result Result { - let converted = std::time::SystemTime::from(*provided_time); - Ok(converted) - } -} - pub fn create_token(provided_key: &String) -> Result<(String, i64), josekit::JoseError> { - let mut header = JwsHeader::new(); - header.set_token_type(TOKENTYPE); - - let mut payload = JwtPayload::new(); - payload.set_subject(MESSAGE); - payload.set_issuer(ISSUER); - payload.set_audience(vec![AUDIENCE]); - match get_issued() { - Ok(issued) => { - let expire = get_expiration(&issued).unwrap(); - payload.set_issued_at(&util::time_to_std_time(&issued).unwrap()); - payload.set_expires_at(&util::time_to_std_time(&expire).unwrap()); - - let key: String = if provided_key.is_empty() { - let rt = tokio::runtime::Runtime::new().unwrap(); - - // Block on the async function to get the result - rt.block_on(icarus_envy::environment::get_secret_key()) - } else { - provided_key.to_owned() - }; - - let signer = Hs256.signer_from_bytes(key.as_bytes()).unwrap(); - Ok(( - josekit::jwt::encode_with_signer(&payload, &header, &signer).unwrap(), - (expire - time::OffsetDateTime::UNIX_EPOCH).whole_seconds(), - )) - } - Err(e) => Err(josekit::JoseError::InvalidClaim(e.into())), - } + let resource = icarus_models::token::TokenResource { + message: String::from(MESSAGE), + issuer: String::from(ISSUER), + audiences: vec![String::from(AUDIENCE)], + }; + icarus_models::token::create_token(provided_key, &resource, time::Duration::hours(4)) } pub fn verify_token(key: &String, token: &String) -> bool { @@ -74,7 +40,6 @@ pub fn verify_token(key: &String, token: &String) -> bool { #[cfg(test)] mod tests { - use super::*; #[test] -- 2.43.0 From 99390ce8b76a63f4928b05852a9697397a9f5766 Mon Sep 17 00:00:00 2001 From: phoenix Date: Sun, 3 Aug 2025 23:09:50 +0000 Subject: [PATCH 17/18] tsk-50: Create Special endpoint for services to obtain a token (#53) Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/53 Co-authored-by: phoenix Co-committed-by: phoenix --- .env.docker.sample | 1 + .env.sample | 1 + Cargo.lock | 6 +- Cargo.toml | 4 +- migrations/20250402221858_init_migrate.sql | 6 ++ migrations/20250802185652_passphrase_data.sql | 2 + src/callers/login.rs | 53 +++++++++ src/callers/mod.rs | 1 + src/main.rs | 102 ++++++++++++++---- src/repo/mod.rs | 29 +++++ src/token_stuff/mod.rs | 9 ++ 11 files changed, 186 insertions(+), 28 deletions(-) create mode 100644 migrations/20250802185652_passphrase_data.sql diff --git a/.env.docker.sample b/.env.docker.sample index 5c0ad33..ffde663 100644 --- a/.env.docker.sample +++ b/.env.docker.sample @@ -1,4 +1,5 @@ SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h +SERVICE_PASSPHRASE=iUOo1fxshf3y1tUGn1yU8l9raPApHCdinW0VdCHdRFEjqhR3Bf02aZzsKbLtaDFH POSTGRES_AUTH_USER=icarus_op POSTGRES_AUTH_PASSWORD=password POSTGRES_AUTH_DB=icarus_auth_db diff --git a/.env.sample b/.env.sample index b556c08..c00c477 100644 --- a/.env.sample +++ b/.env.sample @@ -1,4 +1,5 @@ SECRET_KEY=refero34o8rfhfjn983thf39fhc943rf923n3h +SERVICE_PASSPHRASE=iUOo1fxshf3y1tUGn1yU8l9raPApHCdinW0VdCHdRFEjqhR3Bf02aZzsKbLtaDFH POSTGRES_AUTH_USER=icarus_op_test POSTGRES_AUTH_PASSWORD=password POSTGRES_AUTH_DB=icarus_auth_test_db diff --git a/Cargo.lock b/Cargo.lock index 9370a38..ba72c60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,7 +728,7 @@ dependencies = [ [[package]] name = "icarus_auth" -version = "0.4.1" +version = "0.4.2" dependencies = [ "argon2", "axum", @@ -752,8 +752,8 @@ dependencies = [ [[package]] name = "icarus_envy" -version = "0.3.0" -source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.3.0-devel-d73fba9899-006#d73fba9899372b0655a90cb426645930135152da" +version = "0.3.1" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_envy.git?tag=v0.3.1-main-3cd42dab6b-006#3cd42dab6b2503609883f5f57ad3508755c34a2e" dependencies = [ "const_format", "dotenvy", diff --git a/Cargo.toml b/Cargo.toml index 71caf6d..caa4c42 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_auth" -version = "0.4.1" +version = "0.4.2" edition = "2024" rust-version = "1.88" @@ -19,7 +19,7 @@ rand = { version = "0.9.1" } time = { version = "0.3.41", features = ["macros", "serde"] } josekit = { version = "0.10.3" } icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.4-devel-1e95822b5a-111" } -icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.0-devel-d73fba9899-006" } +icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.1-main-3cd42dab6b-006" } [dev-dependencies] http-body-util = { version = "0.1.3" } diff --git a/migrations/20250402221858_init_migrate.sql b/migrations/20250402221858_init_migrate.sql index 8fe068c..0ad2121 100644 --- a/migrations/20250402221858_init_migrate.sql +++ b/migrations/20250402221858_init_migrate.sql @@ -20,3 +20,9 @@ CREATE TABLE IF NOT EXISTS "salt" ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), salt TEXT NOT NULL ); + +CREATE TABLE IF NOT EXISTS "passphrase" ( + id UUID PRIMARY KEY DEFAULT gen_random_uuid(), + passphrase TEXT NOT NULL, + date_created TIMESTAMPTZ NOT NULL DEFAULT NOW() +); diff --git a/migrations/20250802185652_passphrase_data.sql b/migrations/20250802185652_passphrase_data.sql new file mode 100644 index 0000000..e18d2a1 --- /dev/null +++ b/migrations/20250802185652_passphrase_data.sql @@ -0,0 +1,2 @@ +-- Add migration script here +INSERT INTO "passphrase" (passphrase) VALUES('iUOo1fxshf3y1tUGn1yU8l9raPApHCdinW0VdCHdRFEjqhR3Bf02aZzsKbLtaDFH'); diff --git a/src/callers/login.rs b/src/callers/login.rs index 9476df5..6d5fd20 100644 --- a/src/callers/login.rs +++ b/src/callers/login.rs @@ -6,6 +6,13 @@ pub mod request { pub username: String, pub password: String, } + + pub mod service_login { + #[derive(Debug, serde::Deserialize, serde::Serialize)] + pub struct Request { + pub passphrase: String, + } + } } pub mod response { @@ -16,6 +23,14 @@ pub mod response { pub message: String, pub data: Vec, } + + pub mod service_login { + #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + pub struct Response { + pub message: String, + pub data: Vec, + } + } } pub mod endpoint { @@ -79,4 +94,42 @@ pub mod endpoint { } } } + + pub async fn service_login( + axum::Extension(pool): axum::Extension, + axum::Json(payload): axum::Json, + ) -> ( + axum::http::StatusCode, + axum::Json, + ) { + let mut response = response::service_login::Response::default(); + + match repo::service::valid_passphrase(&pool, &payload.passphrase).await { + Ok((id, _passphrase, _date_created)) => { + let key = icarus_envy::environment::get_secret_key().await; + let (token_literal, duration) = token_stuff::create_service_token(&key).unwrap(); + + if token_stuff::verify_token(&key, &token_literal) { + let login_result = icarus_models::login_result::LoginResult { + id, + username: String::from("service"), + token: token_literal, + token_type: String::from(icarus_models::token::TOKEN_TYPE), + expiration: duration, + }; + + response.data.push(login_result); + response.message = String::from("Successful"); + + (axum::http::StatusCode::OK, axum::Json(response)) + } else { + (axum::http::StatusCode::OK, axum::Json(response)) + } + } + Err(err) => { + response.message = err.to_string(); + (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) + } + } + } } diff --git a/src/callers/mod.rs b/src/callers/mod.rs index ab9f31e..4fdaf82 100644 --- a/src/callers/mod.rs +++ b/src/callers/mod.rs @@ -7,4 +7,5 @@ pub mod endpoints { pub const REGISTER: &str = "/api/v2/register"; pub const DBTEST: &str = "/api/v2/test/db"; pub const LOGIN: &str = "/api/v2/login"; + pub const SERVICE_LOGIN: &str = "/api/v2/service/login"; } diff --git a/src/main.rs b/src/main.rs index f12ff7c..5d8a4ab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -41,6 +41,10 @@ mod init { callers::endpoints::LOGIN, post(callers::login::endpoint::login), ) + .route( + callers::endpoints::SERVICE_LOGIN, + post(callers::login::endpoint::service_login), + ) } pub async fn app() -> Router { @@ -154,6 +158,25 @@ mod tests { }) } + pub mod requests { + use tower::ServiceExt; // for `call`, `oneshot`, and `ready` + + pub async fn register( + app: &axum::Router, + usr: &icarus_auth::callers::register::request::Request, + ) -> Result { + let payload = super::get_test_register_payload(&usr); + let req = axum::http::Request::builder() + .method(axum::http::Method::POST) + .uri(crate::callers::endpoints::REGISTER) + .header(axum::http::header::CONTENT_TYPE, "application/json") + .body(axum::body::Body::from(payload.to_string())) + .unwrap(); + + app.clone().oneshot(req).await + } + } + #[tokio::test] async fn test_hello_world() { let app = init::app().await; @@ -198,18 +221,8 @@ mod tests { let app = init::routes().await.layer(axum::Extension(pool)); let usr = get_test_register_request(); - let payload = get_test_register_payload(&usr); - let response = app - .oneshot( - Request::builder() - .method(axum::http::Method::POST) - .uri(callers::endpoints::REGISTER) - .header(axum::http::header::CONTENT_TYPE, "application/json") - .body(Body::from(payload.to_string())) - .unwrap(), - ) - .await; + let response = requests::register(&app, &usr).await; match response { Ok(resp) => { @@ -265,19 +278,8 @@ mod tests { let app = init::routes().await.layer(axum::Extension(pool)); let usr = get_test_register_request(); - let payload = get_test_register_payload(&usr); - let response = app - .clone() - .oneshot( - Request::builder() - .method(axum::http::Method::POST) - .uri(callers::endpoints::REGISTER) - .header(axum::http::header::CONTENT_TYPE, "application/json") - .body(Body::from(payload.to_string())) - .unwrap(), - ) - .await; + let response = requests::register(&app, &usr).await; match response { Ok(resp) => { @@ -341,4 +343,58 @@ mod tests { let _ = db_mgr::drop_database(&tm_pool, &db_name).await; } + + #[tokio::test] + async fn test_service_login_user() { + let tm_pool = db_mgr::get_pool().await.unwrap(); + + let db_name = db_mgr::generate_db_name().await; + + match db_mgr::create_database(&tm_pool, &db_name).await { + Ok(_) => { + println!("Success"); + } + Err(e) => { + assert!(false, "Error: {:?}", e.to_string()); + } + } + + let pool = db_mgr::connect_to_db(&db_name).await.unwrap(); + + icarus_auth::db::migrations(&pool).await; + + let app = init::routes().await.layer(axum::Extension(pool)); + let passphrase = + String::from("iUOo1fxshf3y1tUGn1yU8l9raPApHCdinW0VdCHdRFEjqhR3Bf02aZzsKbLtaDFH"); + let payload = serde_json::json!({ + "passphrase": passphrase + }); + + match app + .oneshot( + Request::builder() + .method(axum::http::Method::POST) + .uri(callers::endpoints::SERVICE_LOGIN) + .header(axum::http::header::CONTENT_TYPE, "application/json") + .body(Body::from(payload.to_string())) + .unwrap(), + ) + .await + { + Ok(response) => { + assert_eq!(StatusCode::OK, response.status(), "Status is not right"); + let body = axum::body::to_bytes(response.into_body(), usize::MAX) + .await + .unwrap(); + let parsed_body: callers::login::response::service_login::Response = + serde_json::from_slice(&body).unwrap(); + let _login_result = &parsed_body.data[0]; + } + Err(err) => { + assert!(false, "Error: {err:?}"); + } + } + + let _ = db_mgr::drop_database(&tm_pool, &db_name).await; + } } diff --git a/src/repo/mod.rs b/src/repo/mod.rs index 52e9e3c..db62bb4 100644 --- a/src/repo/mod.rs +++ b/src/repo/mod.rs @@ -195,3 +195,32 @@ pub mod salt { } } } + +pub mod service { + use sqlx::Row; + + pub async fn valid_passphrase( + pool: &sqlx::PgPool, + passphrase: &String, + ) -> Result<(uuid::Uuid, String, time::OffsetDateTime), sqlx::Error> { + let result = sqlx::query( + r#" + SELECT * FROM "passphrase" WHERE passphrase = $1 + "#, + ) + .bind(passphrase) + .fetch_one(pool) + .await; + + match result { + Ok(row) => { + let id: uuid::Uuid = row.try_get("id")?; + let passphrase: String = row.try_get("passphrase")?; + let date_created: Option = row.try_get("date_created")?; + + Ok((id, passphrase, date_created.unwrap())) + } + Err(err) => Err(err), + } + } +} diff --git a/src/token_stuff/mod.rs b/src/token_stuff/mod.rs index ea2f412..241216a 100644 --- a/src/token_stuff/mod.rs +++ b/src/token_stuff/mod.rs @@ -29,6 +29,15 @@ pub fn create_token(provided_key: &String) -> Result<(String, i64), josekit::Jos icarus_models::token::create_token(provided_key, &resource, time::Duration::hours(4)) } +pub fn create_service_token(provided: &String) -> Result<(String, i64), josekit::JoseError> { + let resource = icarus_models::token::TokenResource { + message: String::from("Service random"), + issuer: String::from(ISSUER), + audiences: vec![String::from(AUDIENCE)], + }; + icarus_models::token::create_token(provided, &resource, time::Duration::hours(1)) +} + pub fn verify_token(key: &String, token: &String) -> bool { let ver = Hs256.verifier_from_bytes(key.as_bytes()).unwrap(); let (payload, _header) = jwt::decode_with_verifier(token, &ver).unwrap(); -- 2.43.0 From eb1e2990f9327f57e59304ff1d3bb290c25dbbdb Mon Sep 17 00:00:00 2001 From: phoenix Date: Mon, 11 Aug 2025 22:15:17 +0000 Subject: [PATCH 18/18] tsk-51: Refresh token endpoint (#54) Closes #51 Reviewed-on: https://git.kundeng.us/phoenix/icarus_auth/pulls/54 Co-authored-by: phoenix Co-committed-by: phoenix --- Cargo.lock | 6 +- Cargo.toml | 4 +- migrations/20250802185652_passphrase_data.sql | 2 +- src/callers/login.rs | 94 ++++++++++++++++++- src/callers/mod.rs | 1 + src/main.rs | 71 ++++++++++++++ src/repo/mod.rs | 24 +++++ src/token_stuff/mod.rs | 89 ++++++++++++++++-- 8 files changed, 273 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba72c60..c5b54f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -728,7 +728,7 @@ dependencies = [ [[package]] name = "icarus_auth" -version = "0.4.2" +version = "0.4.3" dependencies = [ "argon2", "axum", @@ -761,8 +761,8 @@ dependencies = [ [[package]] name = "icarus_models" -version = "0.5.4" -source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.4-devel-1e95822b5a-111#1e95822b5a349bd73cc501d921052f289105ec55" +version = "0.5.5" +source = "git+ssh://git@git.kundeng.us/phoenix/icarus_models.git?tag=v0.5.5-devel-bd793db08e-111#bd793db08e06b256ffecd9f4528e55e3026fede7" dependencies = [ "josekit", "rand 0.9.1", diff --git a/Cargo.toml b/Cargo.toml index caa4c42..8d25e4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icarus_auth" -version = "0.4.2" +version = "0.4.3" edition = "2024" rust-version = "1.88" @@ -18,7 +18,7 @@ argon2 = { version = "0.5.3", features = ["std"] } # Use the latest 0.5.x versio rand = { version = "0.9.1" } time = { version = "0.3.41", features = ["macros", "serde"] } josekit = { version = "0.10.3" } -icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.4-devel-1e95822b5a-111" } +icarus_models = { git = "ssh://git@git.kundeng.us/phoenix/icarus_models.git", tag = "v0.5.5-devel-bd793db08e-111" } icarus_envy = { git = "ssh://git@git.kundeng.us/phoenix/icarus_envy.git", tag = "v0.3.1-main-3cd42dab6b-006" } [dev-dependencies] diff --git a/migrations/20250802185652_passphrase_data.sql b/migrations/20250802185652_passphrase_data.sql index e18d2a1..c1edf34 100644 --- a/migrations/20250802185652_passphrase_data.sql +++ b/migrations/20250802185652_passphrase_data.sql @@ -1,2 +1,2 @@ -- Add migration script here -INSERT INTO "passphrase" (passphrase) VALUES('iUOo1fxshf3y1tUGn1yU8l9raPApHCdinW0VdCHdRFEjqhR3Bf02aZzsKbLtaDFH'); +INSERT INTO "passphrase" (id, passphrase) VALUES('22f9c775-cce9-457a-a147-9dafbb801f61', 'iUOo1fxshf3y1tUGn1yU8l9raPApHCdinW0VdCHdRFEjqhR3Bf02aZzsKbLtaDFH'); diff --git a/src/callers/login.rs b/src/callers/login.rs index 6d5fd20..fb065e5 100644 --- a/src/callers/login.rs +++ b/src/callers/login.rs @@ -13,6 +13,13 @@ pub mod request { pub passphrase: String, } } + + pub mod refresh_token { + #[derive(Debug, serde::Deserialize, serde::Serialize)] + pub struct Request { + pub access_token: String, + } + } } pub mod response { @@ -31,6 +38,14 @@ pub mod response { pub data: Vec, } } + + pub mod refresh_token { + #[derive(Debug, Default, serde::Deserialize, serde::Serialize)] + pub struct Response { + pub message: String, + pub data: Vec, + } + } } pub mod endpoint { @@ -43,6 +58,10 @@ pub mod endpoint { use super::request; use super::response; + // TODO: At some point, get the username from the DB + // Name of service username when returning a login result + pub const SERVICE_USERNAME: &str = "service"; + async fn not_found(message: &str) -> (StatusCode, Json) { ( StatusCode::NOT_FOUND, @@ -63,7 +82,8 @@ pub mod endpoint { if hashing::verify_password(&payload.password, user.password.clone()).unwrap() { // Create token let key = icarus_envy::environment::get_secret_key().await; - let (token_literal, duration) = token_stuff::create_token(&key).unwrap(); + let (token_literal, duration) = + token_stuff::create_token(&key, &user.id).unwrap(); if token_stuff::verify_token(&key, &token_literal) { let current_time = time::OffsetDateTime::now_utc(); @@ -107,12 +127,13 @@ pub mod endpoint { match repo::service::valid_passphrase(&pool, &payload.passphrase).await { Ok((id, _passphrase, _date_created)) => { let key = icarus_envy::environment::get_secret_key().await; - let (token_literal, duration) = token_stuff::create_service_token(&key).unwrap(); + let (token_literal, duration) = + token_stuff::create_service_token(&key, &id).unwrap(); if token_stuff::verify_token(&key, &token_literal) { let login_result = icarus_models::login_result::LoginResult { id, - username: String::from("service"), + username: String::from(SERVICE_USERNAME), token: token_literal, token_type: String::from(icarus_models::token::TOKEN_TYPE), expiration: duration, @@ -132,4 +153,71 @@ pub mod endpoint { } } } + + pub async fn refresh_token( + axum::Extension(pool): axum::Extension, + axum::Json(payload): axum::Json, + ) -> ( + axum::http::StatusCode, + axum::Json, + ) { + let mut response = response::refresh_token::Response::default(); + let key = icarus_envy::environment::get_secret_key().await; + + if token_stuff::verify_token(&key, &payload.access_token) { + let token_type = token_stuff::get_token_type(&key, &payload.access_token).unwrap(); + + if token_stuff::is_token_type_valid(&token_type) { + // Get passphrase record with id + match token_stuff::extract_id_from_token(&key, &payload.access_token) { + Ok(id) => match repo::service::get_passphrase(&pool, &id).await { + Ok((returned_id, _, _)) => { + match token_stuff::create_service_refresh_token(&key, &returned_id) { + Ok((access_token, exp_dur)) => { + let login_result = icarus_models::login_result::LoginResult { + id: returned_id, + token: access_token, + expiration: exp_dur, + token_type: String::from(icarus_models::token::TOKEN_TYPE), + username: String::from(SERVICE_USERNAME), + }; + response.message = String::from("Successful"); + response.data.push(login_result); + + (axum::http::StatusCode::OK, axum::Json(response)) + } + Err(err) => { + response.message = err.to_string(); + ( + axum::http::StatusCode::INTERNAL_SERVER_ERROR, + axum::Json(response), + ) + } + } + } + Err(err) => { + response.message = err.to_string(); + ( + axum::http::StatusCode::INTERNAL_SERVER_ERROR, + axum::Json(response), + ) + } + }, + Err(err) => { + response.message = err.to_string(); + ( + axum::http::StatusCode::INTERNAL_SERVER_ERROR, + axum::Json(response), + ) + } + } + } else { + response.message = String::from("Invalid token type"); + (axum::http::StatusCode::NOT_FOUND, axum::Json(response)) + } + } else { + response.message = String::from("Could not verify token"); + (axum::http::StatusCode::BAD_REQUEST, axum::Json(response)) + } + } } diff --git a/src/callers/mod.rs b/src/callers/mod.rs index 4fdaf82..f280a4f 100644 --- a/src/callers/mod.rs +++ b/src/callers/mod.rs @@ -8,4 +8,5 @@ pub mod endpoints { pub const DBTEST: &str = "/api/v2/test/db"; pub const LOGIN: &str = "/api/v2/login"; pub const SERVICE_LOGIN: &str = "/api/v2/service/login"; + pub const REFRESH_TOKEN: &str = "/api/v2/token/refresh"; } diff --git a/src/main.rs b/src/main.rs index 5d8a4ab..e052521 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,6 +45,10 @@ mod init { callers::endpoints::SERVICE_LOGIN, post(callers::login::endpoint::service_login), ) + .route( + callers::endpoints::REFRESH_TOKEN, + post(callers::login::endpoint::refresh_token), + ) } pub async fn app() -> Router { @@ -397,4 +401,71 @@ mod tests { let _ = db_mgr::drop_database(&tm_pool, &db_name).await; } + + #[tokio::test] + async fn test_refresh_token() { + let tm_pool = db_mgr::get_pool().await.unwrap(); + + let db_name = db_mgr::generate_db_name().await; + + match db_mgr::create_database(&tm_pool, &db_name).await { + Ok(_) => { + println!("Success"); + } + Err(e) => { + assert!(false, "Error: {:?}", e.to_string()); + } + } + + let pool = db_mgr::connect_to_db(&db_name).await.unwrap(); + + icarus_auth::db::migrations(&pool).await; + + let app = init::routes().await.layer(axum::Extension(pool)); + let id = uuid::Uuid::parse_str("22f9c775-cce9-457a-a147-9dafbb801f61").unwrap(); + let key = icarus_envy::environment::get_secret_key().await; + + match icarus_auth::token_stuff::create_service_token(&key, &id) { + Ok((token, _expire)) => { + let payload = serde_json::json!({ + "access_token": token + }); + + match app + .oneshot( + Request::builder() + .method(axum::http::Method::POST) + .uri(callers::endpoints::REFRESH_TOKEN) + .header(axum::http::header::CONTENT_TYPE, "application/json") + .body(Body::from(payload.to_string())) + .unwrap(), + ) + .await + { + Ok(response) => { + let body = axum::body::to_bytes(response.into_body(), usize::MAX) + .await + .unwrap(); + let parsed_body: callers::login::response::service_login::Response = + serde_json::from_slice(&body).unwrap(); + let login_result = &parsed_body.data[0]; + + assert_eq!( + id, login_result.id, + "The Id from the response does not match {id:?} {:?}", + login_result.id + ); + } + Err(err) => { + assert!(false, "Error: {err:?}"); + } + } + } + Err(err) => { + assert!(false, "Error: {err:?}"); + } + } + + let _ = db_mgr::drop_database(&tm_pool, &db_name).await; + } } diff --git a/src/repo/mod.rs b/src/repo/mod.rs index db62bb4..037ee0f 100644 --- a/src/repo/mod.rs +++ b/src/repo/mod.rs @@ -223,4 +223,28 @@ pub mod service { Err(err) => Err(err), } } + + pub async fn get_passphrase( + pool: &sqlx::PgPool, + id: &uuid::Uuid, + ) -> Result<(uuid::Uuid, String, time::OffsetDateTime), sqlx::Error> { + let result = sqlx::query( + r#" + SELECT * FROM "passphrase" WHERE id = $1; + "#, + ) + .bind(id) + .fetch_one(pool) + .await; + + match result { + Ok(row) => { + let returned_id: uuid::Uuid = row.try_get("id")?; + let passphrase: String = row.try_get("passphrase")?; + let date_created: time::OffsetDateTime = row.try_get("date_created")?; + Ok((returned_id, passphrase, date_created)) + } + Err(err) => Err(err), + } + } } diff --git a/src/token_stuff/mod.rs b/src/token_stuff/mod.rs index 241216a..64e4429 100644 --- a/src/token_stuff/mod.rs +++ b/src/token_stuff/mod.rs @@ -20,33 +20,103 @@ pub fn get_expiration(issued: &time::OffsetDateTime) -> Result Result<(String, i64), josekit::JoseError> { +pub fn create_token( + provided_key: &String, + id: &uuid::Uuid, +) -> Result<(String, i64), josekit::JoseError> { let resource = icarus_models::token::TokenResource { message: String::from(MESSAGE), issuer: String::from(ISSUER), audiences: vec![String::from(AUDIENCE)], + id: *id, }; icarus_models::token::create_token(provided_key, &resource, time::Duration::hours(4)) } -pub fn create_service_token(provided: &String) -> Result<(String, i64), josekit::JoseError> { +pub fn create_service_token( + provided: &String, + id: &uuid::Uuid, +) -> Result<(String, i64), josekit::JoseError> { let resource = icarus_models::token::TokenResource { - message: String::from("Service random"), + message: String::from(SERVICE_SUBJECT), issuer: String::from(ISSUER), audiences: vec![String::from(AUDIENCE)], + id: *id, }; icarus_models::token::create_token(provided, &resource, time::Duration::hours(1)) } +pub fn create_service_refresh_token( + key: &String, + id: &uuid::Uuid, +) -> Result<(String, i64), josekit::JoseError> { + let resource = icarus_models::token::TokenResource { + message: String::from(SERVICE_SUBJECT), + issuer: String::from(ISSUER), + audiences: vec![String::from(AUDIENCE)], + id: *id, + }; + icarus_models::token::create_token(key, &resource, time::Duration::hours(4)) +} + pub fn verify_token(key: &String, token: &String) -> bool { - let ver = Hs256.verifier_from_bytes(key.as_bytes()).unwrap(); - let (payload, _header) = jwt::decode_with_verifier(token, &ver).unwrap(); - match payload.subject() { - Some(_sub) => true, - None => false, + match get_payload(key, token) { + Ok((payload, _header)) => match payload.subject() { + Some(_sub) => true, + None => false, + }, + Err(_err) => false, } } +pub fn extract_id_from_token(key: &String, token: &String) -> Result { + match get_payload(key, token) { + Ok((payload, _header)) => match payload.claim("id") { + Some(id) => match uuid::Uuid::parse_str(id.as_str().unwrap()) { + Ok(extracted) => Ok(extracted), + Err(err) => Err(std::io::Error::other(err.to_string())), + }, + None => Err(std::io::Error::other("No claim found")), + }, + Err(err) => Err(std::io::Error::other(err.to_string())), + } +} + +pub const APP_TOKEN_TYPE: &str = "Icarus_App"; +pub const APP_SUBJECT: &str = "Something random"; +pub const SERVICE_TOKEN_TYPE: &str = "Icarus_Service"; +pub const SERVICE_SUBJECT: &str = "Service random"; + +pub fn get_token_type(key: &String, token: &String) -> Result { + match get_payload(key, token) { + Ok((payload, _header)) => match payload.subject() { + Some(subject) => { + if subject == APP_SUBJECT { + Ok(String::from(APP_TOKEN_TYPE)) + } else if subject == SERVICE_SUBJECT { + Ok(String::from(SERVICE_TOKEN_TYPE)) + } else { + Err(std::io::Error::other(String::from("Invalid subject"))) + } + } + None => Err(std::io::Error::other(String::from("Invalid payload"))), + }, + Err(err) => Err(std::io::Error::other(err.to_string())), + } +} + +pub fn is_token_type_valid(token_type: &String) -> bool { + token_type == SERVICE_TOKEN_TYPE +} + +fn get_payload( + key: &String, + token: &String, +) -> Result<(josekit::jwt::JwtPayload, josekit::jws::JwsHeader), josekit::JoseError> { + let ver = Hs256.verifier_from_bytes(key.as_bytes()).unwrap(); + jwt::decode_with_verifier(token, &ver) +} + #[cfg(test)] mod tests { use super::*; @@ -55,7 +125,8 @@ mod tests { fn test_tokenize() { let rt = tokio::runtime::Runtime::new().unwrap(); let special_key = rt.block_on(icarus_envy::environment::get_secret_key()); - match create_token(&special_key) { + let id = uuid::Uuid::new_v4(); + match create_token(&special_key, &id) { Ok((token, _duration)) => { let result = verify_token(&special_key, &token); assert!(result, "Token not verified"); -- 2.43.0