DEV Community

William Rodriguez
William Rodriguez

Posted on

Zero Boilerplate Imports: The Global Functional API in WAuth

Zero boilerplate imports: The global functional API.

Sometimes you just need to fetch an API key without creating configuration objects and connection handles. wauth's functional API lets you import get and set directly for maximum developer velocity.

Here is the exact production implementation for Global Functional API (set, get, valid, delete):

# Zero boilerplate functional API
from wauth import set, get, valid, list_keys

# Store secret
set("KAFKA_BROKER_PASSWORD", "super_secret_broker_pass")

# Verify in constant-time
if valid("KAFKA_BROKER_PASSWORD", "super_secret_broker_pass"):
    print("Authentication successful!")

# Inspect stored keys
print("Available keys in vault:", list_keys())
Enter fullscreen mode Exit fullscreen mode

Why this changes developer velocity:

  • Direct Function Imports: from wauth import get, set, valid, delete, list_keys.
  • Singleton Vault Management: Reuses default configured vault instances automatically.
  • Immediate Usability: Store and retrieve secrets in 2 lines of Python code.

Zero Pain:

  • Writing auth = WAuth() instantiations across dozens of microservice modules
  • Passing database handles and encryption instances through multiple layers of function arguments
  • Slow developer adoption caused by overly complex object-oriented setup requirements

Explore the verified open-source repository on GitHub or install it via:

pip install wauth
Enter fullscreen mode Exit fullscreen mode

Top comments (0)