CORS bug fix #28

Merged
phoenix merged 5 commits from cors_fix into main 2026-06-30 11:55:32 -04:00
5 changed files with 10 additions and 11 deletions
+4
View File
@@ -5,6 +5,10 @@ on:
branches: branches:
- main - main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
check: check:
name: Check name: Check
Generated
+1 -4
View File
@@ -3129,22 +3129,19 @@ dependencies = [
[[package]] [[package]]
name = "textsender_api" name = "textsender_api"
version = "0.2.0" version = "0.2.1"
dependencies = [ dependencies = [
"axum", "axum",
"axum-extra", "axum-extra",
"futures",
"josekit", "josekit",
"jsonwebtoken", "jsonwebtoken",
"serde", "serde",
"serde_json", "serde_json",
"sqlx 0.9.0", "sqlx 0.9.0",
"swoosh", "swoosh",
"tempfile",
"textsender_models", "textsender_models",
"time", "time",
"tokio", "tokio",
"tokio-util",
"tower", "tower",
"tower-http", "tower-http",
"tracing-subscriber", "tracing-subscriber",
+3 -6
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "textsender_api" name = "textsender_api"
version = "0.2.0" version = "0.2.1"
edition = "2024" edition = "2024"
rust-version = "1.96" rust-version = "1.96"
@@ -10,21 +10,18 @@ axum-extra = { version = "0.12.6", features = ["cookie"] }
serde = { version = "1.0.228", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] }
serde_json = { version = "1.0.150" } serde_json = { version = "1.0.150" }
tokio = { version = "1.52.3", features = ["full"] } tokio = { version = "1.52.3", features = ["full"] }
tokio-util = { version = "0.7.18", features = ["io"] }
tower = { version = "0.5.3", features = ["full"] }
tower-http = { version = "0.6.11", features = ["cors", "timeout"] } tower-http = { version = "0.6.11", features = ["cors", "timeout"] }
tracing-subscriber = "0.3.23" tracing-subscriber = "0.3.23"
futures = { version = "0.3.32" }
uuid = { version = "1.23.3", features = ["v4", "serde"] } uuid = { version = "1.23.3", features = ["v4", "serde"] }
sqlx = { version = "0.9.0", features = ["runtime-tokio", "tls-native-tls", "postgres", "time", "uuid"] } sqlx = { version = "0.9.0", features = ["runtime-tokio", "tls-native-tls", "postgres", "time", "uuid"] }
time = { version = "0.3.49", features = ["formatting", "macros", "parsing", "serde"] } time = { version = "0.3.49", features = ["formatting", "macros", "parsing", "serde"] }
jsonwebtoken = { version = "10.4.0", features = ["rust_crypto"] } jsonwebtoken = { version = "10.4.0", features = ["rust_crypto"] }
josekit = { version = "0.10.3" }
utoipa = { version = "5.5.0", features = ["axum_extras"] } utoipa = { version = "5.5.0", features = ["axum_extras"] }
utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] } utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] }
textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender_models.git", tag = "v0.4.10" } textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender_models.git", tag = "v0.4.10" }
swoosh = { git = "ssh://git@git.kundeng.us/phoenix/swoosh.git", tag = "v0.4.2.0" } swoosh = { git = "ssh://git@git.kundeng.us/phoenix/swoosh.git", tag = "v0.4.2.0" }
[dev-dependencies] [dev-dependencies]
tower = { version = "0.5.3", features = ["full"] }
josekit = { version = "0.10.3" }
url = { version = "2.5.8" } url = { version = "2.5.8" }
tempfile = { version = "3.27.0" }
+1
View File
@@ -33,6 +33,7 @@ pub mod init {
let cors = tower_http::cors::CorsLayer::new() let cors = tower_http::cors::CorsLayer::new()
.allow_methods([ .allow_methods([
axum::http::Method::GET, axum::http::Method::GET,
axum::http::Method::PATCH,
axum::http::Method::POST, axum::http::Method::POST,
axum::http::Method::PUT, axum::http::Method::PUT,
axum::http::Method::DELETE, axum::http::Method::DELETE,
+1 -1
View File
@@ -204,7 +204,7 @@ pub async fn test_token() -> Result<String, josekit::JoseError> {
}; };
match textsender_models::token::create_token(&key, &token_resource, time::Duration::hours(1)) { match textsender_models::token::create_token(&key, &token_resource, time::Duration::hours(1)) {
Ok((access_token, _some_time)) => Ok(access_token), Ok(access_token) => Ok(access_token.access_token),
Err(err) => Err(err), Err(err) => Err(err),
} }
} }