Files
goclaw/internal/store/validate.go
T
Viet Tran f3f4c67b36 Initial commit: GoClaw AI agent gateway
Multi-agent AI gateway with WebSocket RPC, HTTP API, and messaging channel integrations.
Go port of OpenClaw with multi-tenant PostgreSQL, per-user isolation, security hardening,
and production observability.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-22 14:58:07 +07:00

17 lines
529 B
Go

package store
import "fmt"
// MaxUserIDLength is the maximum allowed length for user identifier strings
// (user_id, owner_id, granted_by, requested_by, reviewed_by, etc.).
// Matches the VARCHAR(255) constraint in the database schema.
const MaxUserIDLength = 255
// ValidateUserID checks that a user identifier does not exceed MaxUserIDLength.
func ValidateUserID(id string) error {
if len(id) > MaxUserIDLength {
return fmt.Errorf("user identifier too long: %d chars (max %d)", len(id), MaxUserIDLength)
}
return nil
}