Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the report's timestamp verification #11

Open
osuketh opened this issue Jun 10, 2020 · 0 comments
Open

Implement the report's timestamp verification #11

osuketh opened this issue Jun 10, 2020 · 0 comments

Comments

@osuketh
Copy link
Member

osuketh commented Jun 10, 2020

fn verify_timestamp(&self, attn_report: &Value) -> Result<()> {
if let Value::String(time) = &attn_report["timestamp"] {
Ok(())
// TODO
// let time_fixed = time.clone() + "+0000";
// let ts = DateTime::parse_from_str(&time_fixed, "%Y-%m-%dT%H:%M:%S%.f%z").unwrap().timestamp();
// let now = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() as i64;
// ensure!(now - ts > 0, "")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant