pub struct ControlCommand {
pub command_id: u64,
pub request_id: String,
pub operator_id: String,
pub reason: String,
pub kind: CommandKind,
pub target: String,
pub payload: BTreeMap<String, String>,
pub permission: Permission,
pub dry_run: bool,
}Fields§
§command_id: u64§request_id: String§operator_id: String§reason: String§kind: CommandKind§target: String§payload: BTreeMap<String, String>§permission: Permission§dry_run: boolImplementations§
Source§impl ControlCommand
impl ControlCommand
pub fn validate(&self) -> Result<(), ControlError>
Sourcepub fn validate_as(&self, granted: Permission) -> Result<(), ControlError>
pub fn validate_as(&self, granted: Permission) -> Result<(), ControlError>
校验请求方声明的权限是否真的不超过服务端授予的权限。
permission 是审计字段,不是认证凭据;生产入口必须把外部身份解析成
granted 后调用本方法,不能只调用无身份的 validate。
pub fn digest(&self) -> u64
Trait Implementations§
Source§impl Clone for ControlCommand
impl Clone for ControlCommand
Source§impl Debug for ControlCommand
impl Debug for ControlCommand
Source§impl<'de> Deserialize<'de> for ControlCommand
impl<'de> Deserialize<'de> for ControlCommand
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ControlCommand
Source§impl PartialEq for ControlCommand
impl PartialEq for ControlCommand
Source§impl Serialize for ControlCommand
impl Serialize for ControlCommand
impl StructuralPartialEq for ControlCommand
Auto Trait Implementations§
impl Forget for ControlCommand
impl Freeze for ControlCommand
impl Move for ControlCommand
impl RefUnwindSafe for ControlCommand
impl Send for ControlCommand
impl Sync for ControlCommand
impl Unpin for ControlCommand
impl UnsafeUnpin for ControlCommandwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const LeafNode<String, String> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, String)>>: UnsafeUnpin,
impl UnwindSafe for ControlCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more