hank_types/
hank.plugin.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
// @generated
// This file is @generated by prost-build.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum EscalatedPrivilege {
    All = 0,
    ReloadPlugin = 1,
}
impl EscalatedPrivilege {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            EscalatedPrivilege::All => "ALL",
            EscalatedPrivilege::ReloadPlugin => "RELOAD_PLUGIN",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "ALL" => Some(Self::All),
            "RELOAD_PLUGIN" => Some(Self::ReloadPlugin),
            _ => None,
        }
    }
}
/// Metadata for a plugin.
#[cfg_attr(feature = "kameo", derive(kameo::Reply))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Metadata {
    /// The plguins name.
    #[prost(string, tag="1")]
    pub name: ::prost::alloc::string::String,
    /// A short description of the plugin.
    #[prost(string, tag="2")]
    pub description: ::prost::alloc::string::String,
    /// A version string for the plugin. Should follow semver.
    ///
    /// @see: <https://semver.org/>
    #[prost(string, tag="3")]
    pub version: ::prost::alloc::string::String,
    /// When true, a SQLite3 database will be created for the plugin.
    /// @deprecated All plugins get a database by default now.
    #[prost(bool, tag="4")]
    pub database: bool,
    /// Access checks
    ///
    /// All functionality of this plugin can optionally be gated by accses checks.
    #[prost(message, optional, tag="5")]
    pub access_checks: ::core::option::Option<super::access_check::AccessCheckChain>,
    /// A secret escalation key that grants this plugin specific escalated
    /// privileges.
    #[prost(string, tag="6")]
    pub escalation_key: ::prost::alloc::string::String,
    /// A list of escalated privileges that this plugin requests to use.
    #[prost(enumeration="EscalatedPrivilege", repeated, tag="7")]
    pub escalated_privileges: ::prost::alloc::vec::Vec<i32>,
}
// @@protoc_insertion_point(module)