Develop first version (#1)
All checks were successful
continuous-integration/drone/push Build is passing

Create first version of the library

The code is mainly taken from

* https://gitea.communiquons.org/pierre/oidc-test-client
* https://gitea.communiquons.org/pierre/BasicOIDC

with little improvements.

Reviewed-on: #1
This commit is contained in:
2023-04-29 07:49:35 +00:00
parent 37259391f1
commit 394e29ae55
11 changed files with 1861 additions and 4 deletions

19
src/time_utils.rs Normal file
View File

@@ -0,0 +1,19 @@
use std::time::{SystemTime, UNIX_EPOCH};
/// Get current time since epoch, in seconds
pub fn time() -> u64 {
SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap()
.as_secs()
}
#[cfg(test)]
mod test {
use crate::time_utils::time;
#[test]
fn time_is_recent_enough() {
assert!(time() > 1682750570);
}
}