Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: reject creating project with empty key (#2545)

Yilong Li6f6feed77194
diff --git a/server/project.go b/server/project.go
index 99e071b522..460c963b92 100644
--- a/server/project.go
+++ b/server/project.go
@@ -30,6 +30,9 @@ func (s *Server) registerProjectRoutes(g *echo.Group) {
if err := jsonapi.UnmarshalPayload(c.Request().Body, projectCreate); err != nil {
return echo.NewHTTPError(http.StatusBadRequest, "Malformed create project request").SetInternal(err)
}
+ if projectCreate.Key == "" {
+ return echo.NewHTTPError(http.StatusBadRequest, "Project key can not be empty")
+ }
if projectCreate.TenantMode == api.TenantModeTenant && !s.feature(api.FeatureMultiTenancy) {
return echo.NewHTTPError(http.StatusForbidden, api.FeatureMultiTenancy.AccessErrorMessage())
}