Skip to main content

A simple key management system for development environments

Project description

KeyVault

Introduction

Simple, fast, convenient! KeyVault is a lightweight solution for centralizing the management of cloud service keys, particularly in development environments. It provides a centralized point for storing and retrieving API keys and secrets, streamlining the development process and enhancing security practices.

Key features and benefits include:

  • Centralized storage of API keys and secrets
  • Easy integration with development workflows
  • Simplified key management across multiple projects
  • Improved security through centralized access control
  • Configurable storage location for secrets
  • Production-ready with Waitress WSGI server

Features

  • Secure storage of key-value pairs
  • RESTful API for key retrieval and listing
  • Python client for easy integration
  • Configurable secret storage location
  • Logging and improved error handling
  • Waitress WSGI server for production deployment

Prerequisites

  • Python 3.7+

Installation

You can install KeyVault using pip:

pip install keyvault-llm

Or directly from the GitHub repository:

pip install git+https://github.com/ltoscano/keyvault.git

Quickstart

  1. Create a configuration file:

    {
      "OPENAI_API_KEY": "your-api-key-here",
      "OTHER_KEY": "another-key-value"
    }
    

    Save this as config.json in a secure location.

  2. Start the KeyVault server:

    python -m keyvault_llm.server --config /path/to/config.json
    

    By default, the server will run on http://localhost:38680. You can change the host and port using the --host and --port options.

  3. Use the client to interact with the server:

    from keyvault_llm.client import KeyVaultClient
    import logging
    
    logging.basicConfig(level=logging.INFO)
    
    client = KeyVaultClient("http://localhost:38680")
    
    try:
        # Get a specific key
        api_key = client.get_key('OPENAI_API_KEY')
        print("API Key:", api_key)
    
        # List all keys
        keys = client.list_keys()
        print("Available keys:", keys)
    except Exception as e:
        print(f"An error occurred: {str(e)}")
    

Configuration

KeyVault can be configured using command-line arguments when starting the server:

  • --config: Path to the config.json file (default: ~/.keyvault/config.json)
  • --host: Host to bind the server to (default: 0.0.0.0)
  • --port: Port to run the server on (default: 38680)

Example:

python -m keyvault_llm.server --config /path/to/config.json --host 127.0.0.1 --port 8080

Security Considerations

KeyVault is designed for use in development environments. While it can be used in production with proper security measures, it's essential to consider the following:

  1. Access Control: Ensure that the KeyVault server is only accessible within your trusted network.
  2. Secure Configuration: Store your config.json file in a secure location with appropriate file permissions.
  3. HTTPS: For production use, configure KeyVault behind a reverse proxy with HTTPS enabled.
  4. Regular Updates: Keep your KeyVault installation up to date with the latest security patches.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keyvault_llm-0.1.4.dev0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

keyvault_llm-0.1.4.dev0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file keyvault_llm-0.1.4.dev0.tar.gz.

File metadata

  • Download URL: keyvault_llm-0.1.4.dev0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for keyvault_llm-0.1.4.dev0.tar.gz
Algorithm Hash digest
SHA256 01f5442acbaa61f8281fdd70a24c024b086b753ff5cc87d2a90b38486f176506
MD5 a35e2f160b813c3658884f2ebd3ae73c
BLAKE2b-256 ef16a84ac369a1e0e1472685154e70937b56d7093f28dd3bb62979e49aaa4ab0

See more details on using hashes here.

File details

Details for the file keyvault_llm-0.1.4.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for keyvault_llm-0.1.4.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 2aa797379f57d345476a8f51e3380fee5e5a67c8b8c4b1cac7401f52480fb786
MD5 8e73da67c116c4dbd556a86360eb8781
BLAKE2b-256 cab92cd10f3e075d129f32018368b3ad82c2b9318aa1f7bd5d33ffd1ca07069d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page