Skip to content

Commit 1d7292f

Browse files
authored
allow spaces and colon (#2414)
1 parent 22b389a commit 1d7292f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

taco/internal/domain/organization.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ var (
1414
ErrInvalidOrgID = errors.New("invalid organization ID format")
1515
)
1616

17-
// OrgIDPattern defines valid organization ID format: alphanumeric, hyphens, underscores
18-
var OrgIDPattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_-]*[a-zA-Z0-9]$`)
17+
// OrgIDPattern defines valid organization ID format: alphanumeric, hyphens, underscores, spaces, colons
18+
var OrgIDPattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_\- :]*[a-zA-Z0-9]$`)
1919

2020
// ============================================
2121
// Domain Models
@@ -96,7 +96,7 @@ func ValidateOrgID(orgID string) error {
9696
return fmt.Errorf("%w: must be at most 50 characters", ErrInvalidOrgID)
9797
}
9898
if !OrgIDPattern.MatchString(orgID) {
99-
return fmt.Errorf("%w: must contain only letters, numbers, hyphens, and underscores", ErrInvalidOrgID)
99+
return fmt.Errorf("%w: must contain only letters, numbers, hyphens, underscores, spaces, and colons", ErrInvalidOrgID)
100100
}
101101
return nil
102102
}

0 commit comments

Comments
 (0)