Securely manage and retrieve secrets from a Double-O vault. Fetch API keys, load environment variables, and cache secrets with the
ooPython library.
Double-O Secret Manager is a skill that provides tools and guidance for securely managing secrets using the Double-O service. It integrates seamlessly with your development workflow to keep sensitive data safe while remaining easy to use.
- Fetch Secrets — Retrieve secrets securely using a short-lived token
- Load Environment — Load secrets from a vault directly into environment variables
- Secret Caching — Cache secrets in memory with a configurable TTL to reduce API calls
- Python >= 3.8
pip(up to date)
# Standard installation
pip install double-o
# With async and retry support
pip install "double-o[all]"import oo
TOKEN = "YOUR_DOUBLE_O_TOKEN"
try:
api_key = oo.get_secret(TOKEN)
print("Secret fetched successfully.")
except oo.AuthenticationError:
print("Authentication failed. Please check your token.")
except oo.SecretError as e:
print(f"An error occurred: {e}")import oo
import os
TOKEN = "YOUR_VIRTUAL_ENV_TOKEN"
try:
oo.load_env(TOKEN)
openai_api_key = os.environ.get("OPENAI_API_KEY")
print("Environment variables loaded successfully.")
except oo.EnvError as e:
print(f"Failed to load environment variables: {e}")import oo
TOKEN = "YOUR_DOUBLE_O_TOKEN"
# Fetch and cache the secret for 5 minutes (300 seconds)
secret = oo.get_secret(TOKEN, cache_ttl=300)
# Subsequent calls return the cached value
secret_again = oo.get_secret(TOKEN, cache_ttl=300)
# Manually invalidate the cache if needed
oo.invalidate_cache(TOKEN)| Error | Cause | Fix |
|---|---|---|
AuthenticationError |
Token is invalid, expired, or lacks permissions | Verify your token in the Double-O dashboard |
SecretError / EnvError |
Secret or vault not found, or network issue | Check your token and ensure the Double-O service is accessible |
| Installation issues | Incompatible Python version or outdated pip | Use Python >= 3.8 and update pip |
Contributions are welcome! Please see CONTRIBUTING.md for details on how to get started.
This project is licensed under the MIT License. See LICENSE for details.