duck.secretsΒΆ
Provides utilities for generating and managing secure secrets and tokens for Duck applications.
This module generates and manages various secrets, including URL-safe tokens, ASCII-based secrets, and randomized domain names. The secrets are stored in environment variables to ensure they remain accessible and secure throughout the application lifecycle.
Main Components:
generate_secret(): Generates a URL-safe, cryptographically secure token.generate_ascii_secret(): Generates a secure ASCII-only token for specific cases.generate_random_domain(): Provides a randomized domain name for secure communication.
Environment Variables:
DXS: Stores a URL-safe token, generated if not already set.RXS: Stores an ASCII-based token, generated if not already set, used in secret headers.DXSD: Stores a randomized domain name, generated if not already set.
These environment variables are intended to enhance security by obfuscating sensitive values. When variables are not set initially, secure values are generated and assigned to them dynamically.
Module ContentsΒΆ
FunctionsΒΆ
Generates a secure random URL-safe token. |