Skip to content

Commit 3381cb1

Browse files
padamstxDaniel Byrne
andauthored
fix(IAM Identity): update service after recent API changes (#91)
Co-authored-by: Daniel Byrne <daniel.byrne@ibm.com>
1 parent 9222791 commit 3381cb1

File tree

5 files changed

+835
-39
lines changed

5 files changed

+835
-39
lines changed

.secrets.baseline

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "package-lock.json|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2021-03-04T19:29:18Z",
6+
"generated_at": "2021-03-11T14:48:43Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -64,6 +64,15 @@
6464
}
6565
],
6666
"results": {
67+
"examples/test_iam_identity_v1_examples.py": [
68+
{
69+
"hashed_secret": "a2190c299b60e882d9fb33736d5e6ab6ffe42708",
70+
"is_verified": false,
71+
"line_number": 452,
72+
"type": "Secret Keyword",
73+
"verified_result": null
74+
}
75+
],
6776
"ibm_platform_services/iam_identity_v1.py": [
6877
{
6978
"hashed_secret": "eafd657ce70e075f0b72cdbe48232ed4fd5a47d1",
@@ -77,7 +86,7 @@
7786
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
7887
"is_secret": false,
7988
"is_verified": false,
80-
"line_number": 1698,
89+
"line_number": 2082,
8190
"type": "Secret Keyword",
8291
"verified_result": null
8392
}
@@ -87,7 +96,7 @@
8796
"hashed_secret": "d506bd5213c46bd49e16c634754ad70113408252",
8897
"is_secret": false,
8998
"is_verified": false,
90-
"line_number": 2966,
99+
"line_number": 3123,
91100
"type": "Secret Keyword",
92101
"verified_result": null
93102
}
@@ -102,6 +111,15 @@
102111
"verified_result": null
103112
}
104113
],
114+
"test/integration/test_iam_identity_v1.py": [
115+
{
116+
"hashed_secret": "a2190c299b60e882d9fb33736d5e6ab6ffe42708",
117+
"is_verified": false,
118+
"line_number": 507,
119+
"type": "Secret Keyword",
120+
"verified_result": null
121+
}
122+
],
105123
"test/integration/test_open_service_broker_v1.py": [
106124
{
107125
"hashed_secret": "cf65466f1394d5969a2179be065d0daa54007411",
@@ -243,11 +261,18 @@
243261
"type": "Secret Keyword",
244262
"verified_result": null
245263
},
264+
{
265+
"hashed_secret": "cf4d2385b84329a52ca542285b93d9c4618420df",
266+
"is_verified": false,
267+
"line_number": 1619,
268+
"type": "Secret Keyword",
269+
"verified_result": null
270+
},
246271
{
247272
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
248273
"is_secret": false,
249274
"is_verified": false,
250-
"line_number": 1738,
275+
"line_number": 2013,
251276
"type": "Secret Keyword",
252277
"verified_result": null
253278
}
@@ -257,15 +282,15 @@
257282
"hashed_secret": "d4c3d66fd0c38547a3c7a4c6bdc29c36911bc030",
258283
"is_secret": false,
259284
"is_verified": false,
260-
"line_number": 1441,
285+
"line_number": 2085,
261286
"type": "Secret Keyword",
262287
"verified_result": null
263288
},
264289
{
265290
"hashed_secret": "b8473b86d4c2072ca9b08bd28e373e8253e865c4",
266291
"is_secret": false,
267292
"is_verified": false,
268-
"line_number": 2715,
293+
"line_number": 2967,
269294
"type": "Secret Keyword",
270295
"verified_result": null
271296
}

examples/test_iam_identity_v1_examples.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
apikey_etag = None
5757
svc_id = None
5858
svc_id_etag = None
59+
account_settings_etag = None
5960

6061

6162
##############################################################################
@@ -414,6 +415,53 @@ def test_delete_service_id_example(self):
414415
except ApiException as e:
415416
pytest.fail(str(e))
416417

418+
@needscredentials
419+
def test_get_account_settings_example(self):
420+
"""
421+
get_account_settings request example
422+
"""
423+
try:
424+
global account_settings_etag
425+
# begin-getAccountSettings
426+
427+
response = iam_identity_service.get_account_settings(
428+
account_id=account_id
429+
)
430+
settings = response.get_result()
431+
account_settings_etag = response.get_headers()['Etag']
432+
print(json.dumps(settings, indent=2))
433+
434+
# end-getAccountSettings
435+
436+
except ApiException as e:
437+
pytest.fail(str(e))
438+
439+
@needscredentials
440+
def test_update_account_settings_example(self):
441+
"""
442+
update_account_settings request example
443+
"""
444+
try:
445+
global account_settings_etag
446+
# begin-updateAccountSettings
447+
448+
account_settings_response = iam_identity_service.update_account_settings(
449+
account_id=account_id,
450+
if_match=account_settings_etag,
451+
restrict_create_service_id="NOT_RESTRICTED",
452+
restrict_create_platform_apikey="NOT_RESTRICTED",
453+
mfa="NONE",
454+
session_expiration_in_seconds="86400",
455+
session_invalidation_in_seconds="7200",
456+
).get_result()
457+
458+
print(json.dumps(account_settings_response, indent=2))
459+
460+
# end-updateAccountSettings
461+
462+
except ApiException as e:
463+
pytest.fail(str(e))
464+
417465
# endregion
418466
##############################################################################
419467
# End of Examples for Service: IamIdentityV1

0 commit comments

Comments
 (0)