libb.authd

authd(checker_fn, fallback_fn)[source]

Decorator that checks if user meets an auth criterion.

Works with both web.py and Flask frameworks.

Parameters:
  • checker_fn – Callable that returns True if authorized.

  • fallback_fn – Callable to invoke if not authorized.

Returns:

Decorator function.