INNER CODE UNIT · Python

is_authorized

OWASP/Python-Honeypot · api/server.py:109

def is_authorized():
    """
    check the validity of API key

    Returns:
        200 HTTP code if it's valid otherwise 401 error

    """
    api_access_key = app.config["OWASP_HONEYPOT_CONFIG"]["api_access_key"]

    key_from_request = get_value_from_request("key")

    if api_access_key is not None and api_access_key != key_from_request:
        abort(401, "invalid API key")
    return True


@app.errorhandler(400)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…