File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def __init__(self):
127127 self .session .headers .update ({"Authorization" : "Bearer %s" % os .getenv ("CF_TOKEN" )})
128128 super ().__init__ ()
129129
130- def get_old_ips (self ) -> dict :
130+ def get_old_ips (self ) -> list :
131131 cache = self .r .get (self .key )
132132 if cache :
133133 cache = json .loads (cache )
@@ -137,7 +137,7 @@ def get_old_ips(self) -> dict:
137137 return cache
138138 else :
139139 data = self .session .get (self .endpoint ).json ()
140- result = data .get ("result" , [])
140+ result = data .get ("result" ) or []
141141 cursor = data .get ("result_info" , {}).get ("cursors" , {}).get ("after" )
142142 while cursor :
143143 logging .info ("Fetching next page with cursor %s" , cursor )
@@ -148,6 +148,8 @@ def get_old_ips(self) -> dict:
148148 return result
149149
150150 def ban_new_ip (self , ip ):
151+ # disable it
152+ return
151153 if ":" in ip :
152154 ip = ip .rsplit (":" , 4 )[0 ] + "::/64"
153155 old_ips = [d ["ip" ] for d in self .get_old_ips ()]
You can’t perform that action at this time.
0 commit comments