entrust_agent/server/
request.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
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, PartialEq, Debug)]
pub enum Request {
    SetAgeIdentity {
        identity: String,
        pin: Option<String>,
    },
    GetAgeIdentity {
        pin: Option<String>,
    },
    Shutdown,
}

#[derive(Serialize, Deserialize, PartialEq, Debug)]
pub struct SetAgeIdentityResponse {
    identity: String,
}

#[derive(Serialize, Deserialize, PartialEq, Debug)]
pub enum GetAgeIdentityResponse {
    Ok { identity: String },
    NotSet,
    WrongPin,
}