WAuth Documentation

Machine-Locked Encrypted Secret Management for Python

PyPI version Python versions Test Coverage Pylint Score

Welcome to the official documentation for WAuth, a Python library that provides simple, secure, machine-locked secret storage using Fernet encryption and SQLite.

🚀 Getting Started

New to WAuth? Start here with installation, setup, and your first encrypted secret.

Getting Started
📚 API Reference

Complete API documentation with classes, methods, and type signatures.

API Reference
📖 Tutorials

Step-by-step guides for common use cases including Docker integration.

Tutorials
❓ FAQ

Frequently asked questions and troubleshooting guide.

Frequently Asked Questions (FAQ)

Integration: WPipe

Combine WAuth with WPipe for powerful stateful pipelines with secure secret management.

🔐 WAuth + WPipe Pipeline

Build secure access control pipelines using WAuth for secrets and WPipe for workflow orchestration.

Tutorials
🚀 WPipe (PyPI)

WPipe is a Python library for building stateful pipelines with conditional logic, tracking, and persistence.

https://pypi.org/project/wpipe/

Example: Access control pipeline using both libraries:

from wauth import WAuth
from wpipe import Pipeline, Condition, state

# Store secrets with WAuth
auth = WAuth(db_path="secrets.db", custom_key="my-key")
auth.set("USER_PASSWORD", "secure-pass")

# Use in WPipe pipeline
@state(name="authenticate")
def authenticate(credentials):
    auth = WAuth(db_path="secrets.db", custom_key="my-key")
    real_pass = auth.get("USER_PASSWORD")
    return {"access_granted": credentials.secret == real_pass}

pipeline = Pipeline(pipeline_name="access_control")
pipeline.set_steps([authenticate, Condition(...)])

See Tutorials for the full example.

Key Features

  • Fernet Encryption: AES-128-CBC encryption with machine-derived keys

  • SQLite Persistence: Automatic secret storage in a local SQLite database

  • Docker Support: Read Docker Swarm/Compose secrets from /run/secrets

  • File Storage: Store and retrieve encrypted files (certificates, keys)

  • Type Safe: Full type hints and Pydantic validation

  • Zero Config: Works out of the box with sensible defaults

Quick Example

from wauth import WAuth

# Initialize
auth = WAuth()

# Store a secret (automatically encrypted with machine-locked key)
auth.set("API_KEY", "sk-12345")

# Retrieve the secret (automatically decrypted)
key = auth.get("API_KEY")
print(key)  # sk-12345

Indices and tables