Update packages (#15)
Reviewed-on: phoenix/textsender_auth#15
This commit was merged in pull request #15.
This commit is contained in:
Generated
+3
-3
@@ -2212,7 +2212,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textsender_auth"
|
name = "textsender_auth"
|
||||||
version = "0.1.22"
|
version = "0.1.23"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"argon2",
|
"argon2",
|
||||||
"async-std",
|
"async-std",
|
||||||
@@ -2239,8 +2239,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "textsender_models"
|
name = "textsender_models"
|
||||||
version = "0.3.1"
|
version = "0.3.3"
|
||||||
source = "git+ssh://git@git.kundeng.us/phoenix/textsender_models.git?tag=v0.3.1#ba998096cb5d35dae8e627136a795c4d9af5c8f5"
|
source = "git+ssh://git@git.kundeng.us/phoenix/textsender_models.git?tag=v0.3.3#c09fa36b15601b37f65b8baac0d479c30d2c1e44"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"const_format",
|
"const_format",
|
||||||
"dotenvy",
|
"dotenvy",
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "textsender_auth"
|
name = "textsender_auth"
|
||||||
version = "0.1.22"
|
version = "0.1.23"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
rust-version = "1.95"
|
rust-version = "1.95"
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@ time = { version = "0.3.47", features = ["macros", "serde"] }
|
|||||||
josekit = { version = "0.10.3" }
|
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.3.1" }
|
textsender_models = { git = "ssh://git@git.kundeng.us/phoenix/textsender_models.git", tag = "v0.3.3" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
http-body-util = { version = "0.1.3" }
|
http-body-util = { version = "0.1.3" }
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ pub fn create_token(
|
|||||||
message: String::from(MESSAGE),
|
message: String::from(MESSAGE),
|
||||||
issuer: String::from(ISSUER),
|
issuer: String::from(ISSUER),
|
||||||
audiences: vec![String::from(AUDIENCE)],
|
audiences: vec![String::from(AUDIENCE)],
|
||||||
id: *id,
|
user_id: *id,
|
||||||
};
|
};
|
||||||
textsender_models::token::create_token(provided_key, &resource, time::Duration::hours(4))
|
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),
|
message: String::from(SERVICE_SUBJECT),
|
||||||
issuer: String::from(ISSUER),
|
issuer: String::from(ISSUER),
|
||||||
audiences: vec![String::from(AUDIENCE)],
|
audiences: vec![String::from(AUDIENCE)],
|
||||||
id: *id,
|
user_id: *id,
|
||||||
};
|
};
|
||||||
textsender_models::token::create_token(provided, &resource, time::Duration::hours(1))
|
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),
|
message: String::from(SERVICE_SUBJECT),
|
||||||
issuer: String::from(ISSUER),
|
issuer: String::from(ISSUER),
|
||||||
audiences: vec![String::from(AUDIENCE)],
|
audiences: vec![String::from(AUDIENCE)],
|
||||||
id: *id,
|
user_id: *id,
|
||||||
};
|
};
|
||||||
textsender_models::token::create_token(key, &resource, time::Duration::hours(4))
|
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> {
|
pub fn extract_id_from_token(key: &String, token: &String) -> Result<uuid::Uuid, std::io::Error> {
|
||||||
match get_payload(key, token) {
|
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()) {
|
Some(id) => match uuid::Uuid::parse_str(id.as_str().unwrap()) {
|
||||||
Ok(extracted) => Ok(extracted),
|
Ok(extracted) => Ok(extracted),
|
||||||
Err(err) => Err(std::io::Error::other(err.to_string())),
|
Err(err) => Err(std::io::Error::other(err.to_string())),
|
||||||
|
|||||||
Reference in New Issue
Block a user