|
2 | 2 | import sys |
3 | 3 | import warnings |
4 | 4 | from datetime import datetime |
5 | | -from typing import Optional |
6 | 5 |
|
7 | 6 | from sqlalchemy import func, Table, select, delete |
8 | 7 | from sqlalchemy.dialects.sqlite import Insert # used for upsert |
@@ -350,7 +349,7 @@ def add_admin_user(self, credtype, domain, username, password, host, user_id=Non |
350 | 349 | hosts = self.get_hosts(host) |
351 | 350 |
|
352 | 351 | if users and hosts: |
353 | | - for user, host in zip(users, hosts): |
| 352 | + for user, host in zip(users, hosts, strict=True): |
354 | 353 | user_id = user[0] |
355 | 354 | host_id = host[0] |
356 | 355 | link = {"userid": user_id, "hostid": host_id} |
@@ -693,7 +692,7 @@ def add_domain_backupkey(self, domain: str, pvk: bytes): |
693 | 692 | except Exception as e: |
694 | 693 | nxc_logger.debug(f"Issue while inserting DPAPI Backup Key: {e}") |
695 | 694 |
|
696 | | - def get_domain_backupkey(self, domain: Optional[str] = None): |
| 695 | + def get_domain_backupkey(self, domain: str | None = None): |
697 | 696 | """ |
698 | 697 | Get domain backupkey |
699 | 698 | :domain is the domain fqdn |
@@ -748,11 +747,11 @@ def add_dpapi_secrets( |
748 | 747 | def get_dpapi_secrets( |
749 | 748 | self, |
750 | 749 | filter_term=None, |
751 | | - host: Optional[str] = None, |
752 | | - dpapi_type: Optional[str] = None, |
753 | | - windows_user: Optional[str] = None, |
754 | | - username: Optional[str] = None, |
755 | | - url: Optional[str] = None, |
| 750 | + host: str | None = None, |
| 751 | + dpapi_type: str | None = None, |
| 752 | + windows_user: str | None = None, |
| 753 | + username: str | None = None, |
| 754 | + url: str | None = None, |
756 | 755 | ): |
757 | 756 | """Get dpapi secrets from nxcdb""" |
758 | 757 | q = select(self.DpapiSecrets) |
|
0 commit comments