Skip to content

Commit ea06d06

Browse files
Releasing version 2.138.0
Releasing version 2.138.0
2 parents f2318ec + 006daa0 commit ea06d06

File tree

68 files changed

+5994
-400
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+5994
-400
lines changed

CHANGELOG.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,32 @@ Change Log
33
All notable changes to this project will be documented in this file.
44

55
The format is based on `Keep a Changelog <http://keepachangelog.com/>`_.
6+
====================
7+
2.138.0 - 2024-11-05
8+
====================
9+
10+
Added
11+
-----
12+
* Support for calling Oracle Cloud Infrastructure services in the ap-seoul-2 region
13+
* Support for calling Oracle Cloud Infrastructure services in the ap-suwon-1 region
14+
* Support for calling Oracle Cloud Infrastructure services in the ap-chuncheon-2 region
15+
* Support for MFA Enablement v2 in the Identity Domains service
16+
* Support for starting, stopping and updating min/max executor count for SQL Endpoints in the Data Flow service
17+
* Support for customer message in the Customer Incident Management Service
18+
* Support for REJECTED limitStatus in the Customer Incident Management Service
19+
20+
Fixed
21+
-----
22+
* Issue with using `OkeWorkloaIdentityResourcePrincipalSigner` after the PyJWT upgrade to 2.4.0 introduced int OCI Python SDK `2.137.1`
23+
* UserWarning being emitted from Cryptography 43.x
24+
25+
Breaking
26+
--------
27+
* The operations `get_status` and `get_csi_number` were removed from the IncidentClient in the Customer Incident Management Service
28+
* The property `service_categories` was removed from the model `IncidentResourceType` in the Customer Incident Management Service
29+
* The properties `service_category` and `issue_type` were removed from the model `ServiceCategories` in the Customer Incident Management Service
30+
* The retry strategy for getting the X509 token from Identity service was modified and is now protected via circuit breaker
31+
632
====================
733
2.137.1 - 2024-10-29
834
====================

docs/api/cims.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ Cims
4747
oci.cims.models.ServiceCategories
4848
oci.cims.models.ServiceCategory
4949
oci.cims.models.Status
50+
oci.cims.models.SubCategories
5051
oci.cims.models.SubCategory
52+
oci.cims.models.SubComponents
53+
oci.cims.models.SubscriptionInfo
5154
oci.cims.models.TechSupportItem
5255
oci.cims.models.TenancyInformation
5356
oci.cims.models.Ticket
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SubCategories
2+
=============
3+
4+
.. currentmodule:: oci.cims.models
5+
6+
.. autoclass:: SubCategories
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SubComponents
2+
=============
3+
4+
.. currentmodule:: oci.cims.models
5+
6+
.. autoclass:: SubComponents
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
SubscriptionInfo
2+
================
3+
4+
.. currentmodule:: oci.cims.models
5+
6+
.. autoclass:: SubscriptionInfo
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:

docs/api/identity_domains.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ Identity Domains
156156
oci.identity_domains.models.CloudGateServers
157157
oci.identity_domains.models.CloudGates
158158
oci.identity_domains.models.Condition
159+
oci.identity_domains.models.ConditionExtensionOciconsolesignonpolicyconsentPolicy
159160
oci.identity_domains.models.ConditionSearchRequest
160161
oci.identity_domains.models.Conditions
161162
oci.identity_domains.models.CustomerSecretKey
@@ -343,6 +344,12 @@ Identity Domains
343344
oci.identity_domains.models.OAuthPartnerCertificate
344345
oci.identity_domains.models.OAuthPartnerCertificateSearchRequest
345346
oci.identity_domains.models.OAuthPartnerCertificates
347+
oci.identity_domains.models.OciConsoleSignOnPolicyConsent
348+
oci.identity_domains.models.OciConsoleSignOnPolicyConsentConsentSignedBy
349+
oci.identity_domains.models.OciConsoleSignOnPolicyConsentModifiedResource
350+
oci.identity_domains.models.OciConsoleSignOnPolicyConsentPolicyResource
351+
oci.identity_domains.models.OciConsoleSignOnPolicyConsentSearchRequest
352+
oci.identity_domains.models.OciConsoleSignOnPolicyConsents
346353
oci.identity_domains.models.Operations
347354
oci.identity_domains.models.PasswordPolicies
348355
oci.identity_domains.models.PasswordPolicy
@@ -352,14 +359,17 @@ Identity Domains
352359
oci.identity_domains.models.PatchOp
353360
oci.identity_domains.models.Policies
354361
oci.identity_domains.models.Policy
362+
oci.identity_domains.models.PolicyExtensionOciconsolesignonpolicyconsentPolicy
355363
oci.identity_domains.models.PolicyPolicyType
356364
oci.identity_domains.models.PolicyRules
357365
oci.identity_domains.models.PolicySearchRequest
358366
oci.identity_domains.models.ResourceTypeSchemaAttribute
359367
oci.identity_domains.models.ResourceTypeSchemaAttributeSearchRequest
360368
oci.identity_domains.models.ResourceTypeSchemaAttributes
369+
oci.identity_domains.models.RestoreOciConsolePolicy
361370
oci.identity_domains.models.Rule
362371
oci.identity_domains.models.RuleConditionGroup
372+
oci.identity_domains.models.RuleExtensionOciconsolesignonpolicyconsentPolicy
363373
oci.identity_domains.models.RulePolicyType
364374
oci.identity_domains.models.RuleReturn
365375
oci.identity_domains.models.RuleSearchRequest
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ConditionExtensionOciconsolesignonpolicyconsentPolicy
2+
=====================================================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: ConditionExtensionOciconsolesignonpolicyconsentPolicy
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
OciConsoleSignOnPolicyConsent
2+
=============================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: OciConsoleSignOnPolicyConsent
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
OciConsoleSignOnPolicyConsentConsentSignedBy
2+
============================================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: OciConsoleSignOnPolicyConsentConsentSignedBy
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
OciConsoleSignOnPolicyConsentModifiedResource
2+
=============================================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: OciConsoleSignOnPolicyConsentModifiedResource
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
OciConsoleSignOnPolicyConsentPolicyResource
2+
===========================================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: OciConsoleSignOnPolicyConsentPolicyResource
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
OciConsoleSignOnPolicyConsentSearchRequest
2+
==========================================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: OciConsoleSignOnPolicyConsentSearchRequest
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
OciConsoleSignOnPolicyConsents
2+
==============================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: OciConsoleSignOnPolicyConsents
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
PolicyExtensionOciconsolesignonpolicyconsentPolicy
2+
==================================================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: PolicyExtensionOciconsolesignonpolicyconsentPolicy
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
RestoreOciConsolePolicy
2+
=======================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: RestoreOciConsolePolicy
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
RuleExtensionOciconsolesignonpolicyconsentPolicy
2+
================================================
3+
4+
.. currentmodule:: oci.identity_domains.models
5+
6+
.. autoclass:: RuleExtensionOciconsolesignonpolicyconsentPolicy
7+
:show-inheritance:
8+
:special-members: __init__
9+
:members:
10+
:undoc-members:
11+
:inherited-members:

src/oci/auth/auth_utils.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33
# 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.
44

55
import random
6+
import warnings
67
from oci._vendor import six
78

89

910
def get_tenancy_id_from_certificate(cert):
1011
if not cert:
1112
raise RuntimeError('A certificate must be provided')
1213

13-
for name_attribute in cert.subject:
14-
val = name_attribute.value
15-
if val.startswith('opc-tenant:'):
16-
return val[len('opc-tenant:'):]
17-
if val.startswith('opc-identity:'):
18-
return val[len('opc-identity:'):]
14+
with warnings.catch_warnings():
15+
warnings.simplefilter('ignore', UserWarning)
16+
for name_attribute in cert.subject:
17+
val = name_attribute.value
18+
if val.startswith('opc-tenant:'):
19+
return val[len('opc-tenant:'):]
20+
if val.startswith('opc-identity:'):
21+
return val[len('opc-identity:'):]
1922

2023
raise RuntimeError('The certificate does not contain a tenancy OCID')
2124

src/oci/auth/federation_client.py

Lines changed: 59 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
import logging
1616
import pprint
1717

18+
from oci.circuit_breaker import CircuitBreakerStrategy, NoCircuitBreakerStrategy
19+
from circuitbreaker import CircuitBreakerMonitor
20+
import random
21+
1822

1923
class X509FederationClient(object):
2024
REQUIRED_INIT_KWARGS = [
@@ -62,12 +66,19 @@ def __init__(self, **kwargs):
6266
6367
:param obj retry_strategy: (optional)
6468
A retry strategy to apply to calls made by this client. This should be one of the strategies available in
65-
the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_RETRY_STRATEGY` is also available and
66-
will be used if no explicit retry strategy is specified.
69+
the :py:mod:`~oci.retry` module. A convenience :py:data:`~oci.retry.DEFAULT_FEDERATION_CLIENT_RETRY_STRATEGY`
70+
is also available and will be used if no explicit retry strategy is specified.
71+
72+
The specifics of the retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.
73+
74+
To have this client explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.
6775
68-
The specifics of the default retry strategy are described `here <https://docs.oracle.com/en-us/iaas/tools/python/latest/sdk_behaviors/retries.html>`__.
76+
:param obj circuit_breaker_strategy: (optional)
77+
The circuit_breaker_strategy to apply to calls made by this client. This should be one of the strategies
78+
available in the :py:mod:`~oci.circuit_breaker` module. A convenience :py:data:`~oci.circuit_breaker.DEFAULT_FEDERATION_CLIENT_CIRCUIT_BREAKER_STRATEGY`
79+
is also available and will be used if no explicit retry strategy is specified.
6980
70-
To have this operation explicitly not perform any retries, pass an instance of :py:class:`~oci.retry.NoneRetryStrategy`.
81+
To have this client explicitly not have any circuit breaker, pass an instance of :py:class:`~oci.circuit_breaker.NoCircuitBreakerStrategy`.
7182
7283
:param bool log_requests: (optional)
7384
log_request if set to True, will log the request url and response data when retrieving
@@ -116,10 +127,39 @@ def __init__(self, **kwargs):
116127
if retry_strategy:
117128
self.retry_strategy = retry_strategy
118129
else:
119-
self.retry_strategy = oci.retry.DEFAULT_RETRY_STRATEGY
130+
self.logger.debug('Setting DEFAULT_FEDERATION_CLIENT_RETRY_STRATEGY for federation client')
131+
self.retry_strategy = oci.retry.DEFAULT_FEDERATION_CLIENT_RETRY_STRATEGY
132+
133+
# Setup Circuit breaker strategy
134+
self._set_circuit_breaker_strategy(circuit_breaker_strategy=kwargs.get('circuit_breaker_strategy'))
120135

121136
self.requests_session = requests.Session()
122137

138+
def _set_circuit_breaker_strategy(self, circuit_breaker_strategy):
139+
self.circuit_breaker_strategy = circuit_breaker_strategy
140+
# If not set by client use the GLOBAL_FEDERATION_CLIENT_CIRCUIT_BREAKER_STRATEGY
141+
if circuit_breaker_strategy is None:
142+
self.circuit_breaker_strategy = oci.circuit_breaker.GLOBAL_FEDERATION_CLIENT_CIRCUIT_BREAKER_STRATEGY
143+
144+
# Skip enabling circuit breaker if NoCircuitBreakerStrategy is set
145+
if isinstance(circuit_breaker_strategy, NoCircuitBreakerStrategy):
146+
self.logger.debug('No circuit breaker strategy enabled!')
147+
else:
148+
# Enable Circuit breaker if a valid circuit breaker strategy is available
149+
if not isinstance(self.circuit_breaker_strategy, CircuitBreakerStrategy):
150+
raise TypeError('Invalid Circuit Breaker Strategy!')
151+
self.logger.debug('Enabling circuit breaker strategy for federation client')
152+
# Set the recovery timeout a random value between 30 seconds to 49 seconds
153+
if self.circuit_breaker_strategy == oci.circuit_breaker.DEFAULT_FEDERATION_CLIENT_CIRCUIT_BREAKER_STRATEGY:
154+
self.logger.debug('Using DEFAULT_FEDERATION_CLIENT_CIRCUIT_BREAKER_STRATEGY for federation client')
155+
self.circuit_breaker_strategy.recovery_timeout = random.randint(30, 49)
156+
# Re-use Circuit breaker if sharing a Circuit Breaker Strategy.
157+
circuit_breaker = CircuitBreakerMonitor.get(self.circuit_breaker_strategy.name)
158+
if circuit_breaker is None:
159+
circuit_breaker = self.circuit_breaker_strategy.get_circuit_breaker()
160+
# Equivalent to decorating the request function with Circuit Breaker
161+
self._get_security_token_from_auth_service = circuit_breaker(self._get_security_token_from_auth_service)
162+
123163
def refresh_security_token(self):
124164
return self._refresh_security_token_inner()
125165

@@ -188,6 +228,13 @@ def _get_security_token_from_auth_service(self):
188228
if response.ok:
189229
raise RuntimeError(error_text)
190230
else:
231+
if isinstance(self.circuit_breaker_strategy, CircuitBreakerStrategy) and self.circuit_breaker_strategy.is_transient_error(response.status_code, response.reason):
232+
raise oci.exceptions.TransientServiceError(
233+
response.status_code,
234+
response.reason,
235+
response.headers,
236+
error_text
237+
)
191238
raise oci.exceptions.ServiceError(
192239
response.status_code,
193240
response.reason,
@@ -196,6 +243,13 @@ def _get_security_token_from_auth_service(self):
196243
)
197244

198245
if not response.ok:
246+
if isinstance(self.circuit_breaker_strategy, CircuitBreakerStrategy) and self.circuit_breaker_strategy.is_transient_error(response.status_code, response.reason):
247+
raise oci.exceptions.TransientServiceError(
248+
response.status_code,
249+
parsed_response.get('code'),
250+
response.headers,
251+
parsed_response.get('message')
252+
)
199253
raise oci.exceptions.ServiceError(
200254
response.status_code,
201255
parsed_response.get('code'),

0 commit comments

Comments
 (0)