Skip to main content

The PAM Secret Server Python SDK

Project description

The pam Secret Server SDK

The pam Secret Server Python SDK contains classes that interact with Secret Server via the REST API.

Install

python -m pip install revbits_ansible

Secret Server

With API key you can authorize the SecretServer class to fetch secrets.

Initializing SecretServer

To instantiate the SecretServer class, it requires a base_url, api_key and an optional api_path_uri (defaults to "/api/v1")

from pam.revbits_ansible.server import ServerSecret

secret_server = SecretServer("https://pam.revbits.com", api_key)

Secrets can be fetched using the get_pam_secret method, which takes a string key of the secret and, returns a decoded value :

secret = secret_server.get_pam_secret('DB_HOST')

print(f"secret: {secret}")
from pam.revbits_ansible.server import ServerSecret

secret = ServerSecret(**secret_server.get_pam_secret('DB_HOST'))

DB_HOST = secret

Create a Build Environment (optional)

The SDK requires Python 3.6 or higher.

First, ensure Python is in $PATH, then run:

# Clone the repo
git clone https://github.com/RevBits/PAM-ansible-plugin
cd PAM-ansible-plugin

# Create a virtual environment
python -m venv venv
. venv/bin/activate

# Install dependencies
python -m pip install --upgrade pip
pip install -r requirements.txt

To build the package, use Flit:

flit build

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

revbits_ansible-1.3.1.tar.gz (8.2 kB view hashes)

Uploaded Source

Built Distribution

revbits_ansible-1.3.1-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

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