Add a test to verify that all important blueprints have all their methods decorated
This ensures that we don't accidentally add a blueprint method without either explicitly blacklisting or whitelisting anonymous access
This commit is contained in:
parent
075c75d031
commit
477a3fdcdc
6 changed files with 57 additions and 4 deletions
|
@ -15,6 +15,12 @@ def anon_allowed(func):
|
|||
|
||||
def anon_protect(func):
|
||||
""" Marks a method as requiring some form of valid user auth before it can be executed. """
|
||||
func.__anon_protected = True
|
||||
return check_anon_protection(func)
|
||||
|
||||
|
||||
def check_anon_protection(func):
|
||||
""" Validates a method as requiring some form of valid user auth before it can be executed. """
|
||||
@wraps(func)
|
||||
def wrapper(*args, **kwargs):
|
||||
# Skip if anonymous access is allowed.
|
||||
|
|
Reference in a new issue