license-api 0.1.0

License API connector written in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::error::Error;
use crate::models::{LoginRequest, LoginResponse, MeResponse};

#[async_trait::async_trait]
pub trait Authenticator {
    async fn login(
        &self,
        creds: &LoginRequest,
    ) -> Result<LoginResponse, Box<dyn Error + Send + Sync>>;

    async fn me(&self, access_token: &str) -> Result<MeResponse, Box<dyn Error + Send + Sync>>;

    async fn link_hwid(
        &self,
        hwid: &str,
        access_token: &str,
    ) -> Result<String, Box<dyn Error + Send + Sync>>;
}