Skip to main content

CursorSecureExtract

Trait CursorSecureExtract 

Source
pub trait CursorSecureExtract {
    // Required methods
    fn extract_whitelisted_fields(
        &self,
        fields: &[String],
    ) -> Result<Vec<CursorValue>, CursorError>;
    fn encode(_cursor: &Cursor) -> Result<String, CursorError>;
    fn decode(_encoded: &str) -> Result<Vec<FilterValue>, CursorError>;
}
Expand description

Security-First Cursor Field Whitelist Trait

This trait enforces a whitelist-based security model for cursor pagination fields. Implementors MUST explicitly whitelist each allowed field to prevent field injection attacks.

Required Methods§

Source

fn extract_whitelisted_fields( &self, fields: &[String], ) -> Result<Vec<CursorValue>, CursorError>

Source

fn encode(_cursor: &Cursor) -> Result<String, CursorError>

Encode cursor to string token (JSON feature disabled)

Source

fn decode(_encoded: &str) -> Result<Vec<FilterValue>, CursorError>

Decode string token to FilterValue vector (JSON feature disabled)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§