servertest: assert an invalid pre-auth-key tag is a 400

This commit is contained in:
Kristoffer Dalby committed 2026-06-19 05:58:10 +00:00
1 parent f636e6db8b
commit 2a1ae1a2fc
1 file changed
+13
+13
View File
@@ -69,3 +69,16 @@ func TestAPIv1_SetPolicy_Invalid(t *testing.T) {
})
requireProblem(t, err, http.StatusBadRequest)
}
func TestAPIv1_CreatePreAuthKey_InvalidTag(t *testing.T) {
srv, client := apiClient(t)
ctx := context.Background()
user := srv.CreateUser(t, "tag-user")
_, err := client.CreatePreAuthKey(ctx, &apiv1.CreatePreAuthKeyReq{
User: apiv1.NewOptUint64(uint64(user.ID)),
AclTags: []string{"not-a-tag"},
})
requireProblem(t, err, http.StatusBadRequest)
}