pub struct ProfileConfig {Show 15 fields
pub profile_name: String,
pub display_name: Option<String>,
pub description: Option<String>,
pub version: String,
pub profile_id: Option<String>,
pub author: Option<String>,
pub compliance_scope: Option<String>,
pub revision_date: Option<NaiveDate>,
pub signature: Option<String>,
pub signature_alg: Option<String>,
pub rules: Vec<ProfileRule>,
pub samples: Option<SamplesConfig>,
pub dedupe: Option<DedupeConfig>,
pub post_processing: Option<PostProcessingConfig>,
pub reporting: Option<ReportingConfig>,
}Expand description
The top-level structure representing a redaction profile configuration.
Fields§
§profile_name: String§display_name: Option<String>§description: Option<String>§version: String§profile_id: Option<String>§compliance_scope: Option<String>§revision_date: Option<NaiveDate>§signature: Option<String>§signature_alg: Option<String>§rules: Vec<ProfileRule>§samples: Option<SamplesConfig>§dedupe: Option<DedupeConfig>§post_processing: Option<PostProcessingConfig>§reporting: Option<ReportingConfig>Implementations§
Source§impl ProfileConfig
impl ProfileConfig
pub fn validate(&self, default_config: &RedactionConfig) -> Result<()>
Sourcepub fn verify_signature(&self, raw_bytes: &[u8], key: &[u8]) -> Result<bool>
pub fn verify_signature(&self, raw_bytes: &[u8], key: &[u8]) -> Result<bool>
Verifies the HMAC-SHA256 signature of the profile against the provided secret key.
This method is crucial for ensuring the integrity and authenticity of a profile
loaded from disk. It recalculates the signature from the profile’s content
(excluding the signature field itself) and compares it with the stored signature.
The raw_bytes argument is the full content of the YAML file.
§Arguments
raw_bytes- The complete raw bytes of the YAML file, used to recompute the signature.key- The secret key used to generate the HMAC signature.
Trait Implementations§
Source§impl Clone for ProfileConfig
impl Clone for ProfileConfig
Source§fn clone(&self) -> ProfileConfig
fn clone(&self) -> ProfileConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProfileConfig
impl Debug for ProfileConfig
Source§impl Default for ProfileConfig
impl Default for ProfileConfig
Source§fn default() -> ProfileConfig
fn default() -> ProfileConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProfileConfigwhere
ProfileConfig: Default,
impl<'de> Deserialize<'de> for ProfileConfigwhere
ProfileConfig: Default,
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
Source§impl From<ProfileConfig> for EngineOptions
impl From<ProfileConfig> for EngineOptions
Source§fn from(profile: ProfileConfig) -> Self
fn from(profile: ProfileConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ProfileConfig
impl RefUnwindSafe for ProfileConfig
impl Send for ProfileConfig
impl Sync for ProfileConfig
impl Unpin for ProfileConfig
impl UnsafeUnpin for ProfileConfig
impl UnwindSafe for ProfileConfig
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