Linux cpanel.rrshost.in 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC 2022 x86_64
Apache
: 109.123.238.221 | : 172.69.6.168
128 Domain
8.2.28
aev999
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
lib /
mysqlsh /
lib /
python3.13 /
site-packages /
oci /
[ HOME SHELL ]
Name
Size
Permission
Action
_vendor
[ DIR ]
drwxr-xr-x
access_governance_cp
[ DIR ]
drwxr-xr-x
adm
[ DIR ]
drwxr-xr-x
ai_anomaly_detection
[ DIR ]
drwxr-xr-x
ai_document
[ DIR ]
drwxr-xr-x
ai_language
[ DIR ]
drwxr-xr-x
ai_speech
[ DIR ]
drwxr-xr-x
ai_vision
[ DIR ]
drwxr-xr-x
analytics
[ DIR ]
drwxr-xr-x
announcements_service
[ DIR ]
drwxr-xr-x
apigateway
[ DIR ]
drwxr-xr-x
apm_config
[ DIR ]
drwxr-xr-x
apm_control_plane
[ DIR ]
drwxr-xr-x
apm_synthetics
[ DIR ]
drwxr-xr-x
apm_traces
[ DIR ]
drwxr-xr-x
appmgmt_control
[ DIR ]
drwxr-xr-x
artifacts
[ DIR ]
drwxr-xr-x
audit
[ DIR ]
drwxr-xr-x
auth
[ DIR ]
drwxr-xr-x
autoscaling
[ DIR ]
drwxr-xr-x
bastion
[ DIR ]
drwxr-xr-x
bds
[ DIR ]
drwxr-xr-x
blockchain
[ DIR ]
drwxr-xr-x
budget
[ DIR ]
drwxr-xr-x
capacity_management
[ DIR ]
drwxr-xr-x
certificates
[ DIR ]
drwxr-xr-x
certificates_management
[ DIR ]
drwxr-xr-x
cims
[ DIR ]
drwxr-xr-x
circuit_breaker
[ DIR ]
drwxr-xr-x
cloud_bridge
[ DIR ]
drwxr-xr-x
cloud_guard
[ DIR ]
drwxr-xr-x
cloud_migrations
[ DIR ]
drwxr-xr-x
cluster_placement_groups
[ DIR ]
drwxr-xr-x
compute_cloud_at_customer
[ DIR ]
drwxr-xr-x
compute_instance_agent
[ DIR ]
drwxr-xr-x
container_engine
[ DIR ]
drwxr-xr-x
container_instances
[ DIR ]
drwxr-xr-x
core
[ DIR ]
drwxr-xr-x
dashboard_service
[ DIR ]
drwxr-xr-x
data_catalog
[ DIR ]
drwxr-xr-x
data_flow
[ DIR ]
drwxr-xr-x
data_integration
[ DIR ]
drwxr-xr-x
data_labeling_service
[ DIR ]
drwxr-xr-x
data_labeling_service_dataplan...
[ DIR ]
drwxr-xr-x
data_safe
[ DIR ]
drwxr-xr-x
data_science
[ DIR ]
drwxr-xr-x
database
[ DIR ]
drwxr-xr-x
database_management
[ DIR ]
drwxr-xr-x
database_migration
[ DIR ]
drwxr-xr-x
database_tools
[ DIR ]
drwxr-xr-x
delegate_access_control
[ DIR ]
drwxr-xr-x
demand_signal
[ DIR ]
drwxr-xr-x
desktops
[ DIR ]
drwxr-xr-x
devops
[ DIR ]
drwxr-xr-x
disaster_recovery
[ DIR ]
drwxr-xr-x
dns
[ DIR ]
drwxr-xr-x
dts
[ DIR ]
drwxr-xr-x
em_warehouse
[ DIR ]
drwxr-xr-x
email
[ DIR ]
drwxr-xr-x
email_data_plane
[ DIR ]
drwxr-xr-x
encryption
[ DIR ]
drwxr-xr-x
events
[ DIR ]
drwxr-xr-x
file_storage
[ DIR ]
drwxr-xr-x
fleet_apps_management
[ DIR ]
drwxr-xr-x
fleet_software_update
[ DIR ]
drwxr-xr-x
functions
[ DIR ]
drwxr-xr-x
fusion_apps
[ DIR ]
drwxr-xr-x
generative_ai
[ DIR ]
drwxr-xr-x
generative_ai_agent
[ DIR ]
drwxr-xr-x
generative_ai_agent_runtime
[ DIR ]
drwxr-xr-x
generative_ai_inference
[ DIR ]
drwxr-xr-x
generic_artifacts_content
[ DIR ]
drwxr-xr-x
globally_distributed_database
[ DIR ]
drwxr-xr-x
golden_gate
[ DIR ]
drwxr-xr-x
governance_rules_control_plane
[ DIR ]
drwxr-xr-x
healthchecks
[ DIR ]
drwxr-xr-x
identity
[ DIR ]
drwxr-xr-x
identity_data_plane
[ DIR ]
drwxr-xr-x
identity_domains
[ DIR ]
drwxr-xr-x
integration
[ DIR ]
drwxr-xr-x
jms
[ DIR ]
drwxr-xr-x
jms_java_downloads
[ DIR ]
drwxr-xr-x
key_management
[ DIR ]
drwxr-xr-x
license_manager
[ DIR ]
drwxr-xr-x
limits
[ DIR ]
drwxr-xr-x
load_balancer
[ DIR ]
drwxr-xr-x
lockbox
[ DIR ]
drwxr-xr-x
log_analytics
[ DIR ]
drwxr-xr-x
logging
[ DIR ]
drwxr-xr-x
loggingingestion
[ DIR ]
drwxr-xr-x
loggingsearch
[ DIR ]
drwxr-xr-x
management_agent
[ DIR ]
drwxr-xr-x
management_dashboard
[ DIR ]
drwxr-xr-x
marketplace
[ DIR ]
drwxr-xr-x
marketplace_private_offer
[ DIR ]
drwxr-xr-x
marketplace_publisher
[ DIR ]
drwxr-xr-x
media_services
[ DIR ]
drwxr-xr-x
monitoring
[ DIR ]
drwxr-xr-x
mysql
[ DIR ]
drwxr-xr-x
network_firewall
[ DIR ]
drwxr-xr-x
network_load_balancer
[ DIR ]
drwxr-xr-x
nosql
[ DIR ]
drwxr-xr-x
object_storage
[ DIR ]
drwxr-xr-x
oce
[ DIR ]
drwxr-xr-x
oci_control_center
[ DIR ]
drwxr-xr-x
ocvp
[ DIR ]
drwxr-xr-x
oda
[ DIR ]
drwxr-xr-x
onesubscription
[ DIR ]
drwxr-xr-x
ons
[ DIR ]
drwxr-xr-x
opa
[ DIR ]
drwxr-xr-x
opensearch
[ DIR ]
drwxr-xr-x
operator_access_control
[ DIR ]
drwxr-xr-x
opsi
[ DIR ]
drwxr-xr-x
optimizer
[ DIR ]
drwxr-xr-x
os_management
[ DIR ]
drwxr-xr-x
os_management_hub
[ DIR ]
drwxr-xr-x
osp_gateway
[ DIR ]
drwxr-xr-x
osub_billing_schedule
[ DIR ]
drwxr-xr-x
osub_organization_subscription
[ DIR ]
drwxr-xr-x
osub_subscription
[ DIR ]
drwxr-xr-x
osub_usage
[ DIR ]
drwxr-xr-x
pagination
[ DIR ]
drwxr-xr-x
psql
[ DIR ]
drwxr-xr-x
queue
[ DIR ]
drwxr-xr-x
recovery
[ DIR ]
drwxr-xr-x
redis
[ DIR ]
drwxr-xr-x
resource_manager
[ DIR ]
drwxr-xr-x
resource_scheduler
[ DIR ]
drwxr-xr-x
resource_search
[ DIR ]
drwxr-xr-x
retry
[ DIR ]
drwxr-xr-x
rover
[ DIR ]
drwxr-xr-x
sch
[ DIR ]
drwxr-xr-x
secrets
[ DIR ]
drwxr-xr-x
security_attribute
[ DIR ]
drwxr-xr-x
service_catalog
[ DIR ]
drwxr-xr-x
service_manager_proxy
[ DIR ]
drwxr-xr-x
service_mesh
[ DIR ]
drwxr-xr-x
stack_monitoring
[ DIR ]
drwxr-xr-x
streaming
[ DIR ]
drwxr-xr-x
tenant_manager_control_plane
[ DIR ]
drwxr-xr-x
threat_intelligence
[ DIR ]
drwxr-xr-x
usage
[ DIR ]
drwxr-xr-x
usage_api
[ DIR ]
drwxr-xr-x
vault
[ DIR ]
drwxr-xr-x
vbs_inst
[ DIR ]
drwxr-xr-x
visual_builder
[ DIR ]
drwxr-xr-x
vn_monitoring
[ DIR ]
drwxr-xr-x
vulnerability_scanning
[ DIR ]
drwxr-xr-x
waa
[ DIR ]
drwxr-xr-x
waas
[ DIR ]
drwxr-xr-x
waf
[ DIR ]
drwxr-xr-x
work_requests
[ DIR ]
drwxr-xr-x
zpr
[ DIR ]
drwxr-xr-x
__init__.py
6.14
KB
-rw-r--r--
alloy.py
6.52
KB
-rw-r--r--
base_client.py
50.76
KB
-rw-r--r--
config.py
9.98
KB
-rw-r--r--
constants.py
487
B
-rw-r--r--
decorators.py
1.61
KB
-rw-r--r--
exceptions.py
8.67
KB
-rw-r--r--
fips.py
3.17
KB
-rw-r--r--
regions.py
21.44
KB
-rw-r--r--
regions_definitions.py
6.45
KB
-rw-r--r--
request.py
1.97
KB
-rw-r--r--
response.py
2.19
KB
-rw-r--r--
service_endpoints.py
1.97
KB
-rw-r--r--
signer.py
11.49
KB
-rw-r--r--
util.py
13.09
KB
-rw-r--r--
version.py
367
B
-rw-r--r--
waiter.py
7.68
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : alloy.py
# coding: utf-8 # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license. from __future__ import absolute_import import re import os import logging import json import oci.regions import oci.regions_definitions from oci.exceptions import InvalidAlloyConfig OCI_ALLOY_FILE_PATH_ENV_VAR_NAME = "OCI_ALLOY_CONFIG_FILE_PATH" ALLOY_CONFIG_FILE_PATH = os.path.join('~', '.oci', 'alloy-config.json') ALLOY_CONFIG_SERVICE_KEY_NAME = "services" ALLOY_CONFIG_REGIONS_KEY_NAME = "regions" ALLOY_CONFIG_PROVIDER_KEY_NAME = "alloyProvider" ALLOY_CONFIG_REGION_COEXIST_KEY_NAME = "ociRegionCoexist" ALLOY_CONFIG_SCHEMA_REQUIRED_KEYS = (ALLOY_CONFIG_SERVICE_KEY_NAME, ALLOY_CONFIG_REGIONS_KEY_NAME) ALLOY_CONFIG_SCHEMA_OPTIONAL_KEYS = (ALLOY_CONFIG_REGION_COEXIST_KEY_NAME, ALLOY_CONFIG_PROVIDER_KEY_NAME) logger = logging.getLogger(__name__) def _enable_alloy_mode(): if not oci.regions._IS_ALLOY_MODE: logger.debug("Alloy mode detected") oci.regions._IS_ALLOY_MODE = True # Class to define the behavior of the set containing services enabled by the alloy provider class OciSdkEnabledServicesSet(object): def __init__(self): self._enabled_services_set = set() self._cleared_set_for_user_override = False def _clean_up_service_name_string(self, service_name): # By default, the OCI Python SDK uses underscores in the module name for services, however, the service names in # OCI_SDK_ENABLED_SERVICES_SET are expected without underscores, in lower case return re.sub('[^a-z]+', '', service_name.lower()) def add(self, service_name, override_by_user=True): if not self._cleared_set_for_user_override and override_by_user: logger.warning("WARNING: Clearing OCI_SDK_ENABLED_SERVICES_SET to allow user override through code") self.clear() # Set _cleared_set_for_user_override to true, to clear the set only once self._cleared_set_for_user_override = True clean_service_name_string = self._clean_up_service_name_string(service_name) self._enabled_services_set.add(clean_service_name_string) def isempty(self): return len(self._enabled_services_set) == 0 def clear(self): self._enabled_services_set.clear() def is_service_enabled(self, service_name): # If OCI_SDK_ENABLED_SERVICES_SET is empty, all the services are enabled if self.isempty(): return True clean_service_name_string = self._clean_up_service_name_string(service_name) return clean_service_name_string in self._enabled_services_set OCI_SDK_ENABLED_SERVICES_SET = OciSdkEnabledServicesSet() def _validate_alloy_config_schema(alloy_config_json_object): for key in ALLOY_CONFIG_SCHEMA_REQUIRED_KEYS: if key not in alloy_config_json_object: logger.debug("Key {} not found in alloy config".format(key)) raise InvalidAlloyConfig("Alloy config is invalid. Missing required key {}".format(key)) for key in ALLOY_CONFIG_SCHEMA_OPTIONAL_KEYS: if key in alloy_config_json_object and key is ALLOY_CONFIG_REGION_COEXIST_KEY_NAME: if not isinstance(alloy_config_json_object[key], (bool, str)): raise InvalidAlloyConfig("{} must be either bool or str".format(ALLOY_CONFIG_REGION_COEXIST_KEY_NAME)) if isinstance(alloy_config_json_object[key], str) and alloy_config_json_object[key].lower() not in ("true", "false"): raise InvalidAlloyConfig("Allowed values for {} are either true or false".format(ALLOY_CONFIG_REGION_COEXIST_KEY_NAME)) return True def _add_services_from_alloy_config(alloy_config_services_list): if alloy_config_services_list: for service in alloy_config_services_list: OCI_SDK_ENABLED_SERVICES_SET.add(service, override_by_user=False) def _set_alloy_config_from_file(): """ Looks for alloy-config.json and parses enabled services and regions information from it Default location is ~/.oci/alloy-config.json Default location can be overridden by setting environment variable OCI_ALLOY_CONFIG_FILE_PATH """ if os.getenv(OCI_ALLOY_FILE_PATH_ENV_VAR_NAME): config_file_location = os.getenv(OCI_ALLOY_FILE_PATH_ENV_VAR_NAME) logger.debug("Overriding default path for alloy-config.json to {}".format(OCI_ALLOY_FILE_PATH_ENV_VAR_NAME)) else: config_file_location = ALLOY_CONFIG_FILE_PATH expanded_file_location = os.path.expanduser(config_file_location) if os.path.isfile(expanded_file_location): _enable_alloy_mode() logger.debug("Alloy configuration file found at location {}".format(expanded_file_location)) try: with open(expanded_file_location, 'r') as alloy_config_file: alloy_config_raw_file_content = alloy_config_file.read() except (OSError, IOError) as e: logger.debug("Reading alloy configuration file failed because of error: {}".format(e)) raise e try: alloy_config_json_object = json.loads(alloy_config_raw_file_content) except json.JSONDecodeError as e: # Unable to parse the json array logger.debug("Decoding JSON array from alloy configuration file failed because of error: {}".format(e)) raise e if _validate_alloy_config_schema(alloy_config_json_object): # Extract enabled services and regions from alloy_config_json_object _add_services_from_alloy_config(alloy_config_json_object[ALLOY_CONFIG_SERVICE_KEY_NAME]) oci.regions._IS_ALLOY_REGION_COEXIST = alloy_config_json_object.get(ALLOY_CONFIG_REGION_COEXIST_KEY_NAME, False) oci.regions._process_region_metadata_from_alloy_config(alloy_config_json_object[ALLOY_CONFIG_REGIONS_KEY_NAME]) oci.regions.ALLOY_PROVIDER_NAME = alloy_config_json_object.get(ALLOY_CONFIG_PROVIDER_KEY_NAME, False) def _configure_alloy_mode(): """ Determines if alloy specific inputs are provided and configures the SDK for alloy mode Alloy mode is enabled if alloy-config.json file is found """ # Read all the sources to determine alloy mode _set_alloy_config_from_file() _configure_alloy_mode()
Close