lighthouse_protocol/
authentication.rs

1use serde::{Serialize, Deserialize};
2
3/// Credentials for authenticating with the lighthouse.
4#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
5pub struct Authentication {
6    #[serde(rename = "USER")]
7    pub username: String,
8    #[serde(rename = "TOKEN")]
9    pub token: String,
10}
11
12impl Authentication {
13    /// Creates an `Authentication` using the given credentials.
14    pub fn new(username: &str, token: &str) -> Self {
15        Self {
16            username: username.to_owned(),
17            token: token.to_owned(),
18        }
19    }
20}