Skip to content

Commit 759745b

Browse files
authored
add period, allow up to db limit (#2419)
1 parent 2486789 commit 759745b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

taco/internal/domain/organization.go

Lines changed: 5 additions & 5 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, spaces, colons
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, periods
18+
var OrgIDPattern = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9_\- :.]*[a-zA-Z0-9]$`)
1919

2020
// ============================================
2121
// Domain Models
@@ -92,11 +92,11 @@ func ValidateOrgID(orgID string) error {
9292
if len(orgID) < 3 {
9393
return fmt.Errorf("%w: must be at least 3 characters", ErrInvalidOrgID)
9494
}
95-
if len(orgID) > 50 {
96-
return fmt.Errorf("%w: must be at most 50 characters", ErrInvalidOrgID)
95+
if len(orgID) > 255 {
96+
return fmt.Errorf("%w: must be at most 255 characters", ErrInvalidOrgID)
9797
}
9898
if !OrgIDPattern.MatchString(orgID) {
99-
return fmt.Errorf("%w: must contain only letters, numbers, hyphens, underscores, spaces, and colons", ErrInvalidOrgID)
99+
return fmt.Errorf("%w: must contain only letters, numbers, hyphens, underscores, spaces, colons, and periods", ErrInvalidOrgID)
100100
}
101101
return nil
102102
}

0 commit comments

Comments
 (0)