Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8b49b63d59 | ||
|
|
597af4e84c | ||
|
|
02061bf7a3 | ||
|
|
151eeaacf6 |
@@ -1,4 +1,4 @@
|
||||
name: textsender_models PR
|
||||
name: schedtxt_models PR
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
@@ -14,10 +14,10 @@ jobs:
|
||||
name: Check
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo check
|
||||
|
||||
@@ -25,10 +25,10 @@ jobs:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: rustup component add rustfmt
|
||||
- run: cargo fmt --all -- --check
|
||||
@@ -37,10 +37,10 @@ jobs:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: rustup component add clippy
|
||||
- run: cargo clippy -- -D warnings
|
||||
|
||||
@@ -13,14 +13,14 @@ jobs:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v5
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0 # Important for git describe --tags
|
||||
|
||||
- name: Install Rust
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
components: cargo
|
||||
|
||||
- name: Extract Version from Cargo.toml
|
||||
|
||||
+10
-10
@@ -14,10 +14,10 @@ jobs:
|
||||
name: Check
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo check
|
||||
|
||||
@@ -25,10 +25,10 @@ jobs:
|
||||
name: Test Suite
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo test
|
||||
|
||||
@@ -36,10 +36,10 @@ jobs:
|
||||
name: Rustfmt
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: rustup component add rustfmt
|
||||
- run: cargo fmt --all -- --check
|
||||
@@ -48,10 +48,10 @@ jobs:
|
||||
name: Clippy
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: rustup component add clippy
|
||||
- run: cargo clippy -- -D warnings
|
||||
@@ -60,9 +60,9 @@ jobs:
|
||||
name: build
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v6
|
||||
- uses: actions-rust-lang/setup-rust-toolchain@v1
|
||||
with:
|
||||
toolchain: 1.96
|
||||
toolchain: 1.97
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
- run: cargo build
|
||||
|
||||
Generated
+37
-37
@@ -91,15 +91,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
|
||||
|
||||
[[package]]
|
||||
name = "bytes"
|
||||
version = "1.12.0"
|
||||
version = "1.12.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8ae3f5d315924270530207e2a68396c3cc547f6dca3fbdca317cfb1a51edb593"
|
||||
checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04"
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.2.65"
|
||||
version = "1.2.67"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e228eec9be7c17ccb640b59b36a5cd805ea2a564a4c5e162c2f659fea30d3b96"
|
||||
checksum = "e17dd265a7d0f31ef544e1b20e03add05d3b45b491b633b10d67145d2acc1a38"
|
||||
dependencies = [
|
||||
"find-msvc-tools",
|
||||
"shlex",
|
||||
@@ -218,18 +218,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-queue"
|
||||
version = "0.3.12"
|
||||
version = "0.3.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115"
|
||||
checksum = "803d13fb3b09d88be9f4dbc29062c66b19bf7170867ceb746d2a8689bf6c7a26"
|
||||
dependencies = [
|
||||
"crossbeam-utils",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "crossbeam-utils"
|
||||
version = "0.8.21"
|
||||
version = "0.8.22"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
|
||||
checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17"
|
||||
|
||||
[[package]]
|
||||
name = "crypto-common"
|
||||
@@ -792,9 +792,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.8.2"
|
||||
version = "2.8.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "88904434abc2901f197fe8cc55f0445e7ded921dba5911dad2e2b39b48e663c4"
|
||||
checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98"
|
||||
|
||||
[[package]]
|
||||
name = "miniz_oxide"
|
||||
@@ -1012,9 +1012,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.12.4"
|
||||
version = "1.13.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1292b7759ae1cb9ec195452d1390a074f0cd8541ab7a5a8c31cd6db45d4a6ba"
|
||||
checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
@@ -1024,9 +1024,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "regex-automata"
|
||||
version = "0.4.14"
|
||||
version = "0.4.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f"
|
||||
checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
@@ -1054,9 +1054,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "rustversion"
|
||||
version = "1.0.22"
|
||||
version = "1.0.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
|
||||
checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f"
|
||||
|
||||
[[package]]
|
||||
name = "schannel"
|
||||
@@ -1067,6 +1067,21 @@ dependencies = [
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "schedtxt_models"
|
||||
version = "0.5.3"
|
||||
dependencies = [
|
||||
"const_format",
|
||||
"dotenvy",
|
||||
"josekit",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sqlx",
|
||||
"time",
|
||||
"utoipa",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "scopeguard"
|
||||
version = "1.2.0"
|
||||
@@ -1451,21 +1466,6 @@ dependencies = [
|
||||
"windows-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "textsender_models"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"const_format",
|
||||
"dotenvy",
|
||||
"josekit",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"sqlx",
|
||||
"time",
|
||||
"utoipa",
|
||||
"uuid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "2.0.18"
|
||||
@@ -1528,9 +1528,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "tinyvec"
|
||||
version = "1.11.0"
|
||||
version = "1.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3e61e67053d25a4e82c844e8424039d9745781b3fc4f32b8d55ed50f5f667ef3"
|
||||
checksum = "bb4ebadaa0af04fab11ae01eb5f9fdb5f9c5b875506e210e71c07873528baa7f"
|
||||
dependencies = [
|
||||
"tinyvec_macros",
|
||||
]
|
||||
@@ -1681,9 +1681,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "uuid"
|
||||
version = "1.23.4"
|
||||
version = "1.23.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53"
|
||||
checksum = "ea5fab0d6c3c01ae70085a09cb03d4c7a1d6314e2b3e075392783396d724ca0a"
|
||||
dependencies = [
|
||||
"getrandom",
|
||||
"js-sys",
|
||||
@@ -1860,6 +1860,6 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "zmij"
|
||||
version = "1.0.21"
|
||||
version = "1.0.23"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa"
|
||||
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
|
||||
|
||||
+7
-6
@@ -1,16 +1,17 @@
|
||||
[package]
|
||||
name = "textsender_models"
|
||||
version = "0.5.0"
|
||||
name = "schedtxt_models"
|
||||
version = "0.5.3"
|
||||
edition = "2024"
|
||||
rust-version = "1.96"
|
||||
description = "Models used for the textsender project"
|
||||
rust-version = "1.97"
|
||||
license = "MIT"
|
||||
description = "Models used for the schedtxt project"
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.228", features = ["derive"] }
|
||||
serde_json = { version = "1.0.150" }
|
||||
time = { version = "0.3.49", features = ["formatting", "macros", "parsing", "serde"] }
|
||||
time = { version = "0.3.53", features = ["formatting", "macros", "parsing", "serde"] }
|
||||
sqlx = { version = "0.9.0", features = ["runtime-tokio", "tls-native-tls", "postgres", "time", "uuid"] }
|
||||
uuid = { version = "1.23.3", features = ["v4", "serde"] }
|
||||
uuid = { version = "1.23.5", features = ["v4", "serde"] }
|
||||
dotenvy = { version = "0.15.7" }
|
||||
const_format = { version = "0.2.36" }
|
||||
josekit = { version = "0.10.3" }
|
||||
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
Copyright (c) 2026 Kun Deng.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -40,7 +40,7 @@ pub fn get_root_directory() -> crate::envy::EnvVar {
|
||||
|
||||
pub fn get_app_base_api_url() -> crate::envy::EnvVar {
|
||||
dotenvy::dotenv().ok();
|
||||
let key = crate::envy::keys::TEXTSENDER_BASE_API_URL;
|
||||
let key = crate::envy::keys::SCHEDTXT_BASE_API_URL;
|
||||
let value = std::env::var(key).expect(key);
|
||||
|
||||
crate::envy::init_envvar(key, &value)
|
||||
@@ -48,7 +48,7 @@ pub fn get_app_base_api_url() -> crate::envy::EnvVar {
|
||||
|
||||
pub fn get_app_auth_base_api_url() -> crate::envy::EnvVar {
|
||||
dotenvy::dotenv().ok();
|
||||
let key = crate::envy::keys::TEXTSENDER_AUTH_BASE_API_URL;
|
||||
let key = crate::envy::keys::SCHEDTXT_AUTH_BASE_API_URL;
|
||||
let value = std::env::var(key).expect(key);
|
||||
|
||||
crate::envy::init_envvar(key, &value)
|
||||
|
||||
+8
-8
@@ -2,7 +2,7 @@
|
||||
pub const DB_URL: &str = "DATABASE_URL";
|
||||
|
||||
/// Environment key for secret main key
|
||||
/// Used for the textsender app
|
||||
/// Used for the schedtxt app
|
||||
pub const SECRET_MAIN_KEY: &str = "SECRET_MAIN_KEY";
|
||||
|
||||
/// Environment key for service logins
|
||||
@@ -15,11 +15,11 @@ pub const SECRET_KEY: &str = "SECRET_KEY";
|
||||
/// Environment key for root directory for the textsender app
|
||||
pub const ROOT_DIRECTORY: &str = "ROOT_DIRECTORY";
|
||||
|
||||
/// Environment key for textsender api url
|
||||
pub const TEXTSENDER_BASE_API_URL: &str = "TEXTSENDER_BASE_API_URL";
|
||||
/// Environment key for schedtxt api url
|
||||
pub const SCHEDTXT_BASE_API_URL: &str = "SCHEDTXT_BASE_API_URL";
|
||||
|
||||
/// Environment key for textsender auth api url
|
||||
pub const TEXTSENDER_AUTH_BASE_API_URL: &str = "TEXTSENDER_AUTH_BASE_API_URL";
|
||||
pub const SCHEDTXT_AUTH_BASE_API_URL: &str = "SCHEDTXT_AUTH_BASE_API_URL";
|
||||
|
||||
/// Environment key for App status
|
||||
pub const APP_ENV: &str = "APP_ENV";
|
||||
@@ -41,10 +41,10 @@ pub mod error {
|
||||
pub const SERVICE_LOGIN: &str = concatcp!(super::SERVICE_PASSPHRASE, " ", GENERAL_ERROR);
|
||||
pub const SECRET_KEY: &str = concatcp!(super::SECRET_KEY, " ", GENERAL_ERROR);
|
||||
pub const ROOT_DIRECTORY: &str = concatcp!(super::ROOT_DIRECTORY, " ", GENERAL_ERROR);
|
||||
pub const TEXTSENDER_BASE_API_URL: &str =
|
||||
concatcp!(super::TEXTSENDER_BASE_API_URL, " ", GENERAL_ERROR);
|
||||
pub const TEXTSENDER_AUTH_BASE_API_URL: &str =
|
||||
concatcp!(super::TEXTSENDER_AUTH_BASE_API_URL, " ", GENERAL_ERROR);
|
||||
pub const SCHEDTXT_BASE_API_URL: &str =
|
||||
concatcp!(super::SCHEDTXT_BASE_API_URL, " ", GENERAL_ERROR);
|
||||
pub const SCHEDTXT_AUTH_BASE_API_URL: &str =
|
||||
concatcp!(super::SCHEDTXT_AUTH_BASE_API_URL, " ", GENERAL_ERROR);
|
||||
pub const APP_ENV: &str = concatcp!(super::APP_ENV, " ", GENERAL_ERROR);
|
||||
pub const BACKEND_PORT: &str = concatcp!(super::BACKEND_PORT, " ", GENERAL_ERROR);
|
||||
pub const FRONTEND_URL: &str = concatcp!(super::FRONTEND_URL, " ", GENERAL_ERROR);
|
||||
|
||||
+2
-2
@@ -174,8 +174,8 @@ fn init_payload_issued(
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
const TEST_MESSAGE: &str = "Testing for textsender";
|
||||
const TEST_ISSUER: &str = "textsender-test";
|
||||
const TEST_MESSAGE: &str = "Testing for schedtxt";
|
||||
const TEST_ISSUER: &str = "schedtxt-test";
|
||||
const TEST_AUDIENCE: &str = "area-test";
|
||||
const TEST_USER_ID: uuid::Uuid = uuid::uuid!("9ab1c75f-d184-4913-ae99-544b4dcfcb41");
|
||||
const TEST_KEY: &str = "8342nhf7ycrt4983q7ryfc93w478ryfc3w9487ryfc342w98i7cy";
|
||||
|
||||
Reference in New Issue
Block a user