How to use the hvac.api.SystemBackend function in hvac

To help you get started, we’ve selected a few hvac examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.list_enabled_audit_devices,
    )
    def list_audit_backends(self):
        return self.sys.list_enabled_audit_devices()
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.cancel_rekey,
    )
    def cancel_rekey(self):
        return self.sys.cancel_rekey()
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.create_or_update_policy,
    )
    def set_policy(self, name, rules):
        """Add a new or update an existing policy.

        Once a policy is updated, it takes effect immediately to all associated users.

        Supported methods:
            PUT: /sys/policy/{name}. Produces: 204 (empty body)

        :param name: Specifies the name of the policy to create.
        :type name: str | unicode
        :param policy: Specifies the policy document.
        :type policy: str | unicode | dict
        """
        if isinstance(rules, dict):
            rules = json.dumps(rules)
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.list_policies,
    )
    def list_policies(self):
        policies = self.sys.list_policies()['data']['policies']
        return policies
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.initialize,
    )
    def initialize(self, secret_shares=5, secret_threshold=3, pgp_keys=None):
        return self.sys.initialize(
            secret_shares=secret_shares,
            secret_threshold=secret_threshold,
            pgp_keys=pgp_keys,
        )
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.start_root_token_generation,
    )
    def start_generate_root(self, key, otp=False):
        params = {}
        if otp:
            params['otp'] = key
        else:
            params['pgp_key'] = key
        return self.sys.start_root_token_generation(**params)
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.read_backup_keys,
    )
    def get_backed_up_keys(self):
        return self.sys.read_backup_keys()
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.read_lease,
    )
    def read_lease(self, lease_id):
        return self.sys.read_lease(
            lease_id=lease_id,
        )
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.submit_unseal_keys,
    )
    def unseal_multi(self, keys):
        return self.sys.submit_unseal_keys(keys=keys)
github hvac / hvac / hvac / v1 / __init__.py View on Github external
        new_method=api.SystemBackend.tune_mount_configuration,
    )
    def tune_secret_backend(self, backend_type, mount_point=None, default_lease_ttl=None, max_lease_ttl=None, description=None,
                            audit_non_hmac_request_keys=None, audit_non_hmac_response_keys=None, listing_visibility=None,
                            passthrough_request_headers=None):
        if not mount_point:
            mount_point = backend_type

        return self.sys.tune_mount_configuration(
            path=mount_point,
            default_lease_ttl=default_lease_ttl,
            max_lease_ttl=max_lease_ttl,
            description=description,
            audit_non_hmac_request_keys=audit_non_hmac_request_keys,
            audit_non_hmac_response_keys=audit_non_hmac_response_keys,
            listing_visibility=listing_visibility,
            passthrough_request_headers=passthrough_request_headers,