(kind, hard_code_pattern=None)
return inner
Using this decorator simply registers a function for later use

    Since this is used to pull out metadata about our application,
    and not to modify the functioning of the application itself,
    there is no need to modify the function.

    Use this decorator like this

        @waf_allow('XSS_BODY')
        def my_view(...): ...

    to signify "if you put a WAF in front of this, make sure the XSS_BODY rule does not BLOCK this url pattern"

    For super abstracted setups where getting at the original view is hard
    you can use

        waf_allow('XSS_BODY', hard_code_pattern=r'/url/regex/')

    instead.
Using this decorator simply registers a function for later use
Using this decorator simply registers a function for later use
def waf_allow(kind, hard_code_pattern=None):
    """
    Using this decorator simply registers a function for later use

    Since this is used to pull out metadata about our application,
    and not to modify the functioning of the application itself,
    there is no need to modify the function.

    Use this decorator like this

        @waf_allow('XSS_BODY')
        def my_view(...): ...

    to signify "if you put a WAF in front of this, make sure the XSS_BODY rule does not BLOCK this url pattern"

    For super abstracted setups where getting at the original view is hard
    you can use

        waf_allow('XSS_BODY', hard_code_pattern=r'/url/regex/')

    instead.
    """
    if hard_code_pattern:
        waf_allow.views[kind].add(hard_code_pattern)
        return

    def inner(fn):
        waf_allow.views[kind].add(fn)
        return fn
    return inner
def waf_allow ( kind , hard_code_pattern = None ) : if hard_code_pattern : waf_allow . views [ kind ] . add ( hard_code_pattern ) return def inner ( fn ) : waf_allow . views [ kind ] . add ( fn ) return fn return inner