MCPcopy
hub / github.com/knownsec/pocsuite3 / check_token

Method check_token

pocsuite3/modules/zoomeye/__init__.py:52–66  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

50 return False
51
52 def check_token(self):
53 if self.token and self.url:
54 if self.token_is_available():
55 return True
56
57 while True:
58 logger.info("Users in mainland China should use https://api.zoomeye.org, "
59 "while other users should use https://api.zoomeye.ai.")
60 self.url = input("ZoomEye Url:").rstrip('/')
61 self.token = getpass.getpass("ZoomEye API token: (input will hidden)")
62 if self.token_is_available():
63 self.write_conf()
64 return True
65 else:
66 logger.error("The ZoomEye api token is incorrect, Please enter the correct api token.")
67
68 def write_conf(self):
69 if not self.parser.has_section("ZoomEye"):

Callers 1

__init__Method · 0.95

Calls 3

token_is_availableMethod · 0.95
write_confMethod · 0.95
errorMethod · 0.80

Tested by

no test coverage detected