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
Built Distribution
File details
Details for the file revbits_ansible-1.3.1.tar.gz
.
File metadata
- Download URL: revbits_ansible-1.3.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aa2e9920944c33c152cc0450bddef2f2a9abb8191e2a623a1f76b74e8b87b110 |
|
MD5 | c993686be91e8698a99c247ccc651f94 |
|
BLAKE2b-256 | f35d260c2a367cafca62a465b1e16decd0f7e54c03610222fbf719cba5546f24 |
File details
Details for the file revbits_ansible-1.3.1-py3-none-any.whl
.
File metadata
- Download URL: revbits_ansible-1.3.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.26.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4622b68cbb559bcc820474ec13417c60e26827f4dc1ecb76417b9ed1b8dc257 |
|
MD5 | 93009a9bb65954368b88f1836f7182d4 |
|
BLAKE2b-256 | a1e89e0345cfae881b7d2ab13d60a539fd9664d16d6f8c220eb7786eafa5600f |