secrets¶
The following methods allow for interaction with the ZCC API endpoints for managing secrets.
Methods are accessible via zcc.secrets
Copyright (c) 2023, Zscaler Inc.
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- class SecretsAPI¶
Bases:
APIClient- get_otp(query_params=None)¶
Returns the OTP code for the specified device id.
- Parameters:
query_params (dict) – Query parameters for the request. - device_id (str): Optional alias for udid. If provided, it will be mapped automatically. - udid (str): The actual UDID expected by the API.
- Returns:
(list of OtpResponse, response, error)
- Return type:
Examples
>>> otps, _, err = client.zcc.secrets.get_otp(query_params={'device_id': 'd-29-9b-7c-c5-3f-d2-90-3c-d5-'}) >>> if err: ... print(f"Error retrieving one-time password (OTP): {err}") ... return ... print("OTP:", otps.otp) ... print("Full response:", otps.as_dict())
- get_passwords(query_params=None)¶
Return passwords for the specified username and device OS type.
- Parameters:
query_params (dict, optional) –
A dictionary containing supported filters.
[query_params.os_type]{str}: Filter by device operating system type. Valid options are:ios, android, windows, macos, linux.
[query_params.username]{str}: Filter by enrolled username for the device.- Returns:
(Passwords object, response, error)
- Return type:
Example
>>> passwords, _, err = client.zcc.secrets.get_passwords(query_params={ ... "username": "jdoe@example.com", ... "os_type": "windows" ... }) >>> if err: ... print("Error:", err) >>> else: ... print(passwords.as_dict())