관리-도구
편집 파일: validations.cpython-311.pyc
� b��fD( � � � d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m Z mZmZm Z mZmZmZ ddlmZ ej d� � ZdZd Zd ez dz ez dz ez d z Zdez dz Zdez dz Zdez ez ez dz Z ej dez dz ez dz ej � � ZdZdede fd�Z!dede fd�Z"dedefd�Z# e d eed� d �!� � ed"� � eed� � d# eed$� d%�!� � ed&� � e ed'� � e ee#� � e ed(�!� � � � ed)� � ee e ed*�!� � � � ed+� � eee"d,�!� � ed-� � ee$d.� d/�!� � ed0� � ee$d1� d2�!� � ed3� � ee$d4� d5�!� � ed6� � ee d� � ed7� � ee d� � ed8� � ee d� � i � � Z% e d eed9� d:�!� � ed"� � eed� � ed&� � e ed'� � e ee#� � e ed(�!� � � � ed+� � eee"d,�!� � ed-� � ee$d;� d/�!� � ed0� � ee$d<� d2�!� � ed3� � ee$d=� d5�!� � i� � Z& e i ed>� � eed� � � ed"� � eed� � �d eed?� d �!� � � ed@� � eed� � � edA� � e � edB� � e � edC� � eed� � � edD� � eed� � � edE� � e � edF� � e � edG� � eed� � � edH� � eed� � � edI� � e� edJ� � e� edK� � e� edL� � e � edM� � eed� � � edN� � eed� � edO� � eed� � edP� � eed� � edQ� � eed� � edR� � eed� � edS� � e edT� � e edU� � ei�� � Z'dVe(dWe defdX�Z)dVe(defdY�Z*dVe(defdZ�Z+dVe(defd[�Z,dS )\zE This module contains functions for performing necessary validations � N)� Namespace)�urlparse)�Schema�And�Optional�Regex�SchemaError�Use�Or��read_sys_id�validationsu ¡-zI(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)(?:\.(?:25[0-5]|2[0-4]\d|[0-1]?\d?\d)){3}z[a-zz0-9](?:[a-zz0-9-]{0,61}[a-zz0-9])?z(?:\.(?!-)[a-zz0-9-]{1,63}(?<!-))*z\.(?!-)(?:[a-zz%-]{2,63}|xn--[a-z0-9]{1,59})(?<!-)\.?�(z|localhost)z/^(?:http)s?://(?:[^\s:@/]+(?::[^\s:@/]*)?@)?(?:�|z )(?::\d{2,5})?(?:[/?#][^\s]*)?\Za� (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])�ipaddr�returnc � � t | t � � rdS t j | � � dS # t $ r Y dS w xY w)z� Checks if given IP address is a valid one :param ipaddr: IP address :return: True if IP address is valid, False otherwise FT)� isinstance�int� ipaddress� ip_address� ValueError�r s �U/opt/cloudlinux/venv/lib64/python3.11/site-packages/xray/console_utils/validations.py�is_ip_validr 7 sX � � �&�#��� ��u����V�$�$�$��t��� � � ��u�u����s �/ � =�=c � � t | t � � rdS | dk rdS t j | � � dS # t $ r Y dS w xY w)z� Checks if given IP address is a valid one for IPv4 '*' is also allowed :param ipaddr: IPv4 address :return: True if IPv4 address is valid, False otherwise F�*T)r r r �IPv4Addressr r s r � is_ipv4_validr F sf � � �&�#��� ��u� ��}�}��t����f�%�%�%��t��� � � ��u�u����s �7 � A�A�orig_urlc �<