import re


def sanitize(inStr):
    """Hide any sensitive info from the alert"""
    # Key-value pairs of patterns with what to replace them with
    patterns = {
        "https\:\/\/oauth2\:[\d\w]{64}@gitlab\.pavlovia\.org\/.*\.git": "[[OAUTH key hidden]]" # Remove any oauth keys
    }
    # Replace each pattern
    for pattern, repl in patterns.items():
        inStr = re.sub(pattern, repl, inStr)

    return inStr