@@ -387,7 +387,6 @@ def test_create_identity_provider(test_config):
387387 identifiers = ["goodtesting.com" ]
388388 oauth_client_id = "test_client_id"
389389 oauth_client_secret = "test_client_secret"
390- oauth_issuer_id = "test_issuer_id"
391390 oauth_issuer_location = "https://issuer.goodtesting.com"
392391
393392 new_identity_provider = CatalogIdentityProvider .init (
@@ -396,7 +395,6 @@ def test_create_identity_provider(test_config):
396395 identifiers = identifiers ,
397396 oauth_client_id = oauth_client_id ,
398397 oauth_client_secret = oauth_client_secret ,
399- oauth_issuer_id = oauth_issuer_id ,
400398 oauth_issuer_location = oauth_issuer_location ,
401399 )
402400
@@ -408,7 +406,6 @@ def test_create_identity_provider(test_config):
408406 assert identity_provider .attributes .identifiers == identifiers
409407 assert identity_provider .attributes .oauth_client_id == oauth_client_id
410408 assert identity_provider .attributes .oauth_client_secret is None # oauth_client_secret is not returned
411- assert identity_provider .attributes .oauth_issuer_id == oauth_issuer_id
412409 assert identity_provider .attributes .oauth_issuer_location == oauth_issuer_location
413410 finally :
414411 sdk .catalog_organization .delete_identity_provider (identity_provider_id )
@@ -424,7 +421,6 @@ def test_list_identity_providers(test_config):
424421 identifiers = ["goodtesting.com" ]
425422 oauth_client_id = "test_client_id"
426423 oauth_client_secret = "test_client_secret"
427- oauth_issuer_id = "test_issuer_id"
428424 oauth_issuer_location = "https://issuer.goodtesting.com"
429425
430426 new_identity_provider_1 = CatalogIdentityProvider .init (
@@ -433,7 +429,6 @@ def test_list_identity_providers(test_config):
433429 identifiers = identifiers ,
434430 oauth_client_id = oauth_client_id + "_1" ,
435431 oauth_client_secret = oauth_client_secret + "_1" ,
436- oauth_issuer_id = oauth_issuer_id + "_1" ,
437432 oauth_issuer_location = oauth_issuer_location ,
438433 )
439434 new_identity_provider_2 = CatalogIdentityProvider .init (
@@ -442,7 +437,6 @@ def test_list_identity_providers(test_config):
442437 identifiers = identifiers ,
443438 oauth_client_id = oauth_client_id + "_2" ,
444439 oauth_client_secret = oauth_client_secret + "_2" ,
445- oauth_issuer_id = oauth_issuer_id + "_2" ,
446440 oauth_issuer_location = oauth_issuer_location ,
447441 )
448442
@@ -471,7 +465,6 @@ def test_delete_identity_provider(test_config):
471465 identifiers = ["goodtesting.com" ]
472466 oauth_client_id = "test_client_id"
473467 oauth_client_secret = "test_client_secret"
474- oauth_issuer_id = "test_issuer_id"
475468 oauth_issuer_location = "https://issuer.goodtesting.com"
476469
477470 new_identity_provider = CatalogIdentityProvider .init (
@@ -480,7 +473,6 @@ def test_delete_identity_provider(test_config):
480473 identifiers = identifiers ,
481474 oauth_client_id = oauth_client_id ,
482475 oauth_client_secret = oauth_client_secret ,
483- oauth_issuer_id = oauth_issuer_id ,
484476 oauth_issuer_location = oauth_issuer_location ,
485477 )
486478
@@ -503,7 +495,6 @@ def test_update_identity_provider(test_config):
503495 identifiers = ["goodtesting.com" ]
504496 oauth_client_id = "test_client_id"
505497 oauth_client_secret = "test_client_secret"
506- oauth_issuer_id = "test_issuer_id"
507498 oauth_issuer_location = "https://issuer.goodtesting.com"
508499
509500 new_identity_provider = CatalogIdentityProvider .init (
@@ -512,7 +503,6 @@ def test_update_identity_provider(test_config):
512503 identifiers = identifiers ,
513504 oauth_client_id = oauth_client_id ,
514505 oauth_client_secret = oauth_client_secret ,
515- oauth_issuer_id = oauth_issuer_id ,
516506 oauth_issuer_location = oauth_issuer_location ,
517507 )
518508 update_identity_provider = CatalogIdentityProvider .init (
@@ -521,7 +511,6 @@ def test_update_identity_provider(test_config):
521511 identifiers = identifiers + ["anotheridentifier.com" ],
522512 oauth_client_id = oauth_client_id ,
523513 oauth_client_secret = oauth_client_secret ,
524- oauth_issuer_id = oauth_issuer_id ,
525514 oauth_issuer_location = oauth_issuer_location ,
526515 )
527516
@@ -534,13 +523,49 @@ def test_update_identity_provider(test_config):
534523 assert identity_provider .attributes .identifiers == identifiers + ["anotheridentifier.com" ]
535524 assert identity_provider .attributes .oauth_client_id == oauth_client_id
536525 assert identity_provider .attributes .oauth_client_secret is None # oauth_client_secret is not returned
537- assert identity_provider .attributes .oauth_issuer_id == oauth_issuer_id
538526 assert identity_provider .attributes .oauth_issuer_location == oauth_issuer_location
539527 finally :
540528 sdk .catalog_organization .delete_identity_provider (identity_provider_id )
541529 assert len (sdk .catalog_organization .list_identity_providers ()) == 0
542530
543531
532+ @gd_vcr .use_cassette (str (_fixtures_dir / "patch_identity_provider.yaml" ))
533+ def test_patch_identity_provider (test_config ):
534+ sdk = GoodDataSdk .create (host_ = test_config ["host" ], token_ = test_config ["token" ])
535+
536+ identity_provider_id = "test_identity_provider"
537+ custom_claim_mapping = {"email" : "email" }
538+ identifiers = ["goodtesting.com" ]
539+ oauth_client_id = "test_client_id"
540+ oauth_client_secret = "test_client_secret"
541+ oauth_issuer_location = "https://issuer.goodtesting.com"
542+
543+ new_identity_provider = CatalogIdentityProvider .init (
544+ identity_provider_id = identity_provider_id ,
545+ custom_claim_mapping = custom_claim_mapping ,
546+ identifiers = identifiers ,
547+ oauth_client_id = oauth_client_id ,
548+ oauth_client_secret = oauth_client_secret ,
549+ oauth_issuer_location = oauth_issuer_location ,
550+ )
551+
552+ try :
553+ sdk .catalog_organization .create_identity_provider (new_identity_provider )
554+ sdk .catalog_organization .patch_identity_provider_attributes (
555+ identity_provider_id , {"identifiers" : identifiers + ["anotheridentifier.com" ]}
556+ )
557+ patched_identity_provider = sdk .catalog_organization .get_identity_provider (identity_provider_id )
558+ assert patched_identity_provider .id == identity_provider_id
559+ assert patched_identity_provider .attributes .custom_claim_mapping == custom_claim_mapping
560+ assert patched_identity_provider .attributes .identifiers == identifiers + ["anotheridentifier.com" ]
561+ assert patched_identity_provider .attributes .oauth_client_id == oauth_client_id
562+ assert patched_identity_provider .attributes .oauth_client_secret is None # oauth_client_secret is not returned
563+ assert patched_identity_provider .attributes .oauth_issuer_location == oauth_issuer_location
564+ finally :
565+ sdk .catalog_organization .delete_identity_provider (identity_provider_id )
566+ assert len (sdk .catalog_organization .list_identity_providers ()) == 0
567+
568+
544569@gd_vcr .use_cassette (str (_fixtures_dir / "layout_identity_providers.yaml" ))
545570def test_layout_identity_providers (test_config ):
546571 sdk = GoodDataSdk .create (host_ = test_config ["host" ], token_ = test_config ["token" ])
@@ -554,7 +579,6 @@ def test_layout_identity_providers(test_config):
554579 identifiers = ["goodtesting.com" ]
555580 oauth_client_id = "test_client_id"
556581 oauth_client_secret = "test_client_secret"
557- oauth_issuer_id = "test_issuer_id"
558582 oauth_issuer_location = "https://issuer.goodtesting.com"
559583
560584 identity_providers_e = [
@@ -564,7 +588,6 @@ def test_layout_identity_providers(test_config):
564588 identifiers = identifiers ,
565589 oauth_client_id = oauth_client_id ,
566590 oauth_client_secret = oauth_client_secret ,
567- oauth_issuer_id = oauth_issuer_id ,
568591 oauth_issuer_location = oauth_issuer_location ,
569592 ),
570593 ]
@@ -575,7 +598,6 @@ def test_layout_identity_providers(test_config):
575598 assert identity_providers_o [0 ].identifiers == identity_providers_e [0 ].identifiers
576599 assert identity_providers_o [0 ].oauth_client_id == identity_providers_e [0 ].oauth_client_id
577600 assert identity_providers_o [0 ].oauth_client_secret is None
578- assert identity_providers_o [0 ].oauth_issuer_id == identity_providers_o [0 ].oauth_issuer_id
579601 assert identity_providers_o [0 ].oauth_issuer_location == identity_providers_e [0 ].oauth_issuer_location
580602 finally :
581603 sdk .catalog_organization .put_declarative_identity_providers ([])
0 commit comments