oci 2.118.1__py3-none-any.whl → 2.118.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oci/access_governance_cp/access_governance_cp_client.py +8 -8
- oci/adm/application_dependency_management_client.py +36 -36
- oci/ai_anomaly_detection/anomaly_detection_client.py +36 -36
- oci/ai_document/ai_service_document_client.py +22 -22
- oci/ai_language/ai_service_language_client.py +36 -36
- oci/ai_speech/ai_service_speech_client.py +9 -9
- oci/ai_vision/ai_service_vision_client.py +25 -25
- oci/analytics/analytics_client.py +23 -23
- oci/announcements_service/announcement_client.py +4 -4
- oci/announcements_service/announcement_subscription_client.py +9 -9
- oci/announcements_service/announcements_preferences_client.py +4 -4
- oci/apigateway/api_gateway_client.py +21 -21
- oci/apigateway/deployment_client.py +6 -6
- oci/apigateway/gateway_client.py +6 -6
- oci/apigateway/subscribers_client.py +6 -6
- oci/apigateway/usage_plans_client.py +6 -6
- oci/apigateway/work_requests_client.py +5 -5
- oci/apm_config/config_client.py +8 -8
- oci/apm_control_plane/apm_domain_client.py +14 -14
- oci/apm_synthetics/apm_synthetic_client.py +28 -28
- oci/apm_traces/query_client.py +2 -2
- oci/apm_traces/trace_client.py +4 -4
- oci/application_migration/application_migration_client.py +19 -19
- oci/appmgmt_control/appmgmt_control_client.py +8 -8
- oci/artifacts/artifacts_client.py +32 -32
- oci/audit/audit_client.py +3 -3
- oci/auth/__init__.py +0 -4
- oci/autoscaling/auto_scaling_client.py +11 -11
- oci/bastion/bastion_client.py +15 -15
- oci/bds/bds_client.py +51 -51
- oci/blockchain/blockchain_platform_client.py +27 -27
- oci/budget/budget_client.py +10 -10
- oci/certificates/certificates_client.py +5 -5
- oci/certificates_management/certificates_management_client.py +32 -32
- oci/cims/incident_client.py +8 -8
- oci/cims/user_client.py +1 -1
- oci/cloud_bridge/common_client.py +5 -5
- oci/cloud_bridge/discovery_client.py +14 -14
- oci/cloud_bridge/inventory_client.py +16 -16
- oci/cloud_bridge/ocb_agent_svc_client.py +23 -23
- oci/cloud_guard/cloud_guard_client.py +133 -133
- oci/cloud_migrations/migration_client.py +43 -43
- oci/compute_cloud_at_customer/compute_cloud_at_customer_client.py +12 -12
- oci/compute_instance_agent/compute_instance_agent_client.py +6 -6
- oci/compute_instance_agent/plugin_client.py +2 -2
- oci/compute_instance_agent/pluginconfig_client.py +1 -1
- oci/container_engine/container_engine_client.py +44 -44
- oci/container_instances/container_instance_client.py +18 -18
- oci/core/blockstorage_client.py +60 -60
- oci/core/compute_client.py +99 -99
- oci/core/compute_management_client.py +32 -32
- oci/core/virtual_network_client.py +242 -242
- oci/dashboard_service/dashboard_client.py +6 -6
- oci/dashboard_service/dashboard_group_client.py +6 -6
- oci/data_catalog/data_catalog_client.py +147 -147
- oci/data_flow/data_flow_client.py +42 -42
- oci/data_integration/data_integration_client.py +163 -163
- oci/data_labeling_service/data_labeling_management_client.py +17 -17
- oci/data_labeling_service_dataplane/data_labeling_client.py +15 -15
- oci/data_safe/data_safe_client.py +252 -252
- oci/data_science/data_science_client.py +91 -91
- oci/database/database_client.py +327 -327
- oci/database_management/db_management_client.py +182 -182
- oci/database_management/diagnosability_client.py +4 -4
- oci/database_management/managed_my_sql_databases_client.py +6 -6
- oci/database_management/perfhub_client.py +1 -1
- oci/database_management/sql_tuning_client.py +17 -17
- oci/database_migration/database_migration_client.py +41 -41
- oci/database_tools/database_tools_client.py +23 -23
- oci/devops/devops_client.py +89 -89
- oci/disaster_recovery/disaster_recovery_client.py +29 -29
- oci/dns/dns_client.py +52 -52
- oci/dts/appliance_export_job_client.py +6 -6
- oci/dts/shipping_vendors_client.py +1 -1
- oci/dts/transfer_appliance_client.py +8 -8
- oci/dts/transfer_appliance_entitlement_client.py +3 -3
- oci/dts/transfer_device_client.py +5 -5
- oci/dts/transfer_job_client.py +6 -6
- oci/dts/transfer_package_client.py +7 -7
- oci/em_warehouse/em_data_lake_client.py +13 -13
- oci/em_warehouse/em_warehouse_client.py +13 -13
- oci/email/email_client.py +25 -25
- oci/events/events_client.py +6 -6
- oci/file_storage/file_storage_client.py +50 -50
- oci/fleet_software_update/fleet_software_update_client.py +44 -44
- oci/functions/functions_invoke_client.py +1 -1
- oci/functions/functions_management_client.py +16 -16
- oci/fusion_apps/data_masking_activity_client.py +3 -3
- oci/fusion_apps/fusion_applications_client.py +39 -39
- oci/fusion_apps/fusion_environment_client.py +15 -15
- oci/fusion_apps/fusion_environment_family_client.py +8 -8
- oci/fusion_apps/refresh_activity_client.py +4 -4
- oci/fusion_apps/scheduled_activity_client.py +2 -2
- oci/fusion_apps/service_attachment_client.py +2 -2
- oci/generic_artifacts_content/generic_artifacts_content_client.py +3 -3
- oci/golden_gate/golden_gate_client.py +61 -61
- oci/governance_rules_control_plane/governance_rule_client.py +15 -15
- oci/governance_rules_control_plane/work_request_client.py +5 -5
- oci/healthchecks/health_checks_client.py +17 -17
- oci/identity/identity_client.py +145 -145
- oci/identity_data_plane/dataplane_client.py +2 -2
- oci/identity_domains/identity_domains_client.py +300 -300
- oci/integration/integration_instance_client.py +15 -15
- oci/jms/java_management_service_client.py +66 -66
- oci/jms_java_downloads/java_download_client.py +25 -25
- oci/key_management/ekm_client.py +5 -5
- oci/key_management/kms_crypto_client.py +6 -6
- oci/key_management/kms_management_client.py +21 -21
- oci/key_management/kms_vault_client.py +14 -14
- oci/license_manager/license_manager_client.py +18 -18
- oci/limits/limits_client.py +4 -4
- oci/limits/quotas_client.py +7 -7
- oci/load_balancer/load_balancer_client.py +61 -61
- oci/lockbox/lockbox_client.py +23 -23
- oci/log_analytics/log_analytics_client.py +193 -193
- oci/logging/logging_management_client.py +30 -30
- oci/loggingingestion/logging_client.py +1 -1
- oci/loggingsearch/log_search_client.py +1 -1
- oci/management_agent/management_agent_client.py +23 -23
- oci/management_dashboard/dashx_apis_client.py +14 -14
- oci/marketplace/account_client.py +2 -2
- oci/marketplace/marketplace_client.py +30 -30
- oci/marketplace_publisher/marketplace_publisher_client.py +71 -71
- oci/media_services/media_services_client.py +48 -48
- oci/media_services/media_stream_client.py +2 -2
- oci/monitoring/monitoring_client.py +13 -13
- oci/mysql/channels_client.py +7 -7
- oci/mysql/db_backups_client.py +6 -6
- oci/mysql/db_system_client.py +17 -17
- oci/mysql/mysqlaas_client.py +7 -7
- oci/mysql/replicas_client.py +5 -5
- oci/mysql/work_requests_client.py +4 -4
- oci/network_firewall/network_firewall_client.py +80 -80
- oci/network_load_balancer/network_load_balancer_client.py +34 -34
- oci/nosql/nosql_client.py +24 -24
- oci/object_storage/object_storage_client.py +50 -50
- oci/oce/oce_instance_client.py +10 -10
- oci/oci_control_center/occ_metrics_client.py +3 -3
- oci/ocvp/cluster_client.py +5 -5
- oci/ocvp/esxi_host_client.py +8 -8
- oci/ocvp/sddc_client.py +14 -14
- oci/ocvp/work_request_client.py +4 -4
- oci/oda/management_client.py +56 -56
- oci/oda/oda_client.py +17 -17
- oci/oda/odapackage_client.py +7 -7
- oci/onesubscription/billing_schedule_client.py +1 -1
- oci/onesubscription/commitment_client.py +2 -2
- oci/onesubscription/computed_usage_client.py +3 -3
- oci/onesubscription/invoice_summary_client.py +2 -2
- oci/onesubscription/organization_subscription_client.py +1 -1
- oci/onesubscription/ratecard_client.py +1 -1
- oci/onesubscription/subscribed_service_client.py +2 -2
- oci/onesubscription/subscription_client.py +1 -1
- oci/ons/notification_control_plane_client.py +6 -6
- oci/ons/notification_data_plane_client.py +10 -10
- oci/opa/opa_instance_client.py +11 -11
- oci/opensearch/opensearch_cluster_backup_client.py +4 -4
- oci/opensearch/opensearch_cluster_client.py +14 -14
- oci/operator_access_control/access_requests_client.py +9 -9
- oci/operator_access_control/operator_actions_client.py +2 -2
- oci/operator_access_control/operator_control_assignment_client.py +6 -6
- oci/operator_access_control/operator_control_client.py +6 -6
- oci/opsi/operations_insights_client.py +175 -175
- oci/optimizer/optimizer_client.py +26 -26
- oci/os_management/event_client.py +8 -8
- oci/os_management/os_management_client.py +69 -69
- oci/os_management_hub/lifecycle_environment_client.py +11 -11
- oci/os_management_hub/managed_instance_client.py +22 -22
- oci/os_management_hub/managed_instance_group_client.py +22 -22
- oci/os_management_hub/management_station_client.py +8 -8
- oci/os_management_hub/onboarding_client.py +5 -5
- oci/os_management_hub/reporting_managed_instance_client.py +3 -3
- oci/os_management_hub/scheduled_job_client.py +6 -6
- oci/os_management_hub/software_source_client.py +22 -22
- oci/os_management_hub/work_request_client.py +4 -4
- oci/osp_gateway/address_rule_service_client.py +1 -1
- oci/osp_gateway/address_service_client.py +2 -2
- oci/osp_gateway/invoice_service_client.py +5 -5
- oci/osp_gateway/subscription_service_client.py +5 -5
- oci/osub_billing_schedule/billing_schedule_client.py +1 -1
- oci/osub_organization_subscription/organization_subscription_client.py +1 -1
- oci/osub_subscription/commitment_client.py +2 -2
- oci/osub_subscription/ratecard_client.py +1 -1
- oci/osub_subscription/subscription_client.py +1 -1
- oci/osub_usage/computed_usage_client.py +3 -3
- oci/psql/postgresql_client.py +33 -33
- oci/queue/queue_admin_client.py +11 -11
- oci/queue/queue_client.py +8 -8
- oci/recovery/database_recovery_client.py +23 -23
- oci/redis/redis_cluster_client.py +11 -11
- oci/resource_manager/resource_manager_client.py +52 -52
- oci/resource_search/resource_search_client.py +3 -3
- oci/rover/rover_bundle_client.py +8 -8
- oci/rover/rover_cluster_client.py +8 -8
- oci/rover/rover_entitlement_client.py +6 -6
- oci/rover/rover_node_client.py +15 -15
- oci/rover/shape_client.py +1 -1
- oci/rover/work_requests_client.py +5 -5
- oci/sch/service_connector_client.py +12 -12
- oci/secrets/secrets_client.py +3 -3
- oci/service_catalog/service_catalog_client.py +26 -26
- oci/service_manager_proxy/service_manager_proxy_client.py +2 -2
- oci/service_mesh/service_mesh_client.py +48 -48
- oci/stack_monitoring/stack_monitoring_client.py +58 -58
- oci/streaming/stream_admin_client.py +18 -18
- oci/streaming/stream_client.py +8 -8
- oci/tenant_manager_control_plane/domain_client.py +5 -5
- oci/tenant_manager_control_plane/domain_governance_client.py +5 -5
- oci/tenant_manager_control_plane/governance_client.py +2 -2
- oci/tenant_manager_control_plane/link_client.py +3 -3
- oci/tenant_manager_control_plane/orders_client.py +2 -2
- oci/tenant_manager_control_plane/organization_client.py +10 -10
- oci/tenant_manager_control_plane/recipient_invitation_client.py +5 -5
- oci/tenant_manager_control_plane/sender_invitation_client.py +5 -5
- oci/tenant_manager_control_plane/subscription_client.py +11 -11
- oci/tenant_manager_control_plane/work_request_client.py +4 -4
- oci/threat_intelligence/threatintel_client.py +5 -5
- oci/usage/resources_client.py +2 -2
- oci/usage/rewards_client.py +6 -6
- oci/usage/usagelimits_client.py +1 -1
- oci/usage_api/usageapi_client.py +28 -28
- oci/vault/vaults_client.py +11 -11
- oci/vbs_inst/vbs_instance_client.py +10 -10
- oci/version.py +1 -1
- oci/visual_builder/vb_instance_client.py +13 -13
- oci/vn_monitoring/vn_monitoring_client.py +12 -12
- oci/vulnerability_scanning/vulnerability_scanning_client.py +58 -58
- oci/waa/waa_client.py +13 -13
- oci/waa/work_request_client.py +4 -4
- oci/waas/redirect_client.py +6 -6
- oci/waas/waas_client.py +66 -66
- oci/waf/waf_client.py +24 -24
- oci/work_requests/work_request_client.py +4 -4
- {oci-2.118.1.dist-info → oci-2.118.2.dist-info}/METADATA +1 -2
- {oci-2.118.1.dist-info → oci-2.118.2.dist-info}/RECORD +239 -240
- oci/auth/signers/yubikey_signer.py +0 -140
- {oci-2.118.1.dist-info → oci-2.118.2.dist-info}/LICENSE.txt +0 -0
- {oci-2.118.1.dist-info → oci-2.118.2.dist-info}/THIRD_PARTY_LICENSES.txt +0 -0
- {oci-2.118.1.dist-info → oci-2.118.2.dist-info}/WHEEL +0 -0
- {oci-2.118.1.dist-info → oci-2.118.2.dist-info}/top_level.txt +0 -0
@@ -1,140 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
# Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
|
3
|
-
# 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.
|
4
|
-
|
5
|
-
import base64
|
6
|
-
import pkcs11
|
7
|
-
import urllib
|
8
|
-
import hashlib
|
9
|
-
import platform
|
10
|
-
import threading
|
11
|
-
from oci.auth import signers
|
12
|
-
from pkcs11.constants import Attribute
|
13
|
-
from pkcs11.mechanisms import Mechanism
|
14
|
-
from getpass import getpass
|
15
|
-
import oci.signer
|
16
|
-
|
17
|
-
system = platform.system()
|
18
|
-
|
19
|
-
platforms = {
|
20
|
-
"Darwin": "/usr/local/lib/opensc-pkcs11.so",
|
21
|
-
"Linux": "/usr/lib64/pkcs11/opensc-pkcs11.so",
|
22
|
-
}
|
23
|
-
|
24
|
-
if system == 'Darwin':
|
25
|
-
provider = platforms["Darwin"]
|
26
|
-
elif system == 'Linux':
|
27
|
-
provider = platforms["Linux"]
|
28
|
-
else:
|
29
|
-
raise RuntimeError('Unsupported platform {}'.format(system))
|
30
|
-
|
31
|
-
|
32
|
-
class Yubikey:
|
33
|
-
lock = threading.Lock()
|
34
|
-
|
35
|
-
def __init__(self, pin):
|
36
|
-
self.pin = pin
|
37
|
-
|
38
|
-
with self.lock:
|
39
|
-
self.lib = pkcs11.lib(provider)
|
40
|
-
self.token = self.lib.get_token()
|
41
|
-
|
42
|
-
with self.token.open(user_pin=self.pin) as session:
|
43
|
-
key = session.get_key(label='PIV AUTH pubkey')
|
44
|
-
hasher = hashlib.md5()
|
45
|
-
|
46
|
-
hasher.update(key[Attribute.VALUE])
|
47
|
-
digest = hasher.hexdigest()
|
48
|
-
|
49
|
-
self.fingerprint = ':'.join(a + b for a, b in zip(digest[::2], digest[1::2]))
|
50
|
-
|
51
|
-
def sign(self, data, mechanism=Mechanism.SHA256_RSA_PKCS):
|
52
|
-
with self.lock, self.token.open(user_pin=self.pin) as session:
|
53
|
-
key = session.get_key(label='PIV AUTH key')
|
54
|
-
|
55
|
-
return key.sign(data, mechanism=mechanism)
|
56
|
-
|
57
|
-
def verify(self, data, signature, mechanism=Mechanism.SHA256_RSA_PKCS):
|
58
|
-
with self.lock, self.token.open(user_pin=self.pin) as session:
|
59
|
-
key = session.get_key(label='PIV AUTH pubkey')
|
60
|
-
|
61
|
-
return key.verify(data, signature, mechanism=mechanism)
|
62
|
-
|
63
|
-
|
64
|
-
class YubikeyRequestSigner(signers.SecurityTokenSigner):
|
65
|
-
generic_headers = [
|
66
|
-
'date',
|
67
|
-
'(request-target)',
|
68
|
-
'host'
|
69
|
-
]
|
70
|
-
body_headers = [
|
71
|
-
'content-length',
|
72
|
-
'content-type',
|
73
|
-
'x-content-sha256',
|
74
|
-
]
|
75
|
-
required_headers = {
|
76
|
-
'get': generic_headers,
|
77
|
-
'head': generic_headers,
|
78
|
-
'delete': generic_headers,
|
79
|
-
'put': generic_headers + body_headers,
|
80
|
-
'post': generic_headers + body_headers
|
81
|
-
}
|
82
|
-
|
83
|
-
def __init__(self, user, tenancy, pin):
|
84
|
-
self.yubikey = Yubikey(pin)
|
85
|
-
self.keyid = '{}/{}/{}'.format(tenancy, user, self.yubikey.fingerprint)
|
86
|
-
|
87
|
-
def sign(self, request):
|
88
|
-
verb = request.method.lower()
|
89
|
-
host = urllib.parse.urlparse(request.url).netloc
|
90
|
-
path = request.path_url
|
91
|
-
values = []
|
92
|
-
|
93
|
-
for header in self.required_headers[verb]:
|
94
|
-
header = header.lower()
|
95
|
-
|
96
|
-
if header == '(request-target)':
|
97
|
-
values.append('{}: {} {}'.format(header, verb, path))
|
98
|
-
elif header == 'host':
|
99
|
-
values.append('{}: {}'.format(header, host))
|
100
|
-
elif header == 'date':
|
101
|
-
values.append('{}: {}'.format(header, request.headers.get('date')))
|
102
|
-
else:
|
103
|
-
values.append('{}: {}'.format(header, request.headers.get(header)))
|
104
|
-
|
105
|
-
data = '\n'.join(values).encode('ascii')
|
106
|
-
signature = self.yubikey.sign(data)
|
107
|
-
|
108
|
-
return {
|
109
|
-
'authorization': 'Signature keyId="{}",version="{}",algorithm="{}",headers="{}",signature="{}"'.format(
|
110
|
-
self.keyid,
|
111
|
-
'1',
|
112
|
-
'rsa-sha256',
|
113
|
-
' '.join(self.required_headers[verb]),
|
114
|
-
base64.b64encode(signature).decode('ascii')
|
115
|
-
)
|
116
|
-
}
|
117
|
-
|
118
|
-
def __call__(self, request):
|
119
|
-
verb = request.method.lower()
|
120
|
-
|
121
|
-
if verb == 'options':
|
122
|
-
return request
|
123
|
-
|
124
|
-
oci.signer.inject_missing_headers(request, verb in ['put', 'post'], enforce_content_headers=True)
|
125
|
-
auth_header = self.sign(request)
|
126
|
-
request.headers.update(auth_header)
|
127
|
-
return request
|
128
|
-
|
129
|
-
def get_yubikey_signer(client_config, ykpin):
|
130
|
-
signer = YubikeyRequestSigner(
|
131
|
-
client_config['user'],
|
132
|
-
client_config['tenancy'],
|
133
|
-
ykpin
|
134
|
-
)
|
135
|
-
return signer
|
136
|
-
|
137
|
-
def get_yubikey_pin():
|
138
|
-
ykpin_supplier = (lambda: getpass(prompt='Enter your yubikey pin: '))
|
139
|
-
ykpin = ykpin_supplier()
|
140
|
-
return ykpin
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|