lenso-platform-provider 0.1.23

Provider Service host transport for the Lenso backend framework.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use platform_core::{AppError, AppResult, ErrorCode};

pub(crate) fn validate_path_segment(value: &str, message: &'static str) -> AppResult<()> {
    let valid = !value.is_empty()
        && value.chars().all(|character| {
            character.is_ascii_alphanumeric()
                || character == '.'
                || character == '_'
                || character == '-'
        });
    if valid {
        return Ok(());
    }

    Err(AppError::new(ErrorCode::Validation, message))
}