@@ -69,11 +69,20 @@ var testUser = &UserRecord{
69
69
MultiFactor : & MultiFactorSettings {
70
70
EnrolledFactors : []* MultiFactorInfo {
71
71
{
72
- UID : "0aaded3f-5e73-461d-aef9-37b48e3769be " ,
72
+ UID : "enrolledFactor1 " ,
73
73
FactorID : "phone" ,
74
74
EnrollmentTimestamp : 1614776780000 ,
75
- PhoneNumber : "+1234567890" ,
76
- DisplayName : "My MFA Phone" ,
75
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
76
+ PhoneNumber : "+1234567890" ,
77
+ },
78
+ DisplayName : "My MFA Phone" ,
79
+ },
80
+ {
81
+ UID : "enrolledFactor2" ,
82
+ FactorID : "totp" ,
83
+ EnrollmentTimestamp : 1614776780000 ,
84
+ TOTPMultiFactorInfo : & TOTPInfo {},
85
+ DisplayName : "My MFA TOTP" ,
77
86
},
78
87
},
79
88
},
@@ -646,8 +655,10 @@ func TestInvalidCreateUser(t *testing.T) {
646
655
(& UserToCreate {}).MFASettings (MultiFactorSettings {
647
656
EnrolledFactors : []* MultiFactorInfo {
648
657
{
649
- UID : "EnrollmentID" ,
650
- PhoneNumber : "+11234567890" ,
658
+ UID : "EnrollmentID" ,
659
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
660
+ PhoneNumber : "+11234567890" ,
661
+ },
651
662
DisplayName : "Spouse's phone number" ,
652
663
FactorID : "phone" ,
653
664
},
@@ -658,7 +669,9 @@ func TestInvalidCreateUser(t *testing.T) {
658
669
(& UserToCreate {}).MFASettings (MultiFactorSettings {
659
670
EnrolledFactors : []* MultiFactorInfo {
660
671
{
661
- PhoneNumber : "invalid" ,
672
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
673
+ PhoneNumber : "invalid" ,
674
+ },
662
675
DisplayName : "Spouse's phone number" ,
663
676
FactorID : "phone" ,
664
677
},
@@ -669,7 +682,9 @@ func TestInvalidCreateUser(t *testing.T) {
669
682
(& UserToCreate {}).MFASettings (MultiFactorSettings {
670
683
EnrolledFactors : []* MultiFactorInfo {
671
684
{
672
- PhoneNumber : "+11234567890" ,
685
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
686
+ PhoneNumber : "+11234567890" ,
687
+ },
673
688
DisplayName : "Spouse's phone number" ,
674
689
FactorID : "phone" ,
675
690
EnrollmentTimestamp : time .Now ().UTC ().Unix (),
@@ -681,7 +696,9 @@ func TestInvalidCreateUser(t *testing.T) {
681
696
(& UserToCreate {}).MFASettings (MultiFactorSettings {
682
697
EnrolledFactors : []* MultiFactorInfo {
683
698
{
684
- PhoneNumber : "+11234567890" ,
699
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
700
+ PhoneNumber : "+11234567890" ,
701
+ },
685
702
DisplayName : "Spouse's phone number" ,
686
703
FactorID : "" ,
687
704
},
@@ -692,8 +709,10 @@ func TestInvalidCreateUser(t *testing.T) {
692
709
(& UserToCreate {}).MFASettings (MultiFactorSettings {
693
710
EnrolledFactors : []* MultiFactorInfo {
694
711
{
695
- PhoneNumber : "+11234567890" ,
696
- FactorID : "phone" ,
712
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
713
+ PhoneNumber : "+11234567890" ,
714
+ },
715
+ FactorID : "phone" ,
697
716
},
698
717
},
699
718
}),
@@ -773,7 +792,9 @@ var createUserCases = []struct {
773
792
(& UserToCreate {}).MFASettings (MultiFactorSettings {
774
793
EnrolledFactors : []* MultiFactorInfo {
775
794
{
776
- PhoneNumber : "+11234567890" ,
795
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
796
+ PhoneNumber : "+11234567890" ,
797
+ },
777
798
DisplayName : "Spouse's phone number" ,
778
799
FactorID : "phone" ,
779
800
},
@@ -790,12 +811,16 @@ var createUserCases = []struct {
790
811
(& UserToCreate {}).MFASettings (MultiFactorSettings {
791
812
EnrolledFactors : []* MultiFactorInfo {
792
813
{
793
- PhoneNumber : "+11234567890" ,
814
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
815
+ PhoneNumber : "+11234567890" ,
816
+ },
794
817
DisplayName : "number1" ,
795
818
FactorID : "phone" ,
796
819
},
797
820
{
798
- PhoneNumber : "+11234567890" ,
821
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
822
+ PhoneNumber : "+11234567890" ,
823
+ },
799
824
DisplayName : "number2" ,
800
825
FactorID : "phone" ,
801
826
},
@@ -875,9 +900,11 @@ func TestInvalidUpdateUser(t *testing.T) {
875
900
(& UserToUpdate {}).MFASettings (MultiFactorSettings {
876
901
EnrolledFactors : []* MultiFactorInfo {
877
902
{
878
- UID : "enrolledSecondFactor1" ,
879
- PhoneNumber : "+11234567890" ,
880
- FactorID : "phone" ,
903
+ UID : "enrolledSecondFactor1" ,
904
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
905
+ PhoneNumber : "+11234567890" ,
906
+ },
907
+ FactorID : "phone" ,
881
908
},
882
909
},
883
910
}),
@@ -886,8 +913,10 @@ func TestInvalidUpdateUser(t *testing.T) {
886
913
(& UserToUpdate {}).MFASettings (MultiFactorSettings {
887
914
EnrolledFactors : []* MultiFactorInfo {
888
915
{
889
- UID : "enrolledSecondFactor1" ,
890
- PhoneNumber : "invalid" ,
916
+ UID : "enrolledSecondFactor1" ,
917
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
918
+ PhoneNumber : "invalid" ,
919
+ },
891
920
DisplayName : "Spouse's phone number" ,
892
921
FactorID : "phone" ,
893
922
},
@@ -898,7 +927,9 @@ func TestInvalidUpdateUser(t *testing.T) {
898
927
(& UserToUpdate {}).MFASettings (MultiFactorSettings {
899
928
EnrolledFactors : []* MultiFactorInfo {
900
929
{
901
- PhoneNumber : "+11234567890" ,
930
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
931
+ PhoneNumber : "+11234567890" ,
932
+ },
902
933
FactorID : "phone" ,
903
934
DisplayName : "Spouse's phone number" ,
904
935
},
@@ -1049,14 +1080,18 @@ var updateUserCases = []struct {
1049
1080
(& UserToUpdate {}).MFASettings (MultiFactorSettings {
1050
1081
EnrolledFactors : []* MultiFactorInfo {
1051
1082
{
1052
- UID : "enrolledSecondFactor1" ,
1053
- PhoneNumber : "+11234567890" ,
1083
+ UID : "enrolledSecondFactor1" ,
1084
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
1085
+ PhoneNumber : "+11234567890" ,
1086
+ },
1054
1087
DisplayName : "Spouse's phone number" ,
1055
1088
FactorID : "phone" ,
1056
1089
EnrollmentTimestamp : time .Now ().Unix (),
1057
1090
}, {
1058
- UID : "enrolledSecondFactor2" ,
1059
- PhoneNumber : "+11234567890" ,
1091
+ UID : "enrolledSecondFactor2" ,
1092
+ PhoneMultiFactorInfo : & PhoneMultiFactorInfo {
1093
+ PhoneNumber : "+11234567890" ,
1094
+ },
1060
1095
DisplayName : "Spouse's phone number" ,
1061
1096
FactorID : "phone" ,
1062
1097
},
@@ -1886,10 +1921,16 @@ func TestMakeExportedUser(t *testing.T) {
1886
1921
MFAInfo : []* multiFactorInfoResponse {
1887
1922
{
1888
1923
PhoneInfo : "+1234567890" ,
1889
- MFAEnrollmentID : "0aaded3f-5e73-461d-aef9-37b48e3769be " ,
1924
+ MFAEnrollmentID : "enrolledFactor1 " ,
1890
1925
DisplayName : "My MFA Phone" ,
1891
1926
EnrolledAt : "2021-03-03T13:06:20.542896Z" ,
1892
1927
},
1928
+ {
1929
+ TOTPInfo : & TOTPInfo {},
1930
+ MFAEnrollmentID : "enrolledFactor2" ,
1931
+ DisplayName : "My MFA TOTP" ,
1932
+ EnrolledAt : "2021-03-03T13:06:20.542896Z" ,
1933
+ },
1893
1934
},
1894
1935
}
1895
1936
0 commit comments