OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
gslib
/
utils
/
__pycache__
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/11/2025 08:19:48 AM
rwxr-xr-x
📄
__init__.cpython-39.pyc
126 bytes
02/11/2025 08:19:48 AM
rw-r--r--
📄
acl_helper.cpython-39.pyc
9.38 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
arg_helper.cpython-39.pyc
1.01 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
boto_util.cpython-39.pyc
16.46 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
cat_helper.cpython-39.pyc
4.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cloud_api_helper.cpython-39.pyc
3.29 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
constants.cpython-39.pyc
2.88 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
copy_helper.cpython-39.pyc
101.64 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
encryption_helper.cpython-39.pyc
5.84 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
execution_util.cpython-39.pyc
1.06 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
hashing_helper.cpython-39.pyc
15.71 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
iam_helper.cpython-39.pyc
8.61 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ls_helper.cpython-39.pyc
12.4 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
metadata_util.cpython-39.pyc
3.1 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
parallelism_framework_util.cpython-39.pyc
11.79 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
posix_util.cpython-39.pyc
12.46 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retention_util.cpython-39.pyc
8.77 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retry_util.cpython-39.pyc
2.5 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rsync_util.cpython-39.pyc
1.6 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
shim_util.cpython-39.pyc
19.8 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
signurl_helper.cpython-39.pyc
4.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
stet_util.cpython-39.pyc
3.35 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
system_util.cpython-39.pyc
7.9 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
temporary_file_util.cpython-39.pyc
915 bytes
02/11/2025 08:19:49 AM
rw-r--r--
📄
text_util.cpython-39.pyc
12.62 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
translation_helper.cpython-39.pyc
25.67 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
unit_util.cpython-39.pyc
7.01 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
update_util.cpython-39.pyc
3.39 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
user_agent_helper.cpython-39.pyc
1.49 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
version_check.cpython-39.pyc
1.39 KB
02/11/2025 08:19:48 AM
rw-r--r--
📄
wrapped_credentials.cpython-39.pyc
5.81 KB
02/11/2025 08:19:49 AM
rw-r--r--
Editing: boto_util.cpython-39.pyc
Close
a +(Wgh � @ sT d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl Z ddl Z ddlZddlmZ ddl ZddlmZ dd lmZ dd lmZ ddlmZ ddlZddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddl!m"Z" ddl!m#Z# ddl$Z$ddl%m&Z& e j'�r<e(Z)e�*ddd�Z+e�*ddd�Z,da-da.dd� Z/dd� Z0dd� Z1d d!� Z2d"d#� Z3d$d%� Z4d&d'� Z5d(d)� Z6d*d+� Z7d,d-� Z8d.d/� Z9d0d1� Z:d2d3� Z;d4d5� Z<d6d7� Z=e$j>fd8d9�Z?d:d;� Z@d<d=� ZAd>d?� ZBd@dA� ZCdBdC� ZDdDdE� ZEdFdG� ZFdHdI� ZGdJdK� ZHdLdM� ZIdUdOdP�ZJdQdR� ZKdSdT� ZLdS )Vz�Shared utility structures and methods that require importing boto. This module also imports httplib2 (as it is Boto's http transport and closely tied to some of Boto's core functionality) and oauth2client. � )�absolute_import)�print_function)�division)�unicode_literalsN)�config)�NoAuthHandlerFound)�GSConnection)�Provider)�BotoConfigLocations)�context_config)�CommandException)�system_util)�DEFAULT_GCS_JSON_API_VERSION)�DEFAULT_GSUTIL_STATE_DIR)�SSL_TIMEOUT_SEC)�UTF8)�HumanReadableToBytes)�ONE_MIB)� HAS_CRYPTO�Boto� is_secureT�https_validate_certificatesc C s� t j�ddd�} | dkrdS | s�ts�tj�tj�tj dd��atj� t�s�t�dd�}|sbt d ��t�|�}tjd dd�\}}t�|d �}|�|� |�� |atat} | S )z�Configures and returns the CA Certificates file. If one is already configured, use it. Otherwise, use the cert roots distributed with gsutil. Returns: string filename of the certs file to use. r Zca_certificates_fileN�system�datazcacerts.txt�gslibzdata/cacerts.txtzACertificates file not found. Please reinstall gsutil from scratchz.txtzgsutil-cacerts)�suffix�prefix�w)�botor �get�configured_certs_file�os�path�abspath�joinr � GSLIB_DIR�exists�pkgutil�get_datar �six� ensure_str�tempfile�mkstemp�fdopen�write�close�temp_certs_file)Z certs_fileZ certs_data�fd�fname�f� r4 �$/opt/gsutil/gslib/utils/boto_util.py�ConfigureCertsFileB s* � r6 c C sZ t � sVt�dd�rJtsJt�� r4td�t� d����qVtd�t� d����nddl m} dS ) zASets up no-op auth handler if no boto credentials are configured.�Credentials�gs_service_client_id� aI Your gsutil is configured with an OAuth2 service account, but you do not have PyOpenSSL or PyCrypto 2.6 or later installed. Service account authentication requires one of these libraries; please reactivate your service account via the gcloud auth command and ensure any gcloud packages necessary for service accounts are present.a( Your gsutil is configured with an OAuth2 service account, but you do not have PyOpenSSL or PyCrypto 2.6 or later installed. Service account authentication requires one of these libraries; please install either of them to proceed, or configure a different type of credentials with "gsutil config".r ��no_op_auth_pluginN)�HasConfiguredCredentialsr � has_optionr r �InvokedViaCloudSdkr r$ �textwrap�wrapr r; r: r4 r4 r5 �ConfigureNoOpAuthIfNeededl s ��� �� rA c C s t S �N)r r4 r4 r4 r5 �GetCertsFile� s rC c C s t r t gS g S )zHReturns a list of temp files to delete (if possible) when program exits.)r0 r4 r4 r4 r5 �GetCleanupFiles� s rD c C s� t } dtjv r| �tjd � tj�tj�d�dd�}tj�|�rL| �|� g }| D ]P}z8t|d�� |�|� W d � n1 s�0 Y W qT t y� Y qT0 qT|S )zFReturns a list of the path(s) to the boto config file(s) to be loaded.�AWS_CREDENTIAL_FILE�~z.aws�credentials�rN) r r! �environ�appendr"