Update packages #15
Generated
+3
-3
@@ -2212,7 +2212,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "textsender_auth"
|
||||
version = "0.1.22"
|
||||
version = "0.1.23"
|
||||
dependencies = [
|
||||
"argon2",
|
||||
"async-std",
|
||||
@@ -2239,8 +2239,8 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "textsender_models"
|
||||
version = "0.3.1"
|
||||
source = "git+ssh://git@git.kundeng.us/phoenix/textsender_models.git?tag=v0.3.1#ba998096cb5d35dae8e627136a795c4d9af5c8f5"
|
||||
version = "0.3.3"
|
||||
source = "git+ssh://git@git.kundeng.us/phoenix/textsender_models.git?tag=v0.3.3#c09fa36b15601b37f65b8baac0d479c30d2c1e44"
|
||||
dependencies = [
|
||||
"const_format",
|
||||
"dotenvy",
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "textsender_auth"
|
||||
version = "0.1.22"
|
||||
version = "0.1.23"
|
||||
edition = "2024"
|
||||
rust-version = "1.95"
|
||||
|
||||
@@ -21,7 +21,7 @@ time = { version = "0.3.47", features = ["macros", "serde"] }
|
||||
josekit = { version = "0.10.3" }
|
||||
utoipa = { version = "5.5.0", features = ["axum_extras"] }
|
||||
utoipa-swagger-ui = { version = "9.0.2", features = ["axum"] }
|
||||
textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender_models.git", tag = "v0.3.1" }
|
||||
textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender_models.git", tag = "v0.3.3" }
|
||||
|
||||
[dev-dependencies]
|
||||
http-body-util = { version = "0.1.3" }
|
||||
|
||||
@@ -24,7 +24,7 @@ pub fn create_token(
|
||||
message: String::from(MESSAGE),
|
||||
issuer: String::from(ISSUER),
|
||||
audiences: vec![String::from(AUDIENCE)],
|
||||
id: *id,
|
||||
user_id: *id,
|
||||
};
|
||||
textsender_models::token::create_token(provided_key, &resource, time::Duration::hours(4))
|
||||
}
|
||||
@@ -37,7 +37,7 @@ pub fn create_service_token(
|
||||
message: String::from(SERVICE_SUBJECT),
|
||||
issuer: String::from(ISSUER),
|
||||
audiences: vec![String::from(AUDIENCE)],
|
||||
id: *id,
|
||||
user_id: *id,
|
||||
};
|
||||
textsender_models::token::create_token(provided, &resource, time::Duration::hours(1))
|
||||
}
|
||||
@@ -50,7 +50,7 @@ pub fn create_service_refresh_token(
|
||||
message: String::from(SERVICE_SUBJECT),
|
||||
issuer: String::from(ISSUER),
|
||||
audiences: vec![String::from(AUDIENCE)],
|
||||
id: *id,
|
||||
user_id: *id,
|
||||
};
|
||||
textsender_models::token::create_token(key, &resource, time::Duration::hours(4))
|
||||
}
|
||||
@@ -67,7 +67,7 @@ pub fn verify_token(key: &String, token: &String) -> bool {
|
||||
|
||||
pub fn extract_id_from_token(key: &String, token: &String) -> Result<uuid::Uuid, std::io::Error> {
|
||||
match get_payload(key, token) {
|
||||
Ok((payload, _header)) => match payload.claim("id") {
|
||||
Ok((payload, _header)) => match payload.claim("user_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())),
|
||||
|
||||
Reference in New Issue
Block a user