Module psdi_data_conversion.security

@file psdi_data_conversion/security.py

Created 2025-02-24 by Bryan Gillis.

Functions related to security

Functions

def char_is_safe(s: str)
Expand source code
def char_is_safe(s: str):
    """Checks whether a character is in the set of predefined safe characters.

    Will return False if the string does not contain exactly one character.
    """
    return bool(SAFE_CHAR_RE.fullmatch(s))

Checks whether a character is in the set of predefined safe characters.

Will return False if the string does not contain exactly one character.

def string_is_safe(s: str)
Expand source code
def string_is_safe(s: str):
    """Checks whether a string contains only characters in the predefined list of safe characters.
    """
    return bool(SAFE_STRING_RE.fullmatch(s))

Checks whether a string contains only characters in the predefined list of safe characters.