import gradio as gr import os def get_accepted_ip_passwords(): ip____passwords_accepted = [os.environ.get(f'USER_{i}', None) for i in range(900) if os.environ.get(f'USER_{i}', False)] return ip____passwords_accepted def auth_verification(password, request: gr.Request): ip = request.client.host ip____password = f'{ip}____{password}' ip____passwords_accepted = get_accepted_ip_passwords() can_enter_the_space = ip____password in ip____passwords_accepted return can_enter_the_space