657 657 | useFips = false
|
658 658 | useDualStack = false
|
659 659 | }
|
660 660 | val expected = Endpoint(
|
661 661 | uri = Url.parse("https://sts.us-iso-west-1.c2s.ic.gov"),
|
662 662 | )
|
663 663 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
664 664 | expectEqualEndpoints(expected, actual)
|
665 665 | }
|
666 666 |
|
667 - | // For region us-iso-east-1 with FIPS enabled and DualStack enabled
|
668 - | @Test
|
669 - | fun test42() = runTest {
|
670 - | val params = StsEndpointParameters {
|
671 - | region = "us-iso-east-1"
|
672 - | useFips = true
|
673 - | useDualStack = true
|
674 - | }
|
675 - | val ex = assertFailsWith<EndpointProviderException> {
|
676 - | DefaultStsEndpointProvider().resolveEndpoint(params)
|
677 - | }
|
678 - | assertEquals("FIPS and DualStack are enabled, but this partition does not support one or both", ex.message)
|
679 - | }
|
680 - |
|
681 667 | // For region us-iso-east-1 with FIPS enabled and DualStack disabled
|
682 668 | @Test
|
683 - | fun test43() = runTest {
|
669 + | fun test42() = runTest {
|
684 670 | val params = StsEndpointParameters {
|
685 671 | region = "us-iso-east-1"
|
686 672 | useFips = true
|
687 673 | useDualStack = false
|
688 674 | }
|
689 675 | val expected = Endpoint(
|
690 676 | uri = Url.parse("https://sts-fips.us-iso-east-1.c2s.ic.gov"),
|
691 677 | )
|
692 678 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
693 679 | expectEqualEndpoints(expected, actual)
|
694 680 | }
|
695 681 |
|
696 - | // For region us-iso-east-1 with FIPS disabled and DualStack enabled
|
697 - | @Test
|
698 - | fun test44() = runTest {
|
699 - | val params = StsEndpointParameters {
|
700 - | region = "us-iso-east-1"
|
701 - | useFips = false
|
702 - | useDualStack = true
|
703 - | }
|
704 - | val ex = assertFailsWith<EndpointProviderException> {
|
705 - | DefaultStsEndpointProvider().resolveEndpoint(params)
|
706 - | }
|
707 - | assertEquals("DualStack is enabled but this partition does not support DualStack", ex.message)
|
708 - | }
|
709 - |
|
710 682 | // For region us-isob-east-1 with FIPS disabled and DualStack disabled
|
711 683 | @Test
|
712 - | fun test45() = runTest {
|
684 + | fun test43() = runTest {
|
713 685 | val params = StsEndpointParameters {
|
714 686 | region = "us-isob-east-1"
|
715 687 | useFips = false
|
716 688 | useDualStack = false
|
717 689 | }
|
718 690 | val expected = Endpoint(
|
719 691 | uri = Url.parse("https://sts.us-isob-east-1.sc2s.sgov.gov"),
|
720 692 | )
|
721 693 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
722 694 | expectEqualEndpoints(expected, actual)
|
723 695 | }
|
724 696 |
|
725 - | // For region us-isob-east-1 with FIPS enabled and DualStack enabled
|
726 - | @Test
|
727 - | fun test46() = runTest {
|
728 - | val params = StsEndpointParameters {
|
729 - | region = "us-isob-east-1"
|
730 - | useFips = true
|
731 - | useDualStack = true
|
732 - | }
|
733 - | val ex = assertFailsWith<EndpointProviderException> {
|
734 - | DefaultStsEndpointProvider().resolveEndpoint(params)
|
735 - | }
|
736 - | assertEquals("FIPS and DualStack are enabled, but this partition does not support one or both", ex.message)
|
737 - | }
|
738 - |
|
739 697 | // For region us-isob-east-1 with FIPS enabled and DualStack disabled
|
740 698 | @Test
|
741 - | fun test47() = runTest {
|
699 + | fun test44() = runTest {
|
742 700 | val params = StsEndpointParameters {
|
743 701 | region = "us-isob-east-1"
|
744 702 | useFips = true
|
745 703 | useDualStack = false
|
746 704 | }
|
747 705 | val expected = Endpoint(
|
748 706 | uri = Url.parse("https://sts-fips.us-isob-east-1.sc2s.sgov.gov"),
|
749 707 | )
|
750 708 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
751 709 | expectEqualEndpoints(expected, actual)
|
752 710 | }
|
753 711 |
|
754 - | // For region us-isob-east-1 with FIPS disabled and DualStack enabled
|
755 - | @Test
|
756 - | fun test48() = runTest {
|
757 - | val params = StsEndpointParameters {
|
758 - | region = "us-isob-east-1"
|
759 - | useFips = false
|
760 - | useDualStack = true
|
761 - | }
|
762 - | val ex = assertFailsWith<EndpointProviderException> {
|
763 - | DefaultStsEndpointProvider().resolveEndpoint(params)
|
764 - | }
|
765 - | assertEquals("DualStack is enabled but this partition does not support DualStack", ex.message)
|
766 - | }
|
767 - |
|
768 712 | // For custom endpoint with region set and fips disabled and dualstack disabled
|
769 713 | @Test
|
770 - | fun test49() = runTest {
|
714 + | fun test45() = runTest {
|
771 715 | val params = StsEndpointParameters {
|
772 716 | region = "us-east-1"
|
773 717 | useFips = false
|
774 718 | useDualStack = false
|
775 719 | endpoint = "https://example.com"
|
776 720 | }
|
777 721 | val expected = Endpoint(
|
778 722 | uri = Url.parse("https://example.com"),
|
779 723 | )
|
780 724 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
781 725 | expectEqualEndpoints(expected, actual)
|
782 726 | }
|
783 727 |
|
784 728 | // For custom endpoint with region not set and fips disabled and dualstack disabled
|
785 729 | @Test
|
786 - | fun test50() = runTest {
|
730 + | fun test46() = runTest {
|
787 731 | val params = StsEndpointParameters {
|
788 732 | useFips = false
|
789 733 | useDualStack = false
|
790 734 | endpoint = "https://example.com"
|
791 735 | }
|
792 736 | val expected = Endpoint(
|
793 737 | uri = Url.parse("https://example.com"),
|
794 738 | )
|
795 739 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
796 740 | expectEqualEndpoints(expected, actual)
|
797 741 | }
|
798 742 |
|
799 743 | // For custom endpoint with fips enabled and dualstack disabled
|
800 744 | @Test
|
801 - | fun test51() = runTest {
|
745 + | fun test47() = runTest {
|
802 746 | val params = StsEndpointParameters {
|
803 747 | region = "us-east-1"
|
804 748 | useFips = true
|
805 749 | useDualStack = false
|
806 750 | endpoint = "https://example.com"
|
807 751 | }
|
808 752 | val ex = assertFailsWith<EndpointProviderException> {
|
809 753 | DefaultStsEndpointProvider().resolveEndpoint(params)
|
810 754 | }
|
811 755 | assertEquals("Invalid Configuration: FIPS and custom endpoint are not supported", ex.message)
|
812 756 | }
|
813 757 |
|
814 758 | // For custom endpoint with fips disabled and dualstack enabled
|
815 759 | @Test
|
816 - | fun test52() = runTest {
|
760 + | fun test48() = runTest {
|
817 761 | val params = StsEndpointParameters {
|
818 762 | region = "us-east-1"
|
819 763 | useFips = false
|
820 764 | useDualStack = true
|
821 765 | endpoint = "https://example.com"
|
822 766 | }
|
823 767 | val ex = assertFailsWith<EndpointProviderException> {
|
824 768 | DefaultStsEndpointProvider().resolveEndpoint(params)
|
825 769 | }
|
826 770 | assertEquals("Invalid Configuration: Dualstack and custom endpoint are not supported", ex.message)
|
827 771 | }
|
828 772 |
|
829 773 | // Missing region
|
830 774 | @Test
|
831 - | fun test53() = runTest {
|
775 + | fun test49() = runTest {
|
832 776 | val params = StsEndpointParameters {
|
833 777 | }
|
834 778 | val ex = assertFailsWith<EndpointProviderException> {
|
835 779 | DefaultStsEndpointProvider().resolveEndpoint(params)
|
836 780 | }
|
837 781 | assertEquals("Invalid Configuration: Missing Region", ex.message)
|
838 782 | }
|
839 783 |
|
840 784 | // UseGlobalEndpoint with legacy region `ap-northeast-1`
|
841 785 | @Test
|
842 - | fun test54() = runTest {
|
786 + | fun test50() = runTest {
|
843 787 | val params = StsEndpointParameters {
|
844 788 | region = "ap-northeast-1"
|
845 789 | useFips = false
|
846 790 | useDualStack = false
|
847 791 | useGlobalEndpoint = true
|
848 792 | }
|
849 793 | val expected = Endpoint(
|
850 794 | uri = Url.parse("https://sts.amazonaws.com"),
|
851 795 | attributes = attributesOf {
|
852 796 | SigningContextAttributeKey to listOf(
|
853 797 | sigV4(
|
854 798 | serviceName = "sts",
|
855 799 | disableDoubleUriEncode = false,
|
856 800 | signingRegion = "us-east-1",
|
857 801 | ),
|
858 802 | )
|
859 803 | },
|
860 804 | )
|
861 805 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
862 806 | expectEqualEndpoints(expected, actual)
|
863 807 | }
|
864 808 |
|
865 809 | // UseGlobalEndpoint with legacy region `ap-south-1`
|
866 810 | @Test
|
867 - | fun test55() = runTest {
|
811 + | fun test51() = runTest {
|
868 812 | val params = StsEndpointParameters {
|
869 813 | region = "ap-south-1"
|
870 814 | useFips = false
|
871 815 | useDualStack = false
|
872 816 | useGlobalEndpoint = true
|
873 817 | }
|
874 818 | val expected = Endpoint(
|
875 819 | uri = Url.parse("https://sts.amazonaws.com"),
|
876 820 | attributes = attributesOf {
|
877 821 | SigningContextAttributeKey to listOf(
|
878 822 | sigV4(
|
879 823 | serviceName = "sts",
|
880 824 | disableDoubleUriEncode = false,
|
881 825 | signingRegion = "us-east-1",
|
882 826 | ),
|
883 827 | )
|
884 828 | },
|
885 829 | )
|
886 830 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
887 831 | expectEqualEndpoints(expected, actual)
|
888 832 | }
|
889 833 |
|
890 834 | // UseGlobalEndpoint with legacy region `ap-southeast-1`
|
891 835 | @Test
|
892 - | fun test56() = runTest {
|
836 + | fun test52() = runTest {
|
893 837 | val params = StsEndpointParameters {
|
894 838 | region = "ap-southeast-1"
|
895 839 | useFips = false
|
896 840 | useDualStack = false
|
897 841 | useGlobalEndpoint = true
|
898 842 | }
|
899 843 | val expected = Endpoint(
|
900 844 | uri = Url.parse("https://sts.amazonaws.com"),
|
901 845 | attributes = attributesOf {
|
902 846 | SigningContextAttributeKey to listOf(
|
903 847 | sigV4(
|
904 848 | serviceName = "sts",
|
905 849 | disableDoubleUriEncode = false,
|
906 850 | signingRegion = "us-east-1",
|
907 851 | ),
|
908 852 | )
|
909 853 | },
|
910 854 | )
|
911 855 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
912 856 | expectEqualEndpoints(expected, actual)
|
913 857 | }
|
914 858 |
|
915 859 | // UseGlobalEndpoint with legacy region `ap-southeast-2`
|
916 860 | @Test
|
917 - | fun test57() = runTest {
|
861 + | fun test53() = runTest {
|
918 862 | val params = StsEndpointParameters {
|
919 863 | region = "ap-southeast-2"
|
920 864 | useFips = false
|
921 865 | useDualStack = false
|
922 866 | useGlobalEndpoint = true
|
923 867 | }
|
924 868 | val expected = Endpoint(
|
925 869 | uri = Url.parse("https://sts.amazonaws.com"),
|
926 870 | attributes = attributesOf {
|
927 871 | SigningContextAttributeKey to listOf(
|
928 872 | sigV4(
|
929 873 | serviceName = "sts",
|
930 874 | disableDoubleUriEncode = false,
|
931 875 | signingRegion = "us-east-1",
|
932 876 | ),
|
933 877 | )
|
934 878 | },
|
935 879 | )
|
936 880 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
937 881 | expectEqualEndpoints(expected, actual)
|
938 882 | }
|
939 883 |
|
940 884 | // UseGlobalEndpoint with legacy region `aws-global`
|
941 885 | @Test
|
942 - | fun test58() = runTest {
|
886 + | fun test54() = runTest {
|
943 887 | val params = StsEndpointParameters {
|
944 888 | region = "aws-global"
|
945 889 | useFips = false
|
946 890 | useDualStack = false
|
947 891 | useGlobalEndpoint = true
|
948 892 | }
|
949 893 | val expected = Endpoint(
|
950 894 | uri = Url.parse("https://sts.amazonaws.com"),
|
951 895 | attributes = attributesOf {
|
952 896 | SigningContextAttributeKey to listOf(
|
953 897 | sigV4(
|
954 898 | serviceName = "sts",
|
955 899 | disableDoubleUriEncode = false,
|
956 900 | signingRegion = "us-east-1",
|
957 901 | ),
|
958 902 | )
|
959 903 | },
|
960 904 | )
|
961 905 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
962 906 | expectEqualEndpoints(expected, actual)
|
963 907 | }
|
964 908 |
|
965 909 | // UseGlobalEndpoint with legacy region `ca-central-1`
|
966 910 | @Test
|
967 - | fun test59() = runTest {
|
911 + | fun test55() = runTest {
|
968 912 | val params = StsEndpointParameters {
|
969 913 | region = "ca-central-1"
|
970 914 | useFips = false
|
971 915 | useDualStack = false
|
972 916 | useGlobalEndpoint = true
|
973 917 | }
|
974 918 | val expected = Endpoint(
|
975 919 | uri = Url.parse("https://sts.amazonaws.com"),
|
976 920 | attributes = attributesOf {
|
977 921 | SigningContextAttributeKey to listOf(
|
978 922 | sigV4(
|
979 923 | serviceName = "sts",
|
980 924 | disableDoubleUriEncode = false,
|
981 925 | signingRegion = "us-east-1",
|
982 926 | ),
|
983 927 | )
|
984 928 | },
|
985 929 | )
|
986 930 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
987 931 | expectEqualEndpoints(expected, actual)
|
988 932 | }
|
989 933 |
|
990 934 | // UseGlobalEndpoint with legacy region `eu-central-1`
|
991 935 | @Test
|
992 - | fun test60() = runTest {
|
936 + | fun test56() = runTest {
|
993 937 | val params = StsEndpointParameters {
|
994 938 | region = "eu-central-1"
|
995 939 | useFips = false
|
996 940 | useDualStack = false
|
997 941 | useGlobalEndpoint = true
|
998 942 | }
|
999 943 | val expected = Endpoint(
|
1000 944 | uri = Url.parse("https://sts.amazonaws.com"),
|
1001 945 | attributes = attributesOf {
|
1002 946 | SigningContextAttributeKey to listOf(
|
1003 947 | sigV4(
|
1004 948 | serviceName = "sts",
|
1005 949 | disableDoubleUriEncode = false,
|
1006 950 | signingRegion = "us-east-1",
|
1007 951 | ),
|
1008 952 | )
|
1009 953 | },
|
1010 954 | )
|
1011 955 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1012 956 | expectEqualEndpoints(expected, actual)
|
1013 957 | }
|
1014 958 |
|
1015 959 | // UseGlobalEndpoint with legacy region `eu-north-1`
|
1016 960 | @Test
|
1017 - | fun test61() = runTest {
|
961 + | fun test57() = runTest {
|
1018 962 | val params = StsEndpointParameters {
|
1019 963 | region = "eu-north-1"
|
1020 964 | useFips = false
|
1021 965 | useDualStack = false
|
1022 966 | useGlobalEndpoint = true
|
1023 967 | }
|
1024 968 | val expected = Endpoint(
|
1025 969 | uri = Url.parse("https://sts.amazonaws.com"),
|
1026 970 | attributes = attributesOf {
|
1027 971 | SigningContextAttributeKey to listOf(
|
1028 972 | sigV4(
|
1029 973 | serviceName = "sts",
|
1030 974 | disableDoubleUriEncode = false,
|
1031 975 | signingRegion = "us-east-1",
|
1032 976 | ),
|
1033 977 | )
|
1034 978 | },
|
1035 979 | )
|
1036 980 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1037 981 | expectEqualEndpoints(expected, actual)
|
1038 982 | }
|
1039 983 |
|
1040 984 | // UseGlobalEndpoint with legacy region `eu-west-1`
|
1041 985 | @Test
|
1042 - | fun test62() = runTest {
|
986 + | fun test58() = runTest {
|
1043 987 | val params = StsEndpointParameters {
|
1044 988 | region = "eu-west-1"
|
1045 989 | useFips = false
|
1046 990 | useDualStack = false
|
1047 991 | useGlobalEndpoint = true
|
1048 992 | }
|
1049 993 | val expected = Endpoint(
|
1050 994 | uri = Url.parse("https://sts.amazonaws.com"),
|
1051 995 | attributes = attributesOf {
|
1052 996 | SigningContextAttributeKey to listOf(
|
1053 997 | sigV4(
|
1054 998 | serviceName = "sts",
|
1055 999 | disableDoubleUriEncode = false,
|
1056 1000 | signingRegion = "us-east-1",
|
1057 1001 | ),
|
1058 1002 | )
|
1059 1003 | },
|
1060 1004 | )
|
1061 1005 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1062 1006 | expectEqualEndpoints(expected, actual)
|
1063 1007 | }
|
1064 1008 |
|
1065 1009 | // UseGlobalEndpoint with legacy region `eu-west-2`
|
1066 1010 | @Test
|
1067 - | fun test63() = runTest {
|
1011 + | fun test59() = runTest {
|
1068 1012 | val params = StsEndpointParameters {
|
1069 1013 | region = "eu-west-2"
|
1070 1014 | useFips = false
|
1071 1015 | useDualStack = false
|
1072 1016 | useGlobalEndpoint = true
|
1073 1017 | }
|
1074 1018 | val expected = Endpoint(
|
1075 1019 | uri = Url.parse("https://sts.amazonaws.com"),
|
1076 1020 | attributes = attributesOf {
|
1077 1021 | SigningContextAttributeKey to listOf(
|
1078 1022 | sigV4(
|
1079 1023 | serviceName = "sts",
|
1080 1024 | disableDoubleUriEncode = false,
|
1081 1025 | signingRegion = "us-east-1",
|
1082 1026 | ),
|
1083 1027 | )
|
1084 1028 | },
|
1085 1029 | )
|
1086 1030 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1087 1031 | expectEqualEndpoints(expected, actual)
|
1088 1032 | }
|
1089 1033 |
|
1090 1034 | // UseGlobalEndpoint with legacy region `eu-west-3`
|
1091 1035 | @Test
|
1092 - | fun test64() = runTest {
|
1036 + | fun test60() = runTest {
|
1093 1037 | val params = StsEndpointParameters {
|
1094 1038 | region = "eu-west-3"
|
1095 1039 | useFips = false
|
1096 1040 | useDualStack = false
|
1097 1041 | useGlobalEndpoint = true
|
1098 1042 | }
|
1099 1043 | val expected = Endpoint(
|
1100 1044 | uri = Url.parse("https://sts.amazonaws.com"),
|
1101 1045 | attributes = attributesOf {
|
1102 1046 | SigningContextAttributeKey to listOf(
|
1103 1047 | sigV4(
|
1104 1048 | serviceName = "sts",
|
1105 1049 | disableDoubleUriEncode = false,
|
1106 1050 | signingRegion = "us-east-1",
|
1107 1051 | ),
|
1108 1052 | )
|
1109 1053 | },
|
1110 1054 | )
|
1111 1055 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1112 1056 | expectEqualEndpoints(expected, actual)
|
1113 1057 | }
|
1114 1058 |
|
1115 1059 | // UseGlobalEndpoint with legacy region `sa-east-1`
|
1116 1060 | @Test
|
1117 - | fun test65() = runTest {
|
1061 + | fun test61() = runTest {
|
1118 1062 | val params = StsEndpointParameters {
|
1119 1063 | region = "sa-east-1"
|
1120 1064 | useFips = false
|
1121 1065 | useDualStack = false
|
1122 1066 | useGlobalEndpoint = true
|
1123 1067 | }
|
1124 1068 | val expected = Endpoint(
|
1125 1069 | uri = Url.parse("https://sts.amazonaws.com"),
|
1126 1070 | attributes = attributesOf {
|
1127 1071 | SigningContextAttributeKey to listOf(
|
1128 1072 | sigV4(
|
1129 1073 | serviceName = "sts",
|
1130 1074 | disableDoubleUriEncode = false,
|
1131 1075 | signingRegion = "us-east-1",
|
1132 1076 | ),
|
1133 1077 | )
|
1134 1078 | },
|
1135 1079 | )
|
1136 1080 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1137 1081 | expectEqualEndpoints(expected, actual)
|
1138 1082 | }
|
1139 1083 |
|
1140 1084 | // UseGlobalEndpoint with legacy region `us-east-1`
|
1141 1085 | @Test
|
1142 - | fun test66() = runTest {
|
1086 + | fun test62() = runTest {
|
1143 1087 | val params = StsEndpointParameters {
|
1144 1088 | region = "us-east-1"
|
1145 1089 | useFips = false
|
1146 1090 | useDualStack = false
|
1147 1091 | useGlobalEndpoint = true
|
1148 1092 | }
|
1149 1093 | val expected = Endpoint(
|
1150 1094 | uri = Url.parse("https://sts.amazonaws.com"),
|
1151 1095 | attributes = attributesOf {
|
1152 1096 | SigningContextAttributeKey to listOf(
|
1153 1097 | sigV4(
|
1154 1098 | serviceName = "sts",
|
1155 1099 | disableDoubleUriEncode = false,
|
1156 1100 | signingRegion = "us-east-1",
|
1157 1101 | ),
|
1158 1102 | )
|
1159 1103 | },
|
1160 1104 | )
|
1161 1105 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1162 1106 | expectEqualEndpoints(expected, actual)
|
1163 1107 | }
|
1164 1108 |
|
1165 1109 | // UseGlobalEndpoint with legacy region `us-east-2`
|
1166 1110 | @Test
|
1167 - | fun test67() = runTest {
|
1111 + | fun test63() = runTest {
|
1168 1112 | val params = StsEndpointParameters {
|
1169 1113 | region = "us-east-2"
|
1170 1114 | useFips = false
|
1171 1115 | useDualStack = false
|
1172 1116 | useGlobalEndpoint = true
|
1173 1117 | }
|
1174 1118 | val expected = Endpoint(
|
1175 1119 | uri = Url.parse("https://sts.amazonaws.com"),
|
1176 1120 | attributes = attributesOf {
|
1177 1121 | SigningContextAttributeKey to listOf(
|
1178 1122 | sigV4(
|
1179 1123 | serviceName = "sts",
|
1180 1124 | disableDoubleUriEncode = false,
|
1181 1125 | signingRegion = "us-east-1",
|
1182 1126 | ),
|
1183 1127 | )
|
1184 1128 | },
|
1185 1129 | )
|
1186 1130 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1187 1131 | expectEqualEndpoints(expected, actual)
|
1188 1132 | }
|
1189 1133 |
|
1190 1134 | // UseGlobalEndpoint with legacy region `us-west-1`
|
1191 1135 | @Test
|
1192 - | fun test68() = runTest {
|
1136 + | fun test64() = runTest {
|
1193 1137 | val params = StsEndpointParameters {
|
1194 1138 | region = "us-west-1"
|
1195 1139 | useFips = false
|
1196 1140 | useDualStack = false
|
1197 1141 | useGlobalEndpoint = true
|
1198 1142 | }
|
1199 1143 | val expected = Endpoint(
|
1200 1144 | uri = Url.parse("https://sts.amazonaws.com"),
|
1201 1145 | attributes = attributesOf {
|
1202 1146 | SigningContextAttributeKey to listOf(
|
1203 1147 | sigV4(
|
1204 1148 | serviceName = "sts",
|
1205 1149 | disableDoubleUriEncode = false,
|
1206 1150 | signingRegion = "us-east-1",
|
1207 1151 | ),
|
1208 1152 | )
|
1209 1153 | },
|
1210 1154 | )
|
1211 1155 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1212 1156 | expectEqualEndpoints(expected, actual)
|
1213 1157 | }
|
1214 1158 |
|
1215 1159 | // UseGlobalEndpoint with legacy region `us-west-2`
|
1216 1160 | @Test
|
1217 - | fun test69() = runTest {
|
1161 + | fun test65() = runTest {
|
1218 1162 | val params = StsEndpointParameters {
|
1219 1163 | region = "us-west-2"
|
1220 1164 | useFips = false
|
1221 1165 | useDualStack = false
|
1222 1166 | useGlobalEndpoint = true
|
1223 1167 | }
|
1224 1168 | val expected = Endpoint(
|
1225 1169 | uri = Url.parse("https://sts.amazonaws.com"),
|
1226 1170 | attributes = attributesOf {
|
1227 1171 | SigningContextAttributeKey to listOf(
|
1228 1172 | sigV4(
|
1229 1173 | serviceName = "sts",
|
1230 1174 | disableDoubleUriEncode = false,
|
1231 1175 | signingRegion = "us-east-1",
|
1232 1176 | ),
|
1233 1177 | )
|
1234 1178 | },
|
1235 1179 | )
|
1236 1180 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1237 1181 | expectEqualEndpoints(expected, actual)
|
1238 1182 | }
|
1239 1183 |
|
1240 1184 | // UseGlobalEndpoint with Non-legacy region `us-east-3`
|
1241 1185 | @Test
|
1242 - | fun test70() = runTest {
|
1186 + | fun test66() = runTest {
|
1243 1187 | val params = StsEndpointParameters {
|
1244 1188 | region = "us-east-3"
|
1245 1189 | useFips = false
|
1246 1190 | useDualStack = false
|
1247 1191 | useGlobalEndpoint = true
|
1248 1192 | }
|
1249 1193 | val expected = Endpoint(
|
1250 1194 | uri = Url.parse("https://sts.us-east-3.amazonaws.com"),
|
1251 1195 | attributes = attributesOf {
|
1252 1196 | SigningContextAttributeKey to listOf(
|
1253 1197 | sigV4(
|
1254 1198 | serviceName = "sts",
|
1255 1199 | disableDoubleUriEncode = false,
|
1256 1200 | signingRegion = "us-east-3",
|
1257 1201 | ),
|
1258 1202 | )
|
1259 1203 | },
|
1260 1204 | )
|
1261 1205 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1262 1206 | expectEqualEndpoints(expected, actual)
|
1263 1207 | }
|
1264 1208 |
|
1265 1209 | // UseGlobalEndpoint with legacy region and custom endpoint
|
1266 1210 | @Test
|
1267 - | fun test71() = runTest {
|
1211 + | fun test67() = runTest {
|
1268 1212 | val params = StsEndpointParameters {
|
1269 1213 | region = "us-west-1"
|
1270 1214 | useFips = false
|
1271 1215 | useDualStack = false
|
1272 1216 | useGlobalEndpoint = true
|
1273 1217 | endpoint = "https://example.com"
|
1274 1218 | }
|
1275 1219 | val expected = Endpoint(
|
1276 1220 | uri = Url.parse("https://example.com"),
|
1277 1221 | )
|
1278 1222 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|
1279 1223 | expectEqualEndpoints(expected, actual)
|
1280 1224 | }
|
1281 1225 |
|
1282 1226 | // UseGlobalEndpoint with unset region and custom endpoint
|
1283 1227 | @Test
|
1284 - | fun test72() = runTest {
|
1228 + | fun test68() = runTest {
|
1285 1229 | val params = StsEndpointParameters {
|
1286 1230 | useFips = false
|
1287 1231 | useDualStack = false
|
1288 1232 | useGlobalEndpoint = false
|
1289 1233 | endpoint = "https://example.com"
|
1290 1234 | }
|
1291 1235 | val expected = Endpoint(
|
1292 1236 | uri = Url.parse("https://example.com"),
|
1293 1237 | )
|
1294 1238 | val actual = DefaultStsEndpointProvider().resolveEndpoint(params)
|