-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtest_secrets_manager_v2.py
More file actions
736 lines (610 loc) · 27.8 KB
/
Copy pathtest_secrets_manager_v2.py
File metadata and controls
736 lines (610 loc) · 27.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
# -*- coding: utf-8 -*-
# (C) Copyright IBM Corp. 2026.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Integration Tests for SecretsManagerV2
"""
from ibm_cloud_sdk_core import *
import os
import pytest
from ibm_secrets_manager_sdk.secrets_manager_v2 import *
# Config file name
config_file = 'secrets_manager_v2.env'
# Variables to hold link values
configuration_name_for_get_configuration_link = None
secret_group_id_for_get_secret_group_link = None
secret_id_for_create_secret_version_link = None
secret_id_for_create_secret_version_locks_link = None
secret_id_for_get_secret_link = None
secret_id_for_get_secret_version_link = None
secret_id_for_list_secret_locks_link = None
secret_id_for_list_secret_version_locks_link = None
secret_name_link = None
secret_version_id_for_create_secret_version_locks_link = None
secret_version_id_for_delete_secret_version_locks_link = None
secret_version_id_for_get_secret_version_link = None
secret_version_id_for_get_secret_version_metadata_link = None
secret_version_id_for_list_secret_version_locks_link = None
secret_version_id_for_update_secret_version_metadata_link = None
class TestSecretsManagerV2:
"""
Integration Test Class for SecretsManagerV2
"""
@classmethod
def setup_class(cls):
if os.path.exists(config_file):
os.environ['IBM_CREDENTIALS_FILE'] = config_file
cls.secrets_manager_service = SecretsManagerV2.new_instance(
)
assert cls.secrets_manager_service is not None
cls.config = read_external_sources(SecretsManagerV2.DEFAULT_SERVICE_NAME)
assert cls.config is not None
cls.secrets_manager_service.enable_retries()
print('Setup complete.')
needscredentials = pytest.mark.skipif(
not os.path.exists(config_file), reason="External configuration not available, skipping..."
)
@needscredentials
def test_create_secret_group(self):
global secret_group_id_for_get_secret_group_link
response = self.secrets_manager_service.create_secret_group(
name='my-secret-group',
description='Extended description for this group.',
)
assert response.get_status_code() == 201
secret_group = response.get_result()
assert secret_group is not None
secret_group_id_for_get_secret_group_link = secret_group['id']
@needscredentials
def test_create_secret(self):
global secret_id_for_get_secret_link
global secret_id_for_get_secret_version_link
# Construct a dict representation of a ArbitrarySecretPrototype model
secret_prototype_model = {
'custom_metadata': {'metadata_custom_key': 'metadata_custom_value'},
'description': 'Description of my arbitrary secret.',
'expiration_date': '2030-10-05T11:49:42Z',
'labels': ['dev', 'us-south'],
'name': 'example-arbitrary-secret',
'secret_group_id': 'default',
'secret_type': 'arbitrary',
'payload': 'secret-data',
'version_custom_metadata': {'custom_version_key': 'custom_version_value'},
}
response = self.secrets_manager_service.create_secret(
secret_prototype=secret_prototype_model,
)
assert response.get_status_code() == 201
secret = response.get_result()
assert secret is not None
secret_id_for_get_secret_link = secret['id']
secret_id_for_get_secret_version_link = secret['id']
@needscredentials
def test_list_secrets(self):
response = self.secrets_manager_service.list_secrets(
offset=0,
limit=200,
sort='created_at',
search='example',
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
secret_types=['arbitrary', 'kv'],
match_all_labels=['dev', 'us-south'],
)
assert response.get_status_code() == 200
secret_metadata_paginated_collection = response.get_result()
assert secret_metadata_paginated_collection is not None
@needscredentials
def test_list_secrets_with_pager(self):
all_results = []
# Test get_next().
pager = SecretsPager(
client=self.secrets_manager_service,
limit=10,
sort='created_at',
search='example',
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
secret_types=['arbitrary', 'kv'],
match_all_labels=['dev', 'us-south'],
)
while pager.has_next():
next_page = pager.get_next()
assert next_page is not None
all_results.extend(next_page)
# Test get_all().
pager = SecretsPager(
client=self.secrets_manager_service,
limit=10,
sort='created_at',
search='example',
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
secret_types=['arbitrary', 'kv'],
match_all_labels=['dev', 'us-south'],
)
all_items = pager.get_all()
assert all_items is not None
assert len(all_results) == len(all_items)
print(f'\nlist_secrets() returned a total of {len(all_results)} items(s) using SecretsPager.')
@needscredentials
def test_update_secret_metadata(self):
global secret_name_link
# Construct a dict representation of a ArbitrarySecretMetadataPatch model
secret_metadata_patch_model = {
'name': 'updated-arbitrary-secret-name-example',
'description': 'updated Arbitrary Secret description',
'labels': ['dev', 'us-south'],
'custom_metadata': {'metadata_custom_key': 'metadata_custom_value'},
'expiration_date': '2033-04-12T23:20:50.520Z',
}
response = self.secrets_manager_service.update_secret_metadata(
id=secret_id_for_get_secret_link,
secret_metadata_patch=secret_metadata_patch_model,
)
assert response.get_status_code() == 200
secret_metadata = response.get_result()
assert secret_metadata is not None
secret_name_link = secret_metadata['name']
@needscredentials
def test_list_secret_versions(self):
global secret_version_id_for_get_secret_version_link
global secret_id_for_create_secret_version_link
global secret_version_id_for_get_secret_version_metadata_link
global secret_version_id_for_update_secret_version_metadata_link
global secret_id_for_create_secret_version_locks_link
global secret_version_id_for_create_secret_version_locks_link
global secret_version_id_for_delete_secret_version_locks_link
response = self.secrets_manager_service.list_secret_versions(
secret_id=secret_id_for_get_secret_link,
)
assert response.get_status_code() == 200
secret_version_metadata_collection = response.get_result()
assert secret_version_metadata_collection is not None
secret_version_id_for_get_secret_version_link = secret_version_metadata_collection['versions'][0]['id']
secret_id_for_create_secret_version_link = secret_version_metadata_collection['versions'][0]['secret_id']
secret_version_id_for_get_secret_version_metadata_link = secret_version_metadata_collection['versions'][0]['id']
secret_version_id_for_update_secret_version_metadata_link = secret_version_metadata_collection['versions'][0]['id']
secret_id_for_create_secret_version_locks_link = secret_version_metadata_collection['versions'][0]['secret_id']
secret_version_id_for_create_secret_version_locks_link = secret_version_metadata_collection['versions'][0]['id']
secret_version_id_for_delete_secret_version_locks_link = secret_version_metadata_collection['versions'][0]['id']
@needscredentials
def test_create_secret_locks_bulk(self):
global secret_id_for_list_secret_locks_link
global secret_id_for_list_secret_version_locks_link
global secret_version_id_for_list_secret_version_locks_link
# Construct a dict representation of a SecretLockPrototype model
secret_lock_prototype_model = {
'name': 'lock-example-1',
'description': 'lock for consumer 1',
'attributes': {'key': 'value'},
}
response = self.secrets_manager_service.create_secret_locks_bulk(
id=secret_id_for_get_secret_link,
locks=[secret_lock_prototype_model],
mode='remove_previous',
)
assert response.get_status_code() == 201
secret_locks = response.get_result()
assert secret_locks is not None
secret_id_for_list_secret_locks_link = secret_locks['secret_id']
secret_id_for_list_secret_version_locks_link = secret_locks['secret_id']
secret_version_id_for_list_secret_version_locks_link = secret_locks['versions'][0]['version_id']
@needscredentials
def test_create_configuration(self):
global configuration_name_for_get_configuration_link
# Construct a dict representation of a PublicCertificateConfigurationDNSCloudInternetServicesPrototype model
configuration_prototype_model = {
'config_type': 'public_cert_configuration_dns_cloud_internet_services',
'name': 'example-cloud-internet-services-config',
'cloud_internet_services_apikey': '5ipu_ykv0PMp2MhxQnDMn7VzrkSlBwi3BOI8uthi_EXZ',
'cloud_internet_services_crn': 'crn:v1:bluemix:public:internet-svcs:global:a/128e84fcca45c1224aae525d31ef2b52:009a0357-1460-42b4-b903-10580aba7dd8::',
}
response = self.secrets_manager_service.create_configuration(
configuration_prototype=configuration_prototype_model,
)
assert response.get_status_code() == 201
configuration = response.get_result()
assert configuration is not None
configuration_name_for_get_configuration_link = configuration['name']
@needscredentials
def test_list_secret_groups(self):
response = self.secrets_manager_service.list_secret_groups()
assert response.get_status_code() == 200
secret_group_collection = response.get_result()
assert secret_group_collection is not None
@needscredentials
def test_get_secret_group(self):
response = self.secrets_manager_service.get_secret_group(
id=secret_group_id_for_get_secret_group_link,
)
assert response.get_status_code() == 200
secret_group = response.get_result()
assert secret_group is not None
@needscredentials
def test_update_secret_group(self):
# Construct a dict representation of a SecretGroupPatch model
secret_group_patch_model = {
'name': 'my-secret-group',
'description': 'Extended description for this group.',
}
response = self.secrets_manager_service.update_secret_group(
id=secret_group_id_for_get_secret_group_link,
secret_group_patch=secret_group_patch_model,
)
assert response.get_status_code() == 200
secret_group = response.get_result()
assert secret_group is not None
@needscredentials
def test_get_secret(self):
response = self.secrets_manager_service.get_secret(
id=secret_id_for_get_secret_link,
)
assert response.get_status_code() == 200
secret = response.get_result()
assert secret is not None
@needscredentials
def test_get_secret_metadata(self):
response = self.secrets_manager_service.get_secret_metadata(
id=secret_id_for_get_secret_link,
)
assert response.get_status_code() == 200
secret_metadata = response.get_result()
assert secret_metadata is not None
# The integration test for create_secret_action has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_create_secret_action(self):
@needscredentials
def test_get_secret_by_name_type(self):
response = self.secrets_manager_service.get_secret_by_name_type(
secret_type='arbitrary',
name=secret_name_link,
secret_group_name='default',
)
assert response.get_status_code() == 200
secret = response.get_result()
assert secret is not None
@needscredentials
def test_create_secret_version(self):
# Construct a dict representation of a ArbitrarySecretVersionPrototype model
secret_version_prototype_model = {
'payload': 'updated secret credentials',
'custom_metadata': {'metadata_custom_key': 'metadata_custom_value'},
'version_custom_metadata': {'custom_version_key': 'custom_version_value'},
}
response = self.secrets_manager_service.create_secret_version(
secret_id=secret_id_for_get_secret_link,
secret_version_prototype=secret_version_prototype_model,
)
assert response.get_status_code() == 201
secret_version = response.get_result()
assert secret_version is not None
@needscredentials
def test_get_secret_version(self):
response = self.secrets_manager_service.get_secret_version(
secret_id=secret_id_for_get_secret_link,
id=secret_version_id_for_get_secret_version_link,
)
assert response.get_status_code() == 200
secret_version = response.get_result()
assert secret_version is not None
@needscredentials
def test_get_secret_version_metadata(self):
response = self.secrets_manager_service.get_secret_version_metadata(
secret_id=secret_id_for_get_secret_link,
id=secret_version_id_for_get_secret_version_link,
)
assert response.get_status_code() == 200
secret_version_metadata = response.get_result()
assert secret_version_metadata is not None
@needscredentials
def test_update_secret_version_metadata(self):
# Construct a dict representation of a SecretVersionMetadataPatch model
secret_version_metadata_patch_model = {
'version_custom_metadata': {'key': 'value'},
}
response = self.secrets_manager_service.update_secret_version_metadata(
secret_id=secret_id_for_get_secret_link,
id=secret_version_id_for_get_secret_version_link,
secret_version_metadata_patch=secret_version_metadata_patch_model,
)
assert response.get_status_code() == 200
secret_version_metadata = response.get_result()
assert secret_version_metadata is not None
# The integration test for create_secret_version_action has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_create_secret_version_action(self):
# The integration test for list_secret_tasks has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_list_secret_tasks(self):
# The integration test for get_secret_task has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_get_secret_task(self):
# The integration test for replace_secret_task has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_replace_secret_task(self):
@needscredentials
def test_list_secrets_locks(self):
response = self.secrets_manager_service.list_secrets_locks(
offset=0,
limit=200,
search='example',
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
)
assert response.get_status_code() == 200
secrets_locks_paginated_collection = response.get_result()
assert secrets_locks_paginated_collection is not None
@needscredentials
def test_list_secrets_locks_with_pager(self):
all_results = []
# Test get_next().
pager = SecretsLocksPager(
client=self.secrets_manager_service,
limit=10,
search='example',
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
)
while pager.has_next():
next_page = pager.get_next()
assert next_page is not None
all_results.extend(next_page)
# Test get_all().
pager = SecretsLocksPager(
client=self.secrets_manager_service,
limit=10,
search='example',
groups=['default', 'cac40995-c37a-4dcb-9506-472869077634'],
)
all_items = pager.get_all()
assert all_items is not None
assert len(all_results) == len(all_items)
print(f'\nlist_secrets_locks() returned a total of {len(all_results)} items(s) using SecretsLocksPager.')
@needscredentials
def test_list_secret_locks(self):
response = self.secrets_manager_service.list_secret_locks(
id=secret_id_for_get_secret_link,
offset=0,
limit=25,
sort='name',
search='example',
)
assert response.get_status_code() == 200
secret_locks_paginated_collection = response.get_result()
assert secret_locks_paginated_collection is not None
@needscredentials
def test_list_secret_locks_with_pager(self):
all_results = []
# Test get_next().
pager = SecretLocksPager(
client=self.secrets_manager_service,
id=secret_id_for_get_secret_link,
limit=10,
sort='name',
search='example',
)
while pager.has_next():
next_page = pager.get_next()
assert next_page is not None
all_results.extend(next_page)
# Test get_all().
pager = SecretLocksPager(
client=self.secrets_manager_service,
id=secret_id_for_get_secret_link,
limit=10,
sort='name',
search='example',
)
all_items = pager.get_all()
assert all_items is not None
assert len(all_results) == len(all_items)
print(f'\nlist_secret_locks() returned a total of {len(all_results)} items(s) using SecretLocksPager.')
@needscredentials
def test_create_secret_version_locks_bulk(self):
# Construct a dict representation of a SecretLockPrototype model
secret_lock_prototype_model = {
'name': 'lock-example-1',
'description': 'lock for consumer 1',
'attributes': {'key': 'value'},
}
response = self.secrets_manager_service.create_secret_version_locks_bulk(
secret_id=secret_id_for_get_secret_link,
id=secret_version_id_for_get_secret_version_link,
locks=[secret_lock_prototype_model],
mode='remove_previous',
)
assert response.get_status_code() == 201
secret_locks = response.get_result()
assert secret_locks is not None
@needscredentials
def test_list_secret_version_locks(self):
response = self.secrets_manager_service.list_secret_version_locks(
secret_id=secret_id_for_get_secret_link,
id=secret_version_id_for_get_secret_version_link,
offset=0,
limit=25,
sort='name',
search='example',
)
assert response.get_status_code() == 200
secret_version_locks_paginated_collection = response.get_result()
assert secret_version_locks_paginated_collection is not None
@needscredentials
def test_list_secret_version_locks_with_pager(self):
all_results = []
# Test get_next().
pager = SecretVersionLocksPager(
client=self.secrets_manager_service,
secret_id=secret_id_for_get_secret_link,
id=secret_version_id_for_get_secret_version_link,
limit=10,
sort='name',
search='example',
)
while pager.has_next():
next_page = pager.get_next()
assert next_page is not None
all_results.extend(next_page)
# Test get_all().
pager = SecretVersionLocksPager(
client=self.secrets_manager_service,
secret_id=secret_id_for_get_secret_link,
id=secret_version_id_for_get_secret_version_link,
limit=10,
sort='name',
search='example',
)
all_items = pager.get_all()
assert all_items is not None
assert len(all_results) == len(all_items)
print(f'\nlist_secret_version_locks() returned a total of {len(all_results)} items(s) using SecretVersionLocksPager.')
@needscredentials
def test_list_configurations(self):
response = self.secrets_manager_service.list_configurations(
offset=0,
limit=200,
sort='config_type',
search='example',
secret_types=['iam_credentials', 'public_cert', 'private_cert', 'custom_credentials'],
)
assert response.get_status_code() == 200
configuration_metadata_paginated_collection = response.get_result()
assert configuration_metadata_paginated_collection is not None
@needscredentials
def test_list_configurations_with_pager(self):
all_results = []
# Test get_next().
pager = ConfigurationsPager(
client=self.secrets_manager_service,
limit=10,
sort='config_type',
search='example',
secret_types=['iam_credentials', 'public_cert', 'private_cert', 'custom_credentials'],
)
while pager.has_next():
next_page = pager.get_next()
assert next_page is not None
all_results.extend(next_page)
# Test get_all().
pager = ConfigurationsPager(
client=self.secrets_manager_service,
limit=10,
sort='config_type',
search='example',
secret_types=['iam_credentials', 'public_cert', 'private_cert', 'custom_credentials'],
)
all_items = pager.get_all()
assert all_items is not None
assert len(all_results) == len(all_items)
print(f'\nlist_configurations() returned a total of {len(all_results)} items(s) using ConfigurationsPager.')
@needscredentials
def test_get_configuration(self):
response = self.secrets_manager_service.get_configuration(
name=configuration_name_for_get_configuration_link,
x_sm_accept_configuration_type='public_cert_configuration_dns_cloud_internet_services',
)
assert response.get_status_code() == 200
configuration = response.get_result()
assert configuration is not None
@needscredentials
def test_update_configuration(self):
# Construct a dict representation of a PublicCertificateConfigurationDNSCloudInternetServicesPatch model
configuration_patch_model = {
'cloud_internet_services_apikey': '5ipu_ykv0PMp2MhxQnDMn7VzrkSlBwi3BOI8uthi_EXZ',
'cloud_internet_services_crn': 'crn:v1:bluemix:public:internet-svcs:global:a/128e84fcca45c1224aae525d31ef2b52:009a0357-1460-42b4-b903-10580aba7dd8::',
}
response = self.secrets_manager_service.update_configuration(
name=configuration_name_for_get_configuration_link,
configuration_patch=configuration_patch_model,
x_sm_accept_configuration_type='public_cert_configuration_dns_cloud_internet_services',
)
assert response.get_status_code() == 200
configuration = response.get_result()
assert configuration is not None
# The integration test for create_configuration_action has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_create_configuration_action(self):
@needscredentials
def test_create_notifications_registration(self):
response = self.secrets_manager_service.create_notifications_registration(
event_notifications_instance_crn='crn:v1:bluemix:public:event-notifications:us-south:a/22018f3c34ff4ff193698d15ca316946:578ad1a4-2fd8-4e66-95d5-79a842ba91f8::',
event_notifications_source_name='My Secrets Manager',
event_notifications_source_description='Optional description of this source in an Event Notifications instance.',
)
assert response.get_status_code() == 201
notifications_registration = response.get_result()
assert notifications_registration is not None
@needscredentials
def test_get_notifications_registration(self):
response = self.secrets_manager_service.get_notifications_registration()
assert response.get_status_code() == 200
notifications_registration = response.get_result()
assert notifications_registration is not None
# The integration test for get_notifications_registration_test has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_get_notifications_registration_test(self):
@needscredentials
def test_delete_secret_group(self):
response = self.secrets_manager_service.delete_secret_group(
id=secret_group_id_for_get_secret_group_link,
)
assert response.get_status_code() == 204
@needscredentials
def test_delete_secret_locks_bulk(self):
response = self.secrets_manager_service.delete_secret_locks_bulk(
id=secret_id_for_get_secret_link,
name=['lock-example-1'],
)
assert response.get_status_code() == 200
secret_locks = response.get_result()
assert secret_locks is not None
@needscredentials
def test_delete_secret_version_locks_bulk(self):
response = self.secrets_manager_service.delete_secret_version_locks_bulk(
secret_id=secret_id_for_get_secret_link,
id=secret_version_id_for_get_secret_version_link,
name=['lock-example-1'],
)
assert response.get_status_code() == 200
secret_locks = response.get_result()
assert secret_locks is not None
@needscredentials
def test_delete_secret(self):
response = self.secrets_manager_service.delete_secret(
id=secret_id_for_get_secret_link,
force_delete=False,
)
assert response.get_status_code() == 204
# The integration test for delete_secret_version_data has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_delete_secret_version_data(self):
# The integration test for delete_secret_task has been explicitly excluded from generation.
# A test for this operation must be developed manually.
# @needscredentials
# def test_delete_secret_task(self):
@needscredentials
def test_delete_configuration(self):
response = self.secrets_manager_service.delete_configuration(
name=configuration_name_for_get_configuration_link,
x_sm_accept_configuration_type='public_cert_configuration_dns_cloud_internet_services',
)
assert response.get_status_code() == 204
@needscredentials
def test_delete_notifications_registration(self):
response = self.secrets_manager_service.delete_notifications_registration()
assert response.get_status_code() == 204