Skip to content

Commit e6fa2d2

Browse files
committed
SDK updates
1 parent ce7974a commit e6fa2d2

4 files changed

Lines changed: 81 additions & 82 deletions

File tree

ibm_secrets_manager_sdk/secrets_manager_v2.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# coding: utf-8
22

3-
# (C) Copyright IBM Corp. 2025.
3+
# (C) Copyright IBM Corp. 2026.
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# IBM OpenAPI SDK Code Generator Version: 3.107.0-b68ebf7a-20250811-145645
17+
# IBM OpenAPI SDK Code Generator Version: 3.114.0-a902401e-20260427-192904
1818

1919
"""
2020
With IBM Cloud® Secrets Manager, you can create, lease, and centrally manage secrets that
@@ -80,7 +80,7 @@ def construct_service_url(
8080

8181
:param str instance_id: (optional) The Secrets Manager Instance ID assigned by the service provider
8282
(default 'provide-here-your-smgr-instanceuuid')
83-
:param str region: (optional) The region where you provisioned your Secrets Manager Instance. Available values: us-south, us-east, au-syd, jp-osa, jp-tok, eu-de, eu-gb, eu-es, ca-tor, ca-mon, br-sao
83+
:param str region: (optional) The region where you provisioned your Secrets Manager Instance. Available values: us-south, us-east, au-syd, jp-osa, jp-tok, eu-de, eu-gb, eu-es, ca-tor, ca-mon, br-sao, in-che
8484
(default 'us-south')
8585
:return: The formatted URL with all variable placeholders replaced by values.
8686
:rtype: str
@@ -3811,7 +3811,7 @@ class CustomCredentialsNewCredentials:
38113811
:param str id: An identifier of credentials in the credentials provider that is
38123812
used by the custom credentials secret type.
38133813
:param dict payload: The fields that can be passed to and from the custom
3814-
credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
3814+
credentials engine. Allowed types are string, integer, and boolean.
38153815
"""
38163816

38173817
def __init__(
@@ -3825,7 +3825,7 @@ def __init__(
38253825
:param str id: An identifier of credentials in the credentials provider
38263826
that is used by the custom credentials secret type.
38273827
:param dict payload: The fields that can be passed to and from the custom
3828-
credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
3828+
credentials engine. Allowed types are string, integer, and boolean.
38293829
"""
38303830
self.id = id
38313831
self.payload = payload
@@ -11429,9 +11429,9 @@ class CustomCredentialsSecret(Secret):
1142911429
(automatic or manual) for the secret failed.
1143011430
:param str configuration: The name of the custom credentials configuration.
1143111431
:param dict parameters: (optional) The fields that can be passed to and from the
11432-
custom credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
11432+
custom credentials engine. Allowed types are string, integer, and boolean.
1143311433
:param dict credentials_content: The fields that can be passed to and from the
11434-
custom credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
11434+
custom credentials engine. Allowed types are string, integer, and boolean.
1143511435
"""
1143611436

1143711437
def __init__(
@@ -11486,8 +11486,8 @@ def __init__(
1148611486
:param int versions_total: The number of versions of your secret.
1148711487
:param str configuration: The name of the custom credentials configuration.
1148811488
:param dict credentials_content: The fields that can be passed to and from
11489-
the custom credentials engine. Allowed types are 'string', 'integer' and
11490-
'boolean'.
11489+
the custom credentials engine. Allowed types are string, integer, and
11490+
boolean.
1149111491
:param datetime retrieved_at: (optional) The date when the data of the
1149211492
secret was last retrieved. The date format follows RFC 3339. Epoch date if
1149311493
there is no record of secret data retrieval.
@@ -11522,8 +11522,8 @@ def __init__(
1152211522
:param str last_failed_task_id: (optional) A Secret Manager task
1152311523
identifier.
1152411524
:param dict parameters: (optional) The fields that can be passed to and
11525-
from the custom credentials engine. Allowed types are 'string', 'integer'
11526-
and 'boolean'.
11525+
from the custom credentials engine. Allowed types are string, integer, and
11526+
boolean.
1152711527
"""
1152811528
# pylint: disable=super-init-not-called
1152911529
self.created_by = created_by
@@ -11840,7 +11840,7 @@ class CustomCredentialsSecretMetadata(SecretMetadata):
1184011840
(automatic or manual) for the secret failed.
1184111841
:param str configuration: The name of the custom credentials configuration.
1184211842
:param dict parameters: (optional) The fields that can be passed to and from the
11843-
custom credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
11843+
custom credentials engine. Allowed types are string, integer, and boolean.
1184411844
"""
1184511845

1184611846
def __init__(
@@ -11927,8 +11927,8 @@ def __init__(
1192711927
:param str last_failed_task_id: (optional) A Secret Manager task
1192811928
identifier.
1192911929
:param dict parameters: (optional) The fields that can be passed to and
11930-
from the custom credentials engine. Allowed types are 'string', 'integer'
11931-
and 'boolean'.
11930+
from the custom credentials engine. Allowed types are string, integer, and
11931+
boolean.
1193211932
"""
1193311933
# pylint: disable=super-init-not-called
1193411934
self.created_by = created_by
@@ -12196,7 +12196,7 @@ class CustomCredentialsSecretMetadataPatch(SecretMetadataPatch):
1219612196
rotation. For the custom_credentials secret type, the TTL field is optional. The
1219712197
minimum duration is 1 day. The maximum is 90 days.
1219812198
:param dict parameters: (optional) The parameters that are passed to custom
12199-
credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
12199+
credentials engine. Allowed types are string, integer, and boolean.
1220012200
"""
1220112201

1220212202
def __init__(
@@ -12244,7 +12244,7 @@ def __init__(
1224412244
secret type, the TTL field is optional. The minimum duration is 1 day. The
1224512245
maximum is 90 days.
1224612246
:param dict parameters: (optional) The parameters that are passed to custom
12247-
credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
12247+
credentials engine. Allowed types are string, integer, and boolean.
1224812248
"""
1224912249
# pylint: disable=super-init-not-called
1225012250
self.custom_metadata = custom_metadata
@@ -12363,7 +12363,7 @@ class CustomCredentialsSecretPrototype(SecretPrototype):
1236312363
a user can customize.
1236412364
:param str configuration: The name of the custom credentials configuration.
1236512365
:param dict parameters: (optional) The parameters that are passed to custom
12366-
credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
12366+
credentials engine. Allowed types are string, integer, and boolean.
1236712367
"""
1236812368

1236912369
def __init__(
@@ -12423,7 +12423,7 @@ def __init__(
1242312423
:param dict version_custom_metadata: (optional) The secret version metadata
1242412424
that a user can customize.
1242512425
:param dict parameters: (optional) The parameters that are passed to custom
12426-
credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
12426+
credentials engine. Allowed types are string, integer, and boolean.
1242712427
"""
1242812428
# pylint: disable=super-init-not-called
1242912429
self.custom_metadata = custom_metadata
@@ -12577,7 +12577,7 @@ class CustomCredentialsSecretVersion(SecretVersion):
1257712577
:param str credentials_id: (optional) Credentials created by the custom
1257812578
credentials system.
1257912579
:param dict credentials_content: The fields that can be passed to and from the
12580-
custom credentials engine. Allowed types are 'string', 'integer' and 'boolean'.
12580+
custom credentials engine. Allowed types are string, integer, and boolean.
1258112581
"""
1258212582

1258312583
def __init__(
@@ -12615,8 +12615,8 @@ def __init__(
1261512615
available in this secret version.
1261612616
:param str secret_id: A UUID identifier.
1261712617
:param dict credentials_content: The fields that can be passed to and from
12618-
the custom credentials engine. Allowed types are 'string', 'integer' and
12619-
'boolean'.
12618+
the custom credentials engine. Allowed types are string, integer, and
12619+
boolean.
1262012620
:param bool auto_rotated: (optional) Indicates whether the version of the
1262112621
secret was created by automatic rotation.
1262212622
:param str alias: (optional) A human-readable alias that describes the

test/integration/test_manual_secrets_manager_v2.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ def config_private_cert_engine(secrets_manager_service):
9191
if "already exists" not in err.message:
9292
raise AssertionError("Failed to create template_configuration")
9393

94-
9594
def create_private_certificate(secrets_manager_service, secret_name):
9695
secret_prototype_model = {
9796
'secret_type': 'private_cert',
@@ -191,6 +190,7 @@ def setup_class(cls):
191190
)
192191
assert cls.secrets_manager_service is not None
193192

193+
194194
cls.config = read_external_sources(
195195
SecretsManagerV2.DEFAULT_SERVICE_NAME)
196196
assert cls.config is not None
@@ -202,8 +202,7 @@ def setup_class(cls):
202202
cls.privateCertSecretId2 = create_private_certificate(cls.secrets_manager_service, "private-cert-secret2")
203203

204204
# IAM Credentials tests setup
205-
cls.iamSecretId = config_iam_credentials_engine(cls.secrets_manager_service, cls.config['APIKEY'],
206-
cls.config['ACCESS_GROUP'])
205+
cls.iamSecretId = config_iam_credentials_engine(cls.secrets_manager_service, cls.config['APIKEY'], cls.config['ACCESS_GROUP'])
207206

208207
print('Setup complete.')
209208

test/integration/test_secrets_manager_v2.py

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# (C) Copyright IBM Corp. 2025.
2+
# (C) Copyright IBM Corp. 2026.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -112,6 +112,57 @@ def test_create_secret(self):
112112
secret_id_for_get_secret_link = secret['id']
113113
secret_id_for_get_secret_version_link = secret['id']
114114

115+
@needscredentials
116+
def test_list_secrets(self):
117+
response = self.secrets_manager_service.list_secrets(
118+
offset=0,
119+
limit=200,
120+
sort='created_at',
121+
search='example',
122+
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
123+
secret_types=['arbitrary', 'kv'],
124+
match_all_labels=['dev', 'us-south'],
125+
)
126+
127+
assert response.get_status_code() == 200
128+
secret_metadata_paginated_collection = response.get_result()
129+
assert secret_metadata_paginated_collection is not None
130+
131+
@needscredentials
132+
def test_list_secrets_with_pager(self):
133+
all_results = []
134+
135+
# Test get_next().
136+
pager = SecretsPager(
137+
client=self.secrets_manager_service,
138+
limit=10,
139+
sort='created_at',
140+
search='example',
141+
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
142+
secret_types=['arbitrary', 'kv'],
143+
match_all_labels=['dev', 'us-south'],
144+
)
145+
while pager.has_next():
146+
next_page = pager.get_next()
147+
assert next_page is not None
148+
all_results.extend(next_page)
149+
150+
# Test get_all().
151+
pager = SecretsPager(
152+
client=self.secrets_manager_service,
153+
limit=10,
154+
sort='created_at',
155+
search='example',
156+
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
157+
secret_types=['arbitrary', 'kv'],
158+
match_all_labels=['dev', 'us-south'],
159+
)
160+
all_items = pager.get_all()
161+
assert all_items is not None
162+
163+
assert len(all_results) == len(all_items)
164+
print(f'\nlist_secrets() returned a total of {len(all_results)} items(s) using SecretsPager.')
165+
115166
@needscredentials
116167
def test_update_secret_metadata(self):
117168
global secret_name_link
@@ -246,57 +297,6 @@ def test_update_secret_group(self):
246297
secret_group = response.get_result()
247298
assert secret_group is not None
248299

249-
@needscredentials
250-
def test_list_secrets(self):
251-
response = self.secrets_manager_service.list_secrets(
252-
offset=0,
253-
limit=200,
254-
sort='created_at',
255-
search='example',
256-
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
257-
secret_types=['arbitrary', 'kv'],
258-
match_all_labels=['dev', 'us-south'],
259-
)
260-
261-
assert response.get_status_code() == 200
262-
secret_metadata_paginated_collection = response.get_result()
263-
assert secret_metadata_paginated_collection is not None
264-
265-
@needscredentials
266-
def test_list_secrets_with_pager(self):
267-
all_results = []
268-
269-
# Test get_next().
270-
pager = SecretsPager(
271-
client=self.secrets_manager_service,
272-
limit=10,
273-
sort='created_at',
274-
search='example',
275-
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
276-
secret_types=['arbitrary', 'kv'],
277-
match_all_labels=['dev', 'us-south'],
278-
)
279-
while pager.has_next():
280-
next_page = pager.get_next()
281-
assert next_page is not None
282-
all_results.extend(next_page)
283-
284-
# Test get_all().
285-
pager = SecretsPager(
286-
client=self.secrets_manager_service,
287-
limit=10,
288-
sort='created_at',
289-
search='example',
290-
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
291-
secret_types=['arbitrary', 'kv'],
292-
match_all_labels=['dev', 'us-south'],
293-
)
294-
all_items = pager.get_all()
295-
assert all_items is not None
296-
297-
assert len(all_results) == len(all_items)
298-
print(f'\nlist_secrets() returned a total of {len(all_results)} items(s) using SecretsPager.')
299-
300300
@needscredentials
301301
def test_get_secret(self):
302302
response = self.secrets_manager_service.get_secret(
@@ -678,11 +678,6 @@ def test_delete_secret_group(self):
678678

679679
assert response.get_status_code() == 204
680680

681-
# The integration test for delete_secret_version_data has been explicitly excluded from generation.
682-
# A test for this operation must be developed manually.
683-
# @needscredentials
684-
# def test_delete_secret_version_data(self):
685-
686681
@needscredentials
687682
def test_delete_secret_locks_bulk(self):
688683
response = self.secrets_manager_service.delete_secret_locks_bulk(
@@ -715,6 +710,11 @@ def test_delete_secret(self):
715710

716711
assert response.get_status_code() == 204
717712

713+
# The integration test for delete_secret_version_data has been explicitly excluded from generation.
714+
# A test for this operation must be developed manually.
715+
# @needscredentials
716+
# def test_delete_secret_version_data(self):
717+
718718
# The integration test for delete_secret_task has been explicitly excluded from generation.
719719
# A test for this operation must be developed manually.
720720
# @needscredentials

test/unit/test_secrets_manager_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# (C) Copyright IBM Corp. 2025.
2+
# (C) Copyright IBM Corp. 2026.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)