Dashboard Tags: Validate max length (#116047)

This commit is contained in:
Stephanie Hingtgen
2026-01-09 03:57:39 -07:00
committed by GitHub
parent 5f8668b3aa
commit b0785e506f
8 changed files with 121 additions and 4 deletions
@@ -542,6 +542,9 @@ func (d *dashboardStore) saveDashboard(ctx context.Context, sess *db.Session, cm
tags := dash.GetTags()
if len(tags) > 0 {
for _, tag := range tags {
if len(tag) > 50 {
return nil, dashboards.ErrDashboardTagTooLong
}
if _, err := sess.Insert(dashboardTag{DashboardId: dash.ID, Term: tag, OrgID: dash.OrgID, DashboardUID: dash.UID}); err != nil {
return nil, err
}