%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/sdb/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/sdb/vault.pyc

�
���^c@@srdZddlmZmZmZddlZddlZeje	�Z
idd6Zdd�Z
dd�ZdS(uQ
Vault SDB Module

:maintainer:    SaltStack
:maturity:      New
:platform:      all

.. versionadded:: 2016.11.0

This module allows access to Hashicorp Vault using an ``sdb://`` URI.

Base configuration instructions are documented in the execution module docs.
Below are noted extra configuration required for the sdb module, but the base
configuration must also be completed.

Like all sdb modules, the vault module requires a configuration profile to
be configured in either the minion configuration file or a pillar. This profile
requires only setting the ``driver`` parameter to ``vault``:

.. code-block:: yaml

    myvault:
      driver: vault

Once configured you can access data using a URL such as:

.. code-block:: yaml

    password: sdb://myvault/secret/passwords/mypassword

In this URL, ``myvault`` refers to the configuration profile,
``secret/passwords`` is the path where the data resides, and ``mypassword`` is
the key of the data to return.

The above URI is analogous to running the following vault command:

.. code-block:: bash

    $ vault read -field=mypassword secret/passwords
i(tabsolute_importtprint_functiontunicode_literalsNusetuset_cC@s�d|kr5tddd�|jd�\}}n|jdd�\}}y\dj|�}i||6}tdd	||d
|�}|jdkr�|j�ntSWnAtk
r�}tj	dt
|�j|�tj
j|��nXd
S(u3
    Set a key/value pair in the vault service
    u?uversions.warn_untiluNeonu�Using ? to seperate between the path and key for vault has been deprecated and will be removed in {version}.  Please just use a /.u/iuv1/{0}uvault.make_requestuPOSTtjsoni�uFailed to write secret! %s: %sN(t	__utils__tsplittrsplittformattstatus_codetraise_for_statustTruet	Exceptiontlogterrorttypet__name__tsaltt
exceptionstCommandExecutionError(tkeytvaluetprofiletpathturltdatatresponsete((s2/usr/lib/python2.7/site-packages/salt/sdb/vault.pytset_7s(
	
cC@s�d|kr5tddd�|jd�\}}n|jdd�\}}y]dj|�}tdd	||�}|jd
kr�|j�n|j�d}||SWnAtk
r�}tj	dt
|�j|�tj
j|��nXd
S(u,
    Get a value from the vault service
    u?uversions.warn_untiluNeonu�Using ? to seperate between the path and key for vault has been deprecated and will be removed in {version}.  Please just use a /.u/iuv1/{0}uvault.make_requestuGETi�udatauFailed to read secret! %s: %sN(RRRRRR	RRRR
RRRRR(RRRRRRR((s2/usr/lib/python2.7/site-packages/salt/sdb/vault.pytgetXs 
(t__doc__t
__future__RRRtloggingtsalt.exceptionsRt	getLoggerRRt__func_alias__tNoneRR(((s2/usr/lib/python2.7/site-packages/salt/sdb/vault.pyt<module>)s
!

Zerion Mini Shell 1.0