1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use serde::{Serialize, Deserialize};

/// Credentials for authenticating with the lighthouse.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct Authentication {
    #[serde(rename = "USER")]
    pub username: String,
    #[serde(rename = "TOKEN")]
    pub token: String,
}

impl Authentication {
    /// Creates an `Authentication` using the given credentials.
    pub fn new(username: &str, token: &str) -> Self {
        Self {
            username: username.to_owned(),
            token: token.to_owned(),
        }
    }
}