MCPcopy Create free account
hub / github.com/CJackHwang/AIstudioProxyAPI / _handle_auth_file_selection

Method _handle_auth_file_selection

launcher/runner.py:190–223  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 logger.debug(f"Selected launch mode: {self.final_launch_mode}")
189
190 def _handle_auth_file_selection(self):
191 if self.final_launch_mode == "debug" and not self.args.active_auth_json:
192 create_new_auth_choice = (
193 input_with_timeout(
194 " Create and save new auth file? (y/n; Default: n, 15s timeout): ",
195 15,
196 )
197 .strip()
198 .lower()
199 )
200 if create_new_auth_choice == "y":
201 new_auth_filename = ""
202 while not new_auth_filename:
203 new_auth_filename_input = input_with_timeout(
204 " Enter filename to save (without .json, alphanumeric/_-): ",
205 self.args.auth_save_timeout,
206 ).strip()
207 if re.match(r"^[a-zA-Z0-9_-]+$", new_auth_filename_input):
208 new_auth_filename = new_auth_filename_input
209 elif new_auth_filename_input == "":
210 logger.info("Empty input, cancelling new auth creation.")
211 break
212 else:
213 print("Invalid characters, try again.")
214
215 if new_auth_filename:
216 self.args.auto_save_auth = True
217 self.args.auto_save_auth_from_cli = True
218 self.args.save_auth_as = new_auth_filename
219 logger.info(f"Auth will be saved as: {new_auth_filename}.json")
220 if self.effective_active_auth_json_path:
221 self.effective_active_auth_json_path = None
222 else:
223 logger.info("New auth file will not be created.")
224
225 def _check_xvfb(self):
226 if (

Callers 1

runMethod · 0.95

Calls 2

input_with_timeoutFunction · 0.90
infoMethod · 0.80

Tested by

no test coverage detected