authorizaton: type checking fix
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
3dbc99fd84
commit
12b1befcbc
|
@ -754,14 +754,9 @@ class Authorization:
|
||||||
else:
|
else:
|
||||||
return None
|
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:
|
if self.max_logins is None:
|
||||||
return False
|
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
|
return self.failed_logins.get(ip_addr, 0) >= self.max_logins
|
||||||
|
|
||||||
def check_authorized(self,
|
def check_authorized(self,
|
||||||
|
|
Loading…
Reference in New Issue