Skip to content

About

Securely manage and retrieve secrets from a Double-O vault. Fetch API keys, load environment variables, and cache secrets with the oo Python library.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Double-O Secret Manager

Securely manage and retrieve secrets from a Double-O vault. Fetch API keys, load environment variables, and cache secrets with the oo Python library.

Overview

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.

Core Capabilities

  • 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

Installation

Prerequisites

  • Python >= 3.8
  • pip (up to date)

Setup

# Standard installation
pip install double-o

# With async and retry support
pip install "double-o[all]"

Usage

Fetching a Single Secret

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}")

Loading Secrets into Environment Variables

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}")

Caching Secrets

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)

Troubleshooting

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

Contributing

Contributions are welcome! Please see CONTRIBUTING.md for details on how to get started.

License

This project is licensed under the MIT License. See LICENSE for details.

About

Securely manage and retrieve secrets from a Double-O vault. Fetch API keys, load environment variables, and cache secrets with the oo Python library.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors