waft.warp_client.handler.warp_client_handler module¶
- class waft.warp_client.handler.warp_client_handler.WarpClientHandler(system: SystemActions)¶
Bases:
ABCBase Class for WARP client handler. Will contain all platform agnostic logic and actions.
- app_data_path: PurePath¶
- capture_warp_diag() Path | PurePath¶
Generates a warp-diag output file and optionally exports it to the local filesystem based on configuration setting DOWNLOAD_WARP_DIAG.
- Returns:
Local or remote warp-diag archive file path
- Return type:
Path | PurePath
- property device_user_email: str¶
Return device user email address
- enroll_in_team(team_enrollment_url: str) str¶
Authenticate and enroll user into Zero Trust organization team.
- Parameters:
team_enrollment_url (str) – Cloudflare Access page to enroll user in team
- Returns:
Device registration token callback URL
- Return type:
str
- generate_warp_diag(output_path: PurePath | None = None, comment: str | None = None, enable_all_routes: bool = False, verbosity: int = 0) PurePath¶
Execute warp-diag command with given parameters and output to the given path
- Parameters:
output_path – Path on node where log should be dumped, Defaults to node temp directory
comment – Add a note to your logs
enable_all_routes – Test an IP address for all included or excluded ranges. This option will make diagnostics collection take longer, but will include more helpful information
verbosity – Number of ‘v’s to include to increase verbosity of logging in warp-diag
- abstractmethod get_warp_dns_mode() str¶
Get the current WARP DNS resolution mode
- abstract property installation: InstallationBase¶
Returns an install manager instance
- mdm: WarpMDMHandler¶
- read_registration_cache(json_file: str) dict¶
Read a cached WARP registration JSON file.
- Parameters:
json_file (str) – Name of a JSON file within the WARP application data path
- Returns:
JSON-formatted WARP registration cached content
- Return type:
dict
- read_registration_secret() dict¶
Read the stored WARP registration secret details.
- Returns:
JSON-formatted WARP registration secret details
- Return type:
dict
- restart_client_service()¶
Restart the WARP client service
- save_warp_diag(output_path: Path | None = None, **kwargs) Path¶
Initiates collection of warp-diag on node and then downloads file to local filesystem
Args: output_path: Location that warp-diag zip shall be copied to on local system **kwargs: Optional keyword arguments to pass to the generate_warp_diag method
- set_cf_warp_api(zero_trust: bool)¶
Set CF_WARP_API to redirect WARP client service API calls
- Parameters:
zero_trust (bool) – True if running in ZeroTrust mode
- set_rust_backtrace()¶
Set RUST_BACKTRACE to full for better debugging in the case of a daemon panic
- set_service_environment_variable(variable: str, value: str | int)¶
Set Environment variable for the WARP client service
- Parameters:
variable – name of the environment variable to set
value – Value to which to set the environment variable
- abstractmethod tunnel_connected() bool¶
Check to see if WARP is routing the connection through the tunnel
- abstract property warp_cli: WarpCliBase¶
Returns a WarpCli instance for the appropriate node
- warp_diag_bin: str = 'warp-diag'¶
- warp_dns_domain: str = 'check.cloudflareresolve.com'¶
- warp_inside_tunnel_ip: str = '162.159.197.4'¶
- warp_service_name: str¶