@@ -231,6 +231,16 @@ func TestValidateURLTokenURL(t *testing.T) {
231
231
{"https://" , false },
232
232
{"http://us-east-1.sts.googleapis.com" , false },
233
233
{"https://us-east-1.sts.googleapis.comevil.com" , false },
234
+ {"https://sts-xyz.p.googleapis.com" , true },
235
+ {"https://sts.pgoogleapis.com" , false },
236
+ {"https://p.googleapis.com" , false },
237
+ {"https://sts.p.com" , false },
238
+ {"http://sts.p.googleapis.com" , false },
239
+ {"https://xyz-sts.p.googleapis.com" , false },
240
+ {"https://sts-xyz.123.p.googleapis.com" , false },
241
+ {"https://sts-xyz.p1.googleapis.com" , false },
242
+ {"https://sts-xyz.p.foo.com" , false },
243
+ {"https://sts-xyz.p.foo.googleapis.com" , false },
234
244
}
235
245
ctx := context .Background ()
236
246
for _ , tt := range urlValidityTests {
@@ -287,6 +297,16 @@ func TestValidateURLImpersonateURL(t *testing.T) {
287
297
{"https://" , false },
288
298
{"http://us-east-1.iamcredentials.googleapis.com" , false },
289
299
{"https://us-east-1.iamcredentials.googleapis.comevil.com" , false },
300
+ {"https://iamcredentials-xyz.p.googleapis.com" , true },
301
+ {"https://iamcredentials.pgoogleapis.com" , false },
302
+ {"https://p.googleapis.com" , false },
303
+ {"https://iamcredentials.p.com" , false },
304
+ {"http://iamcredentials.p.googleapis.com" , false },
305
+ {"https://xyz-iamcredentials.p.googleapis.com" , false },
306
+ {"https://iamcredentials-xyz.123.p.googleapis.com" , false },
307
+ {"https://iamcredentials-xyz.p1.googleapis.com" , false },
308
+ {"https://iamcredentials-xyz.p.foo.com" , false },
309
+ {"https://iamcredentials-xyz.p.foo.googleapis.com" , false },
290
310
}
291
311
ctx := context .Background ()
292
312
for _ , tt := range urlValidityTests {
0 commit comments