init4-bin-base 0.19.0

Internal utilities for binaries produced by the init4 team
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use init4_bin_base::{perms::OAuthConfig, utils::from_env::FromEnv};

#[tokio::main]
async fn main() -> eyre::Result<()> {
    let cfg = OAuthConfig::from_env()?;
    let authenticator = cfg.authenticator();
    let token = authenticator.token();

    let _jh = authenticator.spawn();

    tokio::time::sleep(std::time::Duration::from_secs(5)).await;
    dbg!(token.secret().await.unwrap());

    Ok(())
}