@@ -961,11 +961,11 @@ func TestUpsertSettings_ACL(t *testing.T) {
961
961
require .NoError (t , err )
962
962
})
963
963
964
- mux .HandleFunc (settingsPermissionAPIPath , func (w http.ResponseWriter , r * http.Request ) {
964
+ mux .HandleFunc ("/platform/classic/environment-api/v2/settings/objects/{objectId}/permissions" , func (w http.ResponseWriter , r * http.Request ) {
965
965
t .Errorf ("Called '%s' but it should not be called" , r .Pattern )
966
966
})
967
967
968
- mux .HandleFunc (settingsPermissionAllUsersAPIPath , func (w http.ResponseWriter , r * http.Request ) {
968
+ mux .HandleFunc ("/platform/classic/environment-api/v2/settings/objects/{objectId}/permissions/all-users" , func (w http.ResponseWriter , r * http.Request ) {
969
969
t .Errorf ("Called '%s' but it should not be called" , r .Pattern )
970
970
})
971
971
@@ -1014,11 +1014,11 @@ func TestUpsertSettings_ACL(t *testing.T) {
1014
1014
require .NoError (t , err )
1015
1015
})
1016
1016
1017
- mux .HandleFunc (settingsPermissionAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1017
+ mux .HandleFunc ("/platform/classic/environment-api/v2/settings/objects/{objectId}/permissions" , func (w http.ResponseWriter , r * http.Request ) {
1018
1018
t .Errorf ("Called '%s' but it should not be called" , r .Pattern )
1019
1019
})
1020
1020
1021
- mux .HandleFunc (settingsPermissionAllUsersAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1021
+ mux .HandleFunc ("/platform/classic/environment-api/v2/settings/objects/{objectId}/permissions/all-users" , func (w http.ResponseWriter , r * http.Request ) {
1022
1022
t .Errorf ("Called '%s' but it should not be called" , r .Pattern )
1023
1023
})
1024
1024
@@ -1068,11 +1068,11 @@ func TestUpsertSettings_ACL(t *testing.T) {
1068
1068
require .NoError (t , err )
1069
1069
})
1070
1070
1071
- mux .HandleFunc (settingsPermissionAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1071
+ mux .HandleFunc ("/platform/classic/environment-api/v2/settings/objects/{objectId}/permissions" , func (w http.ResponseWriter , r * http.Request ) {
1072
1072
t .Errorf ("Called '%s' but it should not be called" , r .Pattern )
1073
1073
})
1074
1074
1075
- mux .HandleFunc ("DELETE " + settingsPermissionAllUsersAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1075
+ mux .HandleFunc ("DELETE " + "/platform/classic/environment-api/v2/settings/objects/{objectId}/permissions/all-users" , func (w http.ResponseWriter , r * http.Request ) {
1076
1076
deleteCalled = true
1077
1077
_ , err := w .Write ([]byte ("{}" ))
1078
1078
require .NoError (t , err )
@@ -1121,19 +1121,19 @@ func TestUpsertSettings_ACL(t *testing.T) {
1121
1121
require .NoError (t , err )
1122
1122
})
1123
1123
1124
- mux .HandleFunc ("POST " + settingsPermissionAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1124
+ mux .HandleFunc ("POST /platform/classic/environment-api/v2/settings/objects/{objectId}/permissions" , func (w http.ResponseWriter , r * http.Request ) {
1125
1125
postPermissionCalled = true
1126
1126
_ , err := w .Write ([]byte ("{}" ))
1127
1127
require .NoError (t , err )
1128
1128
})
1129
1129
1130
- mux .HandleFunc ("GET " + settingsPermissionAllUsersAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1130
+ mux .HandleFunc ("GET /platform/classic/environment-api/v2/settings/objects/{objectId}/permissions/all-users" , func (w http.ResponseWriter , r * http.Request ) {
1131
1131
w .WriteHeader (http .StatusNotFound )
1132
1132
_ , err := w .Write ([]byte ("{}" ))
1133
1133
require .NoError (t , err )
1134
1134
})
1135
1135
1136
- mux .HandleFunc (settingsPermissionAllUsersAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1136
+ mux .HandleFunc ("/platform/classic/environment-api/v2/settings/objects/{objectId}/permissions/all-users" , func (w http.ResponseWriter , r * http.Request ) {
1137
1137
t .Errorf ("Called '%s' but it should not be called" , r .Pattern )
1138
1138
})
1139
1139
@@ -1180,16 +1180,16 @@ func TestUpsertSettings_ACL(t *testing.T) {
1180
1180
require .NoError (t , err )
1181
1181
})
1182
1182
1183
- mux .HandleFunc (settingsPermissionAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1183
+ mux .HandleFunc ("/platform/classic/environment-api/v2/settings/objects/{objectId}/permissions" , func (w http.ResponseWriter , r * http.Request ) {
1184
1184
t .Errorf ("Called '%s' but it should not be called" , r .Pattern )
1185
1185
})
1186
1186
1187
- mux .HandleFunc ("GET " + settingsPermissionAllUsersAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1187
+ mux .HandleFunc ("GET /platform/classic/environment-api/v2/settings/objects/{objectId}/permissions/all-users" , func (w http.ResponseWriter , r * http.Request ) {
1188
1188
_ , err := w .Write ([]byte ("{}" ))
1189
1189
require .NoError (t , err )
1190
1190
})
1191
1191
1192
- mux .HandleFunc ("PUT " + settingsPermissionAllUsersAPIPath , func (w http.ResponseWriter , r * http.Request ) {
1192
+ mux .HandleFunc ("PUT /platform/classic/environment-api/v2/settings/objects/{objectId}/permissions/all-users" , func (w http.ResponseWriter , r * http.Request ) {
1193
1193
putPermissionCalled = true
1194
1194
_ , err := w .Write ([]byte ("{}" ))
1195
1195
require .NoError (t , err )
@@ -2542,7 +2542,7 @@ func TestSettingsClient_GetPermission(t *testing.T) {
2542
2542
},
2543
2543
expectedResponse : PermissionObject {
2544
2544
Permissions : []TypePermissions {},
2545
- Accessor : & Accessor {Type : TypeAccessor ( AllUsers ) },
2545
+ Accessor : & Accessor {Type : AllUsers },
2546
2546
},
2547
2547
},
2548
2548
{
@@ -2555,7 +2555,7 @@ func TestSettingsClient_GetPermission(t *testing.T) {
2555
2555
},
2556
2556
expectedResponse : PermissionObject {
2557
2557
Permissions : []TypePermissions {Read },
2558
- Accessor : & Accessor {Type : TypeAccessor ( AllUsers ) },
2558
+ Accessor : & Accessor {Type : AllUsers },
2559
2559
},
2560
2560
},
2561
2561
{
@@ -2568,7 +2568,7 @@ func TestSettingsClient_GetPermission(t *testing.T) {
2568
2568
},
2569
2569
expectedResponse : PermissionObject {
2570
2570
Permissions : []TypePermissions {Read , Write },
2571
- Accessor : & Accessor {Type : TypeAccessor ( AllUsers ) },
2571
+ Accessor : & Accessor {Type : AllUsers },
2572
2572
},
2573
2573
},
2574
2574
}
@@ -2656,7 +2656,7 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2656
2656
tests := []struct {
2657
2657
name string
2658
2658
id string
2659
- permissionObject PermissionObject
2659
+ PermissionObject PermissionObject
2660
2660
responses []testutils.ResponseDef
2661
2661
}{
2662
2662
{
@@ -2682,8 +2682,9 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2682
2682
},
2683
2683
},
2684
2684
},
2685
- permissionObject : PermissionObject {
2685
+ PermissionObject : PermissionObject {
2686
2686
Permissions : []TypePermissions {Read , Write },
2687
+ Accessor : & Accessor {Type : AllUsers },
2687
2688
},
2688
2689
},
2689
2690
{
@@ -2706,8 +2707,9 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2706
2707
},
2707
2708
},
2708
2709
},
2709
- permissionObject : PermissionObject {
2710
+ PermissionObject : PermissionObject {
2710
2711
Permissions : []TypePermissions {Write },
2712
+ Accessor : & Accessor {Type : AllUsers },
2711
2713
},
2712
2714
},
2713
2715
}
@@ -2719,7 +2721,7 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2719
2721
dcl , err := NewPlatformSettingsClient (corerest .NewClient (server .URL (), server .Client ()))
2720
2722
assert .NoError (t , err )
2721
2723
2722
- err = dcl .UpsertPermission (t .Context (), tt .id , tt .permissionObject )
2724
+ err = dcl .UpsertPermission (t .Context (), tt .id , tt .PermissionObject )
2723
2725
assert .NoError (t , err )
2724
2726
})
2725
2727
}
@@ -2728,7 +2730,7 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2728
2730
tests := []struct {
2729
2731
name string
2730
2732
id string
2731
- permissionObject PermissionObject
2733
+ PermissionObject PermissionObject
2732
2734
responses []testutils.ResponseDef
2733
2735
}{
2734
2736
{
@@ -2751,8 +2753,9 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2751
2753
},
2752
2754
},
2753
2755
},
2754
- permissionObject : PermissionObject {
2756
+ PermissionObject : PermissionObject {
2755
2757
Permissions : []TypePermissions {Read , Write },
2758
+ Accessor : & Accessor {Type : AllUsers },
2756
2759
},
2757
2760
},
2758
2761
{
@@ -2775,8 +2778,9 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2775
2778
},
2776
2779
},
2777
2780
},
2778
- permissionObject : PermissionObject {
2781
+ PermissionObject : PermissionObject {
2779
2782
Permissions : []TypePermissions {Read , Write },
2783
+ Accessor : & Accessor {Type : AllUsers },
2780
2784
},
2781
2785
},
2782
2786
{
@@ -2792,8 +2796,9 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2792
2796
},
2793
2797
},
2794
2798
},
2795
- permissionObject : PermissionObject {
2799
+ PermissionObject : PermissionObject {
2796
2800
Permissions : []TypePermissions {Read , Write },
2801
+ Accessor : & Accessor {Type : AllUsers },
2797
2802
},
2798
2803
},
2799
2804
{
@@ -2809,7 +2814,7 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2809
2814
},
2810
2815
},
2811
2816
},
2812
- permissionObject : PermissionObject {},
2817
+ PermissionObject : PermissionObject {},
2813
2818
},
2814
2819
}
2815
2820
for _ , tt := range tests {
@@ -2820,7 +2825,7 @@ func TestSettingsClient_UpsertPermission(t *testing.T) {
2820
2825
dcl , err := NewPlatformSettingsClient (corerest .NewClient (server .URL (), server .Client ()))
2821
2826
assert .NoError (t , err )
2822
2827
2823
- err = dcl .UpsertPermission (t .Context (), tt .id , tt .permissionObject )
2828
+ err = dcl .UpsertPermission (t .Context (), tt .id , tt .PermissionObject )
2824
2829
assert .Error (t , err )
2825
2830
})
2826
2831
}
0 commit comments