in src/vtok_common/src/config.rs [128:142]
fn load_device<R: Read>(src: R) -> Result<Device, Error> {
let mut device: Device =
serde_json::from_reader(BufReader::new(src)).map_err(Error::SerdeError)?;
for slot in device.slots.iter_mut() {
let expired = slot
.as_ref()
.and_then(|tok| tok.expiry_ts.checked_sub(util::time::monotonic_secs()))
.filter(|t| *t > 0)
.is_none();
if expired {
slot.take();
}
}
Ok(device)
}