o |nh|'@s,ddlmZddlmZGdddeZdS))utils)SystemBackendMixinc@sjeZdZddZdddZ       dddZd d Zd d Z         dd dZddZ dS)MountcCs |jdS)zLists all the mounted secrets engines. Supported methods: POST: /sys/mounts. Produces: 200 application/json :return: JSON response of the request. :rtype: dict z/v1/sys/mounts)_adapterget)selfrH/usr/local/lib/python3.10/dist-packages/hvac/api/system_backend/mount.pylist_mounted_secrets_enginess z"Mount.list_mounted_secrets_enginesNcCs<|d}|d}||d}|dur|S|||S)N/dataoptions)r r)r mount_point option_name default_valuesecrets_engine_pathsecrets_engines_list mount_optionsrrr retrieve_mount_options   zMount.retrieve_mount_optionFc KsH|dur|}|||||||d} | | tjd|d} |jj| | dS)ai Enable a new secrets engine at the given path. Supported methods: POST: /sys/mounts/{path}. Produces: 204 (empty body) :param backend_type: The name of the backend type, such as "github" or "token". :type backend_type: str | unicode :param path: The path to mount the method on. If not provided, defaults to the value of the "backend_type" argument. :type path: str | unicode :param description: A human-friendly description of the mount. :type description: str | unicode :param config: Configuration options for this mount. These are the possible values: * **default_lease_ttl**: The default lease duration, specified as a string duration like "5s" or "30m". * **max_lease_ttl**: The maximum lease duration, specified as a string duration like "5s" or "30m". * **force_no_cache**: Disable caching. * **plugin_name**: The name of the plugin in the plugin catalog to use. * **audit_non_hmac_request_keys**: Comma-separated list of keys that will not be HMAC'd by audit devices in the request data object. * **audit_non_hmac_response_keys**: Comma-separated list of keys that will not be HMAC'd by audit devices in the response data object. * **listing_visibility**: Specifies whether to show this mount in the UI-specific listing endpoint. ("unauth" or "hidden") * **passthrough_request_headers**: Comma-separated list of headers to whitelist and pass from the request to the backend. :type config: dict :param options: Specifies mount type specific options that are passed to the backend. * **version**: The version of the KV to mount. Set to "2" for mount KV v2. :type options: dict :param plugin_name: Specifies the name of the plugin to use based from the name in the plugin catalog. Applies only to plugin backends. :type plugin_name: str | unicode :param local: Specifies if the auth method is a local only. Local auth methods are not replicated nor (if a secondary) removed by replication. :type local: bool :param seal_wrap: Enable seal wrapping for the mount. :type seal_wrap: bool :param kwargs: All dicts are accepted and passed to vault. See your specific secret engine for details on which extra key-word arguments you might want to pass. :type kwargs: dict :return: The response of the request. :rtype: requests.Response N)type descriptionconfigr plugin_namelocal seal_wrap/v1/sys/mounts/{path}pathurljson)updater format_urlrpost) r backend_typerrrrr rrkwargsparamsapi_pathrrr enable_secrets_engines 7 zMount.enable_secrets_enginecCtjd|d}|jj|dS)aDisable the mount point specified by the provided path. Supported methods: DELETE: /sys/mounts/{path}. Produces: 204 (empty body) :param path: Specifies the path where the secrets engine will be mounted. This is specified as part of the URL. :type path: str | unicode :return: The response of the request. :rtype: requests.Response rrr)rr"rdeleterrr'rrr disable_secrets_enginefs zMount.disable_secrets_enginecCr))a&Read the given mount's configuration. Unlike the mounts endpoint, this will return the current time in seconds for each TTL, which may be the system default or a mount-specific value. Supported methods: GET: /sys/mounts/{path}/tune. Produces: 200 application/json :param path: Specifies the path where the secrets engine will be mounted. This is specified as part of the URL. :type path: str | unicode :return: The JSON response of the request. :rtype: requests.Response /v1/sys/mounts/{path}/tunerr*)rr"rrr,rrr read_mount_configurationvszMount.read_mount_configurationc Ks^gd} i} | D]}t|durt|| |<q| | tjd|d}|jj|| dS)a9 Tune configuration parameters for a given mount point. Supported methods: POST: /sys/mounts/{path}/tune. Produces: 204 (empty body) :param path: Specifies the path where the secrets engine will be mounted. This is specified as part of the URL. :type path: str | unicode :param mount_point: The path the associated secret backend is mounted :type mount_point: str :param description: Specifies the description of the mount. This overrides the current stored value, if any. :type description: str :param default_lease_ttl: Default time-to-live. This overrides the global default. A value of 0 is equivalent to the system default TTL :type default_lease_ttl: int :param max_lease_ttl: Maximum time-to-live. This overrides the global default. A value of 0 are equivalent and set to the system max TTL. :type max_lease_ttl: int :param audit_non_hmac_request_keys: Specifies the comma-separated list of keys that will not be HMAC'd by audit devices in the request data object. :type audit_non_hmac_request_keys: list :param audit_non_hmac_response_keys: Specifies the comma-separated list of keys that will not be HMAC'd by audit devices in the response data object. :type audit_non_hmac_response_keys: list :param listing_visibility: Specifies whether to show this mount in the UI-specific listing endpoint. Valid values are "unauth" or "". :type listing_visibility: str :param passthrough_request_headers: Comma-separated list of headers to whitelist and pass from the request to the backend. :type passthrough_request_headers: str :param options: Specifies mount type specific options that are passed to the backend. * **version**: The version of the KV to mount. Set to "2" for mount KV v2. :type options: dict :param force_no_cache: Disable caching. :type force_no_cache: bool :param kwargs: All dicts are accepted and passed to vault. See your specific secret engine for details on which extra key-word arguments you might want to pass. :type kwargs: dict :return: The response from the request. :rtype: request.Response ) default_lease_ttl max_lease_ttlraudit_non_hmac_request_keysaudit_non_hmac_response_keyslisting_visibilitypassthrough_request_headersforce_no_cacher Nr.rr)localsrr!rr"rr#)rrr0r1rr2r3r4r5r r6r%optional_parametersr&optional_parameterr'rrr tune_mount_configurations9  zMount.tune_mount_configurationcCs||d}d}|jj||dS)aMove an already-mounted backend to a new mount point. Supported methods: POST: /sys/remount. Produces: 204 (empty body) :param from_path: Specifies the previous mount point. :type from_path: str | unicode :param to_path: Specifies the new destination mount point. :type to_path: str | unicode :return: The response of the request. :rtype: requests.Response )fromtoz/v1/sys/remountr)rr#)r from_pathto_pathr&r'rrr move_backendszMount.move_backend)N)NNNNNFF) NNNNNNNNN) __name__ __module__ __qualname__r rr(r-r/r:r?rrrr rs0   L QrN)hvacr,hvac.api.system_backend.system_backend_mixinrrrrrr s