Wrapper for the StoredSafe REST-like API.
Project description
StoredSafe Python
Transparent Python wrapper for the StoredSafe REST-like API.
Full documentation of the API response signatures and more advanced paramters can be found at the StoredSafe API Documentation.
Examples
For create and edit methods, parameters can be easily passed as keyword arguments, for example:
api.create_vault(vaultname="My Vault", policy=7, description="Sercret")
Or if you're receiving data in dict-format, it can be unpacked into the method:
data = function_that_returns_data()
api.create_vault(**data)
The return value of all methods is a requests
response object. To obtain the data returned by a successful response object, you can use the json()
function:
r = api.list_vaults()
if <= 403:
data = res.json()
if res.ok:
print(data['VAULTS'])
else:
print(data['ERRORS'])
Usage
from storedsafe import StoredSafe
api = StoredSafe('my.site.com', 'my-api-key')
# Auth
api.login_totp('username', 'passphrase', 'otp')
api.login_yubikey('username', 'passphrase', 'otp')
api.logout()
api.check()
# Vaults
api.list_vaults()
api.vault_objects(vault_id) # String or integer
api.vault_members(vault_id)
api.create_vault(**params) # See parameters in API documentation
api.edit_vault(vault_id, **params)
api.delete_vault(vault_id)
# Objects
api.get_object(object_id) # String or integer
api.get_object(object_id, children=True) # children False by default
api.decrypt_object(object_id)
api.create_object(**params)
api.edit_object(object_id, **params)
api.delete_object(object_id)
# Users
api.list_users() # List all users
api.list_users(search_string) # Search for any user matching search_string
api.get_user(user_id)
api.create_user(**params)
api.edit_user(user_id, **params)
api.delete_user(user_id)
# Utils
api.status_values()
api.password_policies()
api.version()
api.generate_password() # Use default settings
api.generate_password(**params)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
storedsafe-1.0.0.tar.gz
(4.0 kB
view hashes)
Built Distribution
storedsafe-1.0.0-py3-none-any.whl
(15.9 kB
view hashes)
Close
Hashes for storedsafe-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5999637e9379ee547fdaab5d0b5007215eb9f9d9d0f77dcc970d3920cb30d335 |
|
MD5 | fa89dce8b1fd625c524c39d6837a3191 |
|
BLAKE2b-256 | e5ccfbf845bdebdfc215a18b5f86c4a8578bbc12fc7b5d177eeec7adba992797 |