| 305 | |
| 306 | #[cfg(test)] |
| 307 | fn test() -> Self { |
| 308 | Self { |
| 309 | access_token: Secret("test_access_token".to_string()), |
| 310 | expires_at: time::OffsetDateTime::now_utc() + time::Duration::minutes(60), |
| 311 | refresh_token: Some(Secret("test_refresh_token".to_string())), |
| 312 | region: Some(OIDC_BUILDER_ID_REGION.to_string()), |
| 313 | start_url: Some(START_URL.to_string()), |
| 314 | oauth_flow: OAuthFlow::DeviceCode, |
| 315 | scopes: Some(SCOPES.iter().map(|s| (*s).to_owned()).collect()), |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | /// Load the token from the keychain, refresh the token if it is expired and return it |
| 320 | pub async fn load( |