Skip to content

Commit bbc71e4

Browse files
authored
docs: auth.py comments/docstrings (#280)
* docs: auth.py comments/docstrings * Newline docstring
1 parent 256a801 commit bbc71e4

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Diff for: zabbix_cli/auth.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ def get_session(self, username: str) -> Optional[SessionInfo]:
9191

9292

9393
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+
"""
9598

9699
root: dict[str, SessionList] = {}
97100
_path: Optional[Path] = PrivateAttr(default=None)
@@ -158,7 +161,7 @@ def save(self, path: Optional[Path] = None, allow_insecure: bool = False) -> Non
158161

159162

160163
class CredentialsType(StrEnum):
161-
"""Types of valid login credentials."""
164+
"""Login credentials type."""
162165

163166
PASSWORD = "username and password"
164167
AUTH_TOKEN = "auth token"
@@ -385,14 +388,14 @@ def _update_application_with_login_info(self, info: LoginInfo) -> None:
385388
"""Update the application state with the login information.
386389
387390
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
390393
- Update config with credentials
391394
- Set Zabbix API version on the TableRenderable base class
392395
"""
393396
from zabbix_cli.models import TableRenderable
394397

395-
# Write auth token file
398+
# Write session file
396399
if info.credentials.username and self.config.app.use_session_file:
397400
sessionfile = self.load_session_file()
398401
if not sessionfile:

0 commit comments

Comments
 (0)