Module security

Module security 

Source
Expand description

Security utilities for protocol handling

This module provides security-related utilities including content-type whitelisting, message validation, and safety checks.

§Content-Type Whitelist

By default, only safe serialization formats are allowed. Pickle is explicitly blocked due to security concerns (arbitrary code execution).

§Example

use celers_protocol::security::{ContentTypeWhitelist, SecurityPolicy};

let policy = SecurityPolicy::strict();
assert!(policy.is_content_type_allowed("application/json"));
assert!(!policy.is_content_type_allowed("application/x-python-pickle"));

Structs§

ContentTypeWhitelist
Content-type whitelist for allowed serialization formats
SecurityPolicy
Security policy for message handling

Enums§

SecurityError
Security validation error

Functions§

is_unsafe_content_type
Check if a content type is known to be unsafe