sectok 0.2.0

A library to interact with RFC 8959 secret-token URIs
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use sectok;
use std::env;

fn main() {
    match env::var("API_KEY") {
        Ok(uri) => {
            println!("The URI: {}", uri);
            match sectok::decode(&uri) {
                Some(token) => println!("The decoded token: {}", token),
                None => println!("The URI is invalid, cannot decode the token"),
            }
        }
        Err(e) => {
            println!("Cannot read environment variable: {}", e);
        }
    }
}