SIGN IN SIGN UP

Websocket client (#15)

* adding websocket client

* add ping_interval and ping_timeout params

* add ws.ready() and explicit parameters

* websocket tools added

* refactor: consolidate error handling and improve security

* feat(__api_request): consolidate retry logic into _request_with_retry
  - Extract HTTP operations into inner functions (_do_get, _do_post, etc.)
  - Centralize error handling for all HTTP methods
  - Reduces code duplication by ~55 lines

* security(__api_session): remove SSL verification bypass in Vault client
  - Remove verify=False from hvac.Client initialization
  - Make vault attributes private (_vault_url, _vault_path, etc.)
  - Improve vault credentials cleanup in finally block

* feat(__api_session): improve session management
  - Add _new_session() helper for consistent session initialization
  - Add validate parameter to set_api_token() for optional token validation
  - Fix delete_api_token() to return APIResponse instead of Response
  - Use mist_delete() method instead of raw session.delete()

* perf(__init__): implement lazy loading for heavy subpackages
  - Defer api and cli imports until accessed
  - Improves initial import performance

* fix(__logger): correct logging sanitization
  - Use getMessage() instead of direct msg access
  - Clear record.args after sanitization to prevent re-formatting

This refactoring improves maintainability, security, and performance without
changing the public API surface.

* refactor: improve logging format in APIRequest class

* Refactor API parameter handling and improve documentation

- Updated `searchOrgNacClients` and `searchSiteNacClients` to correct status options from 'session_ended' to 'session_stopped'.
- Rearranged parameters in `searchOrgWanClients`, `searchSiteWanClients`, and `searchSiteWirelessClients` for consistency and clarity.
- Added new parameters `cert_expiry_duration` and `psk_name` to `searchSiteNacClients` and `searchSiteWirelessClients` respectively.
- Removed unused parameters and cleaned up query parameter handling in various search functions.
- Enhanced logging and sanitization in `test_logger.py` to ensure sensitive data is properly redacted.
- Deleted obsolete test file `test.py` to streamline the test suite.
- Improved test readability and structure across multiple test files.

* code scanning fix
T
Thomas Munzer committed
2fcb483b1d37c29d2b36e6bc529f86983283d01d
Parent: 1a17b6a
Committed by GitHub <noreply@github.com> on 3/13/2026, 9:19:03 PM