Sourcing (Valuable)
Introduction
Webhooked's Valuable system provides flexible value sourcing, allowing configuration values to come from multiple sources including environment variables, files, and static references. This enables secure secret management and environment-specific configurations.
Overview
The Valuable pattern allows any configuration value to be sourced from:
# Direct value
secret: "direct-value"
# Listing value
secret:
values: ["array", "value"]
# Environment variable
secret:
valueFrom:
envRef: ENV_VAR_NAME
# File reference
secret:
valueFrom:
fileRef: /path/to/file
# Static reference
secret:
valueFrom:
staticRef: "static,comma,separated"Value Sources
Direct value
The simplest form - values directly in configuration
Environment Variables
Source values from environment variables:
File References
Read values from files (useful for secrets):
Value Sources Ordering
When you provide multiples references, a priority will be applied as following:
Values List
Direct Value
StaticRef
EnvRef
FileRef
Security Best Practices
✅ GOOD: Use external source for secrets
❌ BAD: Hardcoded secret
Use cases
Secret Rotation
Sometimes, you must handle a rotation in your webhook secrets, you can provide both as a comma separated values in multiples ways:
The content of /run/secrets/api-key or WEBHOOK_SECRET can be old_secret,new_secret, when the configuration are reloaded, both secrets are accepted as valide out of the box.
With HashiCorp Vault
With Azure Key Vault
More will coming... If you found a mising case, don't hesitate to open an issue !
Last updated