Skip to main content

Cloud Secret Manager

Cloud Secret Manager is a Python package providing a unified interface for managing secrets across multiple cloud providers. With concrete implementations for Azure Key Vault and Google Cloud Secret Manager, this package offers a consistent and simplified API for the creation, retrieval, and management of secrets, tailored for secure and efficient handling in cloud-based applications.

Project Structure

The project is organized as follows:

.
├── README.md
├── cloudsecretmanager
│   ├── __init__.py
│   ├── azure.py                    # Azure Key Vault implementation
│   ├── gcp.py                      # Google Cloud Secret Manager implementation
│   └── secret_manager.py           # Abstract base class for secret managers
├── poetry.lock
├── pyproject.toml
└── tests
    ├── __init__.py
    ├── test_az_mock.py             # Mock tests for Azure implementation
    └── test_az_real_connection.py  # Real connection tests for Azure implementation

Features

  • Unified API: A single, standardized interface for interacting with different cloud secret management services.
  • Cloud Provider Support: Concrete implementations for both Azure Key Vault and Google Cloud Secret Manager.
  • Secure Handling: Designed to promote best practices in secret management for cloud applications.
  • Easy Integration: Simplifies the process of integrating secret management into cloud-based Python applications.

Installation

This package can be installed using pip:

pip install cloudsecretmanager

Usage

To use the Cloud Secret Manager, first import the appropriate class for your cloud provider:

from cloudsecretmanager.azure import AzureKeyVaultManager
from cloudsecretmanager.gcp import GCPSecretManager

Unified API Overview

The Cloud Secret Manager package is designed with a unified API, meaning it offers a consistent set of methods and interfaces for managing secrets, regardless of the underlying cloud provider. This unified approach simplifies secret management in multi-cloud environments and makes the code more maintainable and scalable.

The same set of methods (create, get) can be used for different cloud providers. This consistency greatly simplifies the learning curve when switching between or working with multiple cloud environments.

With a unified API, you can easily switch between cloud providers without significantly altering your codebase. This flexibility is crucial for scenarios where applications might migrate or span multiple cloud services.

Azure Key Vault Example

# Create an instance of AzureKeyVaultManager
azure_manager = AzureKeyVaultManager(vault_url="https://your-vault-url.vault.azure.net/")

# Create or update a secret
azure_manager.create(secret_id="your-secret-id", payload="your-secret-value")

# Retrieve a secret
secret_value = azure_manager.get(secret_id="your-secret-id")

Google Cloud Secret Manager Example

# Create an instance of GCPSecretManager
gcp_manager = GCPSecretManager(project_id="your-gcp-project-id")

# Create or update a secret
gcp_manager.create(secret_id="your-secret-id", payload="your-secret-value")

# Retrieve a secret
secret_value = gcp_manager.get(secret_id="your-secret-id")

Testing

The package includes unit tests for both Azure and GCP implementations. These tests are designed to ensure the integrity and correctness of the package functionalities.

To run the tests, you'll need to have Python and the necessary dependencies installed. You can run the tests directly using the Python unittest module from the root directory of the project.

Follow these steps to execute the tests:

  1. Navigate to the root directory of the project.

  2. Run the tests using the following command:

python -m unittest discover -s tests

Contributing

Contributions to the Cloud Secret Manager are welcome! Please refer to the contributing guidelines for more information.

License

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

Metadata

Release files for cloudsecretmanager 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudsecretmanager 0.2.2
File Size Uploaded
cloudsecretmanager-0.2.2.tar.gz 4.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cloudsecretmanager 0.2.2
File Interpreter ABI Platform
cloudsecretmanager-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.1 kB

Release files / cloudsecretmanager-0.2.2.tar.gz

Download URL cloudsecretmanager-0.2.2.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
45f0cf1979cbf2901fca180d7973ee66e85f024301c869b8b749fdca60720ff5
BLAKE2b-256 checksum
How to use checksums
d6a6a81a92601e5b523dcd4184f711f46d8de33241a113cfdec7a6fc63d70a80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.9.6 Darwin/23.1.0

Release files / cloudsecretmanager-0.2.2-py3-none-any.whl

Download URL cloudsecretmanager-0.2.2-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08ca9fa377428fa370ca9d0de1458c945676378362322eb43cb48fa97bc9cd81
BLAKE2b-256 checksum
How to use checksums
c30f3ee0aada998d6f2dc4a87a376d9805e88fb12d2fed8dcc85da8644a12120
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.9.6 Darwin/23.1.0

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page