Public declaration syntax from harness-sdk/src/plugins/permission.rs Original source SHA-256: dad01a6110d05a7c6478caadd26c019ae8d00dcac2b89c8160b616c53bce33df Function bodies and constant values are omitted. This is not the complete implementation. Source line 18 #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct PermissionRule { /// Plugin name this rule applies to. pub plugin: String, /// Capability kind. pub kind: CapabilityKind, /// Glob pattern matching the resource. pub pattern: String, /// What to do when the pattern matches. pub mode: ApprovalMode } Source line 31 #[derive(Debug)] pub struct PendingPermission { /// The plugin requesting the capability. pub plugin: String, /// The requested capability. pub capability: Capability, /// Channel to send the user's decision. pub response_tx: tokio::sync::oneshot::Sender } Source line 42 #[derive(Debug, Clone, PartialEq, Eq)] pub enum PermissionDecision { /// Allow this specific request once. AllowOnce, /// Always allow requests matching the given pattern. AlwaysAllow(String), /// Deny this request. Deny, } Source line 57 pub struct PermissionManager { } Source line 65 #[must_use] pub fn new() -> Self; Source line 72 pub fn add_rule(&self, rule: PermissionRule); Source line 83 #[must_use] pub fn check(&self, plugin: &str, capability: &Capability) -> Option; Source line 100 pub fn revoke_all(&self, plugin: &str); Source line 108 #[must_use] pub fn rules_for(&self, plugin: &str) -> Vec;