1 |
use serde::{Deserialize, Serialize};
|
2 |
|
3 |
#[derive(Clone, Serialize, Deserialize)]
|
4 |
pub enum AuthenticationMessage {
|
5 |
Request(AuthenticationRequest),
|
6 |
Response(AuthenticationResponse),
|
7 |
}
|
8 |
|
9 |
#[derive(Clone, Serialize, Deserialize)]
|
10 |
pub enum AuthenticationRequest {
|
11 |
AuthenticationToken(AuthenticationTokenRequest),
|
12 |
}
|
13 |
|
14 |
#[derive(Clone, Serialize, Deserialize)]
|
15 |
pub enum AuthenticationResponse {
|
16 |
AuthenticationToken(AuthenticationTokenResponse),
|
17 |
}
|
18 |
|
19 |
#[derive(Clone, Serialize, Deserialize)]
|
20 |
pub struct AuthenticationTokenRequest {
|
21 |
pub secret_key: String,
|
22 |
pub username: String,
|
23 |
pub password: String,
|
24 |
}
|
25 |
|
26 |
#[derive(Clone, Serialize, Deserialize)]
|
27 |
pub struct AuthenticationTokenResponse {
|
28 |
pub token: String,
|
29 |
}
|
30 |
|