Changes due to dependency update
Some checks failed
Rust Build / Clippy (pull_request) Successful in 2m16s
Rust Build / build (pull_request) Successful in 2m5s
Rust Build / Check (pull_request) Successful in 2m9s
Rust Build / Test Suite (pull_request) Successful in 1m41s
Rust Build / Rustfmt (pull_request) Failing after 27s
Some checks failed
Rust Build / Clippy (pull_request) Successful in 2m16s
Rust Build / build (pull_request) Successful in 2m5s
Rust Build / Check (pull_request) Successful in 2m9s
Rust Build / Test Suite (pull_request) Successful in 1m41s
Rust Build / Rustfmt (pull_request) Failing after 27s
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
use josekit::{
|
use josekit::{
|
||||||
self,
|
self,
|
||||||
jws::{JwsHeader, alg::hmac::HmacJwsAlgorithm::Hs256},
|
jws::{alg::hmac::HmacJwsAlgorithm::Hs256},
|
||||||
jwt::{self, JwtPayload},
|
jwt::{self},
|
||||||
};
|
};
|
||||||
|
|
||||||
use time;
|
use time;
|
||||||
@@ -21,6 +21,7 @@ pub fn get_expiration(issued: &time::OffsetDateTime) -> Result<time::OffsetDateT
|
|||||||
Ok(*issued + duration_expire)
|
Ok(*issued + duration_expire)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
mod util {
|
mod util {
|
||||||
pub fn time_to_std_time(
|
pub fn time_to_std_time(
|
||||||
provided_time: &time::OffsetDateTime,
|
provided_time: &time::OffsetDateTime,
|
||||||
@@ -29,6 +30,7 @@ mod util {
|
|||||||
Ok(converted)
|
Ok(converted)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
pub fn create_token(provided_key: &String) -> Result<(String, i64), josekit::JoseError> {
|
pub fn create_token(provided_key: &String) -> Result<(String, i64), josekit::JoseError> {
|
||||||
/*
|
/*
|
||||||
@@ -63,7 +65,12 @@ pub fn create_token(provided_key: &String) -> Result<(String, i64), josekit::Jos
|
|||||||
Err(e) => Err(josekit::JoseError::InvalidClaim(e.into())),
|
Err(e) => Err(josekit::JoseError::InvalidClaim(e.into())),
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
icarus_models::token::create_token(provided_key, &String::from(MESSAGE), &String::from(ISSUER), &String::from(AUDIENCE))
|
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 {
|
pub fn verify_token(key: &String, token: &String) -> bool {
|
||||||
|
Reference in New Issue
Block a user