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

This commit is contained in:
Kristoffer Dalby
2026-06-18 12:36:12 +00:00
parent f636e6db8b
commit 2a1ae1a2fc
+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)
}