rsiot/message/system_messages/
auth_response_ok.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use std::collections::HashSet;

use serde::{Deserialize, Serialize};
use uuid::Uuid;

use crate::message::{AuthPermissions, MsgKey};

/// Подтверждение авторизации
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
pub struct AuthResponseOk {
    /// Сгенерированный токен
    pub token: String,

    /// Разрешения
    pub perm: AuthPermissions,

    /// Идентификаторы компонентов, через которые сообщение было получено
    pub trace_ids: HashSet<Uuid>,

    /// Логин для входа
    pub login: String,
}

impl MsgKey for AuthResponseOk {
    fn key(&self) -> String {
        "".to_string()
    }
}