Files
claw/src/security/mod.rs
木炎 bdf8e12246 feat: align browser callback runtime and export flows
Consolidate the browser task runtime around the callback path, add safer artifact opening for Zhihu exports, and cover the new service/browser flows with focused tests and supporting docs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-06 21:44:53 +08:00

30 lines
775 B
Rust

mod hmac;
mod mac_policy;
pub use hmac::{derive_session_key, sign_command};
pub use mac_policy::MacPolicy;
use thiserror::Error;
#[derive(Debug, Error)]
pub enum SecurityError {
#[error("invalid hmac seed: {0}")]
InvalidSeed(String),
#[error("action is not allowed: {0}")]
ActionNotAllowed(String),
#[error("domain is not allowed: {0}")]
DomainNotAllowed(String),
#[error("invalid local dashboard request: {0}")]
InvalidLocalDashboard(String),
#[error("invalid rules: {0}")]
InvalidRules(String),
#[error("hmac error: {0}")]
Hmac(String),
#[error(transparent)]
Io(#[from] std::io::Error),
#[error(transparent)]
Json(#[from] serde_json::Error),
#[error(transparent)]
Hex(#[from] hex::FromHexError),
}