mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-06-10 06:10:46 +00:00
f3f4c67b36
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>
17 lines
529 B
Go
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
|
|
}
|