66
66
WORKFORCE_SUBJECT_TOKEN_TYPE = "urn:ietf:params:oauth:token-type:id_token"
67
67
WORKFORCE_POOL_USER_PROJECT = "WORKFORCE_POOL_USER_PROJECT_NUMBER"
68
68
69
+ DEFAULT_UNIVERSE_DOMAIN = "googleapis.com"
69
70
70
71
VALID_TOKEN_URLS = [
71
72
"https://sts.googleapis.com" ,
@@ -410,6 +411,7 @@ def test_from_info_full_options(self, mock_init):
410
411
credential_source = self .CREDENTIAL_SOURCE_TEXT ,
411
412
quota_project_id = QUOTA_PROJECT_ID ,
412
413
workforce_pool_user_project = None ,
414
+ universe_domain = DEFAULT_UNIVERSE_DOMAIN ,
413
415
)
414
416
415
417
@mock .patch .object (identity_pool .Credentials , "__init__" , return_value = None )
@@ -437,6 +439,7 @@ def test_from_info_required_options_only(self, mock_init):
437
439
credential_source = self .CREDENTIAL_SOURCE_TEXT ,
438
440
quota_project_id = None ,
439
441
workforce_pool_user_project = None ,
442
+ universe_domain = DEFAULT_UNIVERSE_DOMAIN ,
440
443
)
441
444
442
445
@mock .patch .object (identity_pool .Credentials , "__init__" , return_value = None )
@@ -465,6 +468,7 @@ def test_from_info_workforce_pool(self, mock_init):
465
468
credential_source = self .CREDENTIAL_SOURCE_TEXT ,
466
469
quota_project_id = None ,
467
470
workforce_pool_user_project = WORKFORCE_POOL_USER_PROJECT ,
471
+ universe_domain = DEFAULT_UNIVERSE_DOMAIN ,
468
472
)
469
473
470
474
@mock .patch .object (identity_pool .Credentials , "__init__" , return_value = None )
@@ -499,6 +503,7 @@ def test_from_file_full_options(self, mock_init, tmpdir):
499
503
credential_source = self .CREDENTIAL_SOURCE_TEXT ,
500
504
quota_project_id = QUOTA_PROJECT_ID ,
501
505
workforce_pool_user_project = None ,
506
+ universe_domain = DEFAULT_UNIVERSE_DOMAIN ,
502
507
)
503
508
504
509
@mock .patch .object (identity_pool .Credentials , "__init__" , return_value = None )
@@ -527,6 +532,7 @@ def test_from_file_required_options_only(self, mock_init, tmpdir):
527
532
credential_source = self .CREDENTIAL_SOURCE_TEXT ,
528
533
quota_project_id = None ,
529
534
workforce_pool_user_project = None ,
535
+ universe_domain = DEFAULT_UNIVERSE_DOMAIN ,
530
536
)
531
537
532
538
@mock .patch .object (identity_pool .Credentials , "__init__" , return_value = None )
@@ -556,6 +562,7 @@ def test_from_file_workforce_pool(self, mock_init, tmpdir):
556
562
credential_source = self .CREDENTIAL_SOURCE_TEXT ,
557
563
quota_project_id = None ,
558
564
workforce_pool_user_project = WORKFORCE_POOL_USER_PROJECT ,
565
+ universe_domain = DEFAULT_UNIVERSE_DOMAIN ,
559
566
)
560
567
561
568
def test_constructor_nonworkforce_with_workforce_pool_user_project (self ):
@@ -639,6 +646,7 @@ def test_info_with_workforce_pool_user_project(self):
639
646
"token_info_url" : TOKEN_INFO_URL ,
640
647
"credential_source" : self .CREDENTIAL_SOURCE_TEXT_URL ,
641
648
"workforce_pool_user_project" : WORKFORCE_POOL_USER_PROJECT ,
649
+ "universe_domain" : DEFAULT_UNIVERSE_DOMAIN ,
642
650
}
643
651
644
652
def test_info_with_file_credential_source (self ):
@@ -653,6 +661,7 @@ def test_info_with_file_credential_source(self):
653
661
"token_url" : TOKEN_URL ,
654
662
"token_info_url" : TOKEN_INFO_URL ,
655
663
"credential_source" : self .CREDENTIAL_SOURCE_TEXT_URL ,
664
+ "universe_domain" : DEFAULT_UNIVERSE_DOMAIN ,
656
665
}
657
666
658
667
def test_info_with_url_credential_source (self ):
@@ -667,6 +676,7 @@ def test_info_with_url_credential_source(self):
667
676
"token_url" : TOKEN_URL ,
668
677
"token_info_url" : TOKEN_INFO_URL ,
669
678
"credential_source" : self .CREDENTIAL_SOURCE_JSON_URL ,
679
+ "universe_domain" : DEFAULT_UNIVERSE_DOMAIN ,
670
680
}
671
681
672
682
def test_retrieve_subject_token_missing_subject_token (self , tmpdir ):
0 commit comments