@@ -91,7 +91,10 @@ def get_session(self, username: str) -> Optional[SessionInfo]:
91
91
92
92
93
93
class SessionFile (RootModel [dict [str , SessionList ]]):
94
- """Contents of a session file."""
94
+ """Contents of a session file.
95
+
96
+ Root model that wraps a dict of URLs to `SessionList` objects.
97
+ """
95
98
96
99
root : dict [str , SessionList ] = {}
97
100
_path : Optional [Path ] = PrivateAttr (default = None )
@@ -158,7 +161,7 @@ def save(self, path: Optional[Path] = None, allow_insecure: bool = False) -> Non
158
161
159
162
160
163
class CredentialsType (StrEnum ):
161
- """Types of valid login credentials."""
164
+ """Login credentials type ."""
162
165
163
166
PASSWORD = "username and password"
164
167
AUTH_TOKEN = "auth token"
@@ -385,14 +388,14 @@ def _update_application_with_login_info(self, info: LoginInfo) -> None:
385
388
"""Update the application state with the login information.
386
389
387
390
Includes the following:
388
- - Write auth token file if configured
389
- - Add username to logs
391
+ - Write session file if configured
392
+ - Add username to log records context
390
393
- Update config with credentials
391
394
- Set Zabbix API version on the TableRenderable base class
392
395
"""
393
396
from zabbix_cli .models import TableRenderable
394
397
395
- # Write auth token file
398
+ # Write session file
396
399
if info .credentials .username and self .config .app .use_session_file :
397
400
sessionfile = self .load_session_file ()
398
401
if not sessionfile :
0 commit comments