vaultrs/api/database/
responses.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
use serde::{Deserialize, Serialize};

/// Response from executing
/// [ReadConnectionRequest][crate::api::database::requests::ReadConnectionRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadConnectionResponse {
    pub allowed_roles: Vec<String>,
    pub connection_details: ConnectionDetails,
    pub plugin_name: String,
}

#[derive(Deserialize, Debug, Serialize)]
pub struct ConnectionDetails {
    pub connection_url: String,
    pub username: String,
}

/// Response from executing
/// [ListConnectionsRequest][crate::api::database::requests::ListConnectionsRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ListConnectionsResponse {
    pub keys: Vec<String>,
}

/// Response from executing
/// [ReadRoleRequest][crate::api::database::requests::ReadRoleRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadRoleResponse {
    pub creation_statements: Vec<String>,
    pub db_name: String,
    pub default_ttl: u64,
    pub max_ttl: u64,
    pub renew_statements: Vec<String>,
    pub revocation_statements: Vec<String>,
    pub rollback_statements: Vec<String>,
}

/// Response from executing
/// [ListRolesRequest][crate::api::database::requests::ListRolesRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ListRolesResponse {
    pub keys: Vec<String>,
}

/// Response from executing
/// [GenerateCredentialsRequest][crate::api::database::requests::GenerateCredentialsRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct GenerateCredentialsResponse {
    pub username: String,
    pub password: String,
}

/// Response from executing
/// [ReadStaticRoleRequest][crate::api::database::requests::ReadStaticRoleRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ReadStaticRoleResponse {
    pub db_name: String,
    pub username: String,
    pub rotation_period: u64,
    pub rotation_statements: Vec<String>,
}

/// Response from executing
/// [ListStaticRolesRequest][crate::api::database::requests::ListStaticRolesRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct ListStaticRolesResponse {
    pub keys: Vec<String>,
}

/// Response from executing
/// [GetStaticCredentialsRequest][crate::api::database::requests::GetStaticCredentialsRequest]
#[derive(Deserialize, Debug, Serialize)]
pub struct GetStaticCredentialsResponse {
    pub last_vault_rotation: String,
    pub password: String,
    pub rotation_period: u64,
    pub ttl: u64,
    pub username: String,
}