in src/asfquart/auth.py [0:0]
def require_with_args(original_func: typing.Callable):
# If decorated without keywords, func disappears in the outer scope and is replaced with all_of,
# so we account for this by swapping around the arguments just in time if needed.
if not asyncio.iscoroutinefunction(func):
return functools.wraps(original_func)(
functools.partial(
require_wrapper,
original_func,
all_of=requirements_to_iter(all_of or func),
any_of=requirements_to_iter(any_of),
)
)
return functools.wraps(original_func)(
functools.partial(
require_wrapper, original_func, all_of=requirements_to_iter(all_of), any_of=requirements_to_iter(any_of)
)
)