hessra_token_core/time.rs
1/// TokenTimeConfig allows control over token creation times and durations
2/// This is used to create tokens with custom start times and durations
3/// for testing purposes. In the future, this can be enhanced to support
4/// variable length tokens, such as long-lived bearer tokens.
5#[derive(Debug, Clone, Copy)]
6pub struct TokenTimeConfig {
7 /// Optional custom start time (now time override)
8 pub start_time: Option<i64>,
9 /// Duration in seconds (default: 300 seconds = 5 minutes)
10 pub duration: i64,
11}
12
13impl Default for TokenTimeConfig {
14 fn default() -> Self {
15 Self {
16 start_time: None,
17 duration: 300, // 5 minutes in seconds
18 }
19 }
20}