o |nh @s ddlmZGdddeZdS))SystemBackendMixinc@s8eZdZddZddZddZd d d Zdd d ZdS)SealcCs|}|dS)zvDetermine if Vault is sealed. :return: True if Vault is seal, False otherwise. :rtype: bool sealed)read_seal_status)self seal_statusrG/usr/local/lib/python3.10/dist-packages/hvac/api/system_backend/seal.py is_sealedszSeal.is_sealedcCd}|jj|dS)aRead the seal status of the Vault. This is an unauthenticated endpoint. Supported methods: GET: /sys/seal-status. Produces: 200 application/json :return: The JSON response of the request. :rtype: dict z/v1/sys/seal-statusurl)_adaptergetrapi_pathrrr rs zSeal.read_seal_statuscCr )axSeal the Vault. In HA mode, only an active node can be sealed. Standby nodes should be restarted to get the same effect. Requires a token with root policy or sudo capability on the path. Supported methods: PUT: /sys/seal. Produces: 204 (empty body) :return: The response of the request. :rtype: requests.Response z /v1/sys/sealr rputrrrr seals z Seal.sealNFcCs>d|i}|s|dur||d<n|r||d<d}|jj||dS)aEnter a single master key share to progress the unsealing of the Vault. If the threshold number of master key shares is reached, Vault will attempt to unseal the Vault. Otherwise, this API must be called multiple times until that threshold is met. Either the key or reset parameter must be provided; if both are provided, reset takes precedence. Supported methods: PUT: /sys/unseal. Produces: 200 application/json :param key: Specifies a single master key share. This is required unless reset is true. :type key: str | unicode :param reset: Specifies if previously-provided unseal keys are discarded and the unseal process is reset. :type reset: bool :param migrate: Available in 1.0 Beta - Used to migrate the seal from shamir to autoseal or autoseal to shamir. Must be provided on all unseal key calls. :type: migrate: bool :return: The JSON response of the request. :rtype: dict migrateNkeyresetz/v1/sys/unseal)r jsonr)rrrrparamsrrrr submit_unseal_key/s  zSeal.submit_unseal_keycCs.d}|D]}|j||d}|ds|Sq|S)aEnter multiple master key share to progress the unsealing of the Vault. :param keys: List of master key shares. :type keys: List[str] :param migrate: Available in 1.0 Beta - Used to migrate the seal from shamir to autoseal or autoseal to shamir. Must be provided on all unseal key calls. :type: migrate: bool :return: The JSON response of the last unseal request. :rtype: dict N)rrr)r)rkeysrresultrrrr submit_unseal_keysSs zSeal.submit_unseal_keys)NFF)F)__name__ __module__ __qualname__r rrrrrrrr rs   $rN),hvac.api.system_backend.system_backend_mixinrrrrrr s