| Server IP : 162.144.4.212 / Your IP : 216.73.216.108 Web Server : Apache System : Linux gator2125.hostgator.com 5.14.0-162.23.1.9991722448259.nf.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jul 31 18:11:45 UTC 2024 x86_64 User : cozeellc ( 2980) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib64/python3.9/site-packages/mercurial/hgweb/__pycache__/ |
Upload File : |
a
�+�b�# � @ s d dl mZ d dlZd dlZd dlZd dlZd dlZddlmZm Z ddl
mZmZmZm
Z
e
jZdZdZdZd Zd
ZdZdZd
ZdZdZdZdd� Zdd� ZegZG dd� de�ZG dd� de�Z dd� Z!d+dd�Z"dd� Z#dd � Z$d!d"� Z%d#d$� Z&d,d%d&�Z'd'd(� Z(d)d*� Z)dS )-� )�absolute_importN� )�getattr�open)�encoding�pycompat� templater�util�� �� i0 i� i� i� i� i� i� i� i� c C s |dgkp||v S )z�Check if username is a member of userlist.
If userlist has a single '*' member, all users are considered members.
Can be overridden by extensions to provide more complex authorization
schemes.
� *� )�ui�usernameZuserlistr
r
�</usr/lib64/python3.9/site-packages/mercurial/hgweb/common.py�ismember+ s r c C sL |j }| �dd�}|r4|r*t| jj||�r4ttd��| �dd�}|r^t| jj||�s^ttd��|dkrx| jsxttd��n|dks�|du r�dS |dkr�|jd kr�d
}tt |��n|jdkr�d}tt |��| �
dd
�r�|jdkr�ttd��| �dd�}|�r|�rt| jj||��rttd��| �dd�}|�r>t| jj||��sHttd��dS )z�Check permission for operation based on request data (including
authentication info). Return if op allowed, else raise an ErrorResponse
exception.� webs deny_reads read not authorizeds
allow_reads pulls pull not authorizedNs uploads PUTs upload requires PUT requests POSTs push requires POST requests push_ssls httpss ssl requireds deny_pushs push not authorizeds
allow-push)
Z
remoteuserZ
configlistr Zrepor �
ErrorResponse�HTTP_UNAUTHORIZEDZ allowpull�method�HTTP_METHOD_NOT_ALLOWEDZ
configboolZ urlscheme�HTTP_FORBIDDEN) ZhgwebZreq�op�userZ deny_readZ
allow_read�msgZdenyZallowr
r
r �
checkauthz5 s4
r c @ s e Zd Zddd�ZdS )r Nc C sD |d u rt |�}t�| t�|�� || _|d u r4g }|| _|| _d S )N)�_statusmessage� Exception�__init__r Zsysstr�code�headers�message)�selfr r! r r
r
r r l s zErrorResponse.__init__)NN)�__name__�
__module__�__qualname__r r
r
r
r r k s r c @ s* e Zd ZdZdd� Zd
dd�Zdd� Zd S )�continuereadera. File object wrapper to handle HTTP 100-continue.
This is used by servers so they automatically handle Expect: 100-continue
request headers. On first read of the request body, the 100 Continue
response is sent. This should trigger the client into actually sending
the request body.
c C s || _ || _d| _d S )NF)�f�_write� continued)r"