authorizaton: type checking fix

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-01-24 07:08:23 -05:00
parent 3dbc99fd84
commit 12b1befcbc
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
1 changed files with 1 additions and 6 deletions

View File

@ -754,14 +754,9 @@ class Authorization:
else:
return None
def check_logins_maxed(self, ip_addr: Union[str, IPAddr]) -> bool:
def check_logins_maxed(self, ip_addr: IPAddr) -> bool:
if self.max_logins is None:
return False
if isinstance(ip_addr, str):
try:
ip_addr = ipaddress.ip_address(ip_addr) # type: ignore
except ValueError:
return False
return self.failed_logins.get(ip_addr, 0) >= self.max_logins
def check_authorized(self,