Default to 8-char slugs for public-internet-safe entropy

5-char slugs over a 32-char alphabet are ~25 bits; brute-forceable at
HTTP speeds once the endpoint is public. 8 chars = 40 bits (~10^12
combinations), infeasible to scan within useful timescales. Existing
5-char slugs still resolve; only new artifacts use the longer form.
This commit is contained in:
claudio
2026-04-22 23:18:36 +02:00
parent 1af1c3efe2
commit 7de9ee2a7c

View File

@@ -38,7 +38,7 @@ type CreateOptions struct {
func (s *Store) CreateArtifact(opts CreateOptions) (*Artifact, error) {
slug := strings.ToLower(strings.TrimSpace(opts.Slug))
if slug == "" {
g, err := s.generateSlug(5)
g, err := s.generateSlug(8)
if err != nil {
return nil, err
}