@@ -973,11 +973,7 @@ func TestHandler_UpdateProvisioner(t *testing.T) {
973
973
CreatedAt : timestamppb .New (createdAt ),
974
974
DeletedAt : timestamppb .New (deletedAt ),
975
975
X509Template : & linkedca.Template {
976
- << << << < HEAD
977
976
Template : []byte ("{ {{ missingFunction }} }" ),
978
- == == == =
979
- Template : []byte ("{!?}" ),
980
- >> >> >> > 440 ac4b2 (Add provisioner template validation )
981
977
},
982
978
}
983
979
body , err := protojson .Marshal (prov )
@@ -1014,11 +1010,7 @@ func TestHandler_UpdateProvisioner(t *testing.T) {
1014
1010
Type : "badRequest" ,
1015
1011
Status : 400 ,
1016
1012
Detail : "bad request" ,
1017
- << << << < HEAD
1018
1013
Message : "invalid template: invalid X.509 template: error parsing template: template: template:1: function \" missingFunction\" not defined" ,
1019
- == == == =
1020
- Message : "invalid template: invalid X.509 template: invalid JSON: invalid character '!' looking for beginning of object key string" ,
1021
- >> >> >> > 440 ac4b2 (Add provisioner template validation )
1022
1014
},
1023
1015
}
1024
1016
},
@@ -1228,23 +1220,13 @@ func Test_validateTemplates(t *testing.T) {
1228
1220
err : nil ,
1229
1221
},
1230
1222
{
1231
- << << << < HEAD
1232
1223
name : "fail/x509-template-missing-quote" ,
1233
1224
args : args {
1234
1225
x509 : & linkedca.Template {
1235
1226
Template : []byte (`{ {{printf "%q" "quoted}} }` ),
1236
1227
},
1237
1228
},
1238
1229
err : errors .New ("invalid X.509 template: error parsing template: template: template:1: unterminated quoted string" ),
1239
- == == == =
1240
- name : "fail/x509-template-trailing-comma" ,
1241
- args : args {
1242
- x509 : & linkedca.Template {
1243
- Template : []byte (`{"x": 1,}` ),
1244
- },
1245
- },
1246
- err : errors .New ("invalid X.509 template: invalid JSON: invalid character '}' looking for beginning of object key string" ),
1247
- >> >> >> > 440 ac4b2 (Add provisioner template validation )
1248
1230
},
1249
1231
{
1250
1232
name : "fail/x509-template-data" ,
@@ -1253,7 +1235,6 @@ func Test_validateTemplates(t *testing.T) {
1253
1235
Data : []byte (`{!?}` ),
1254
1236
},
1255
1237
},
1256
- << << << < HEAD
1257
1238
err : errors .New ("invalid X.509 template data: error validating json template data" ),
1258
1239
},
1259
1240
{
@@ -1264,18 +1245,6 @@ func Test_validateTemplates(t *testing.T) {
1264
1245
},
1265
1246
},
1266
1247
err : errors .New ("invalid SSH template: error parsing template: template: template:1: function \" unknownFunction\" not defined" ),
1267
- == == == =
1268
- err : errors .New ("invalid X.509 template data: invalid JSON: invalid character '!' looking for beginning of object key string" ),
1269
- },
1270
- {
1271
- name : "fail/ssh-template-trailing-comma" ,
1272
- args : args {
1273
- ssh : & linkedca.Template {
1274
- Template : []byte (`{"x": 1,}` ),
1275
- },
1276
- },
1277
- err : errors .New ("invalid SSH template: invalid JSON: invalid character '}' looking for beginning of object key string" ),
1278
- >> >> >> > 440 ac4b2 (Add provisioner template validation )
1279
1248
},
1280
1249
{
1281
1250
name : "fail/ssh-template-data" ,
@@ -1284,11 +1253,7 @@ func Test_validateTemplates(t *testing.T) {
1284
1253
Data : []byte (`{!?}` ),
1285
1254
},
1286
1255
},
1287
- << << << < HEAD
1288
1256
err : errors .New ("invalid SSH template data: error validating json template data" ),
1289
- == == == =
1290
- err : errors .New ("invalid SSH template data: invalid JSON: invalid character '!' looking for beginning of object key string" ),
1291
- >> >> >> > 440 ac4b2 (Add provisioner template validation )
1292
1257
},
1293
1258
}
1294
1259
for _ , tt := range tests {
0 commit comments