1414 ErrInvalidOrgID = errors .New ("invalid organization ID format" )
1515)
1616
17- // OrgIDPattern defines valid organization ID format: lowercase alphanumeric, hyphens, underscores
18- var OrgIDPattern = regexp .MustCompile (`^[a-z0- 9][a-z0- 9_-]*[a-z0 -9]$` )
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]$` )
1919
2020// ============================================
2121// Domain Models
@@ -69,13 +69,13 @@ var (
6969type UserRepository interface {
7070 // Create or get a user (idempotent)
7171 EnsureUser (ctx context.Context , subject , email string ) (* User , error )
72-
72+
7373 // Get user by subject
7474 Get (ctx context.Context , subject string ) (* User , error )
75-
75+
7676 // Get user by email
7777 GetByEmail (ctx context.Context , email string ) (* User , error )
78-
78+
7979 // List all users
8080 List (ctx context.Context ) ([]* User , error )
8181}
@@ -94,9 +94,7 @@ func ValidateOrgID(orgID string) error {
9494 return fmt .Errorf ("%w: must be at most 50 characters" , ErrInvalidOrgID )
9595 }
9696 if ! OrgIDPattern .MatchString (orgID ) {
97- return fmt .Errorf ("%w: must contain only lowercase letters, numbers, hyphens, and underscores" , ErrInvalidOrgID )
97+ return fmt .Errorf ("%w: must contain only letters, numbers, hyphens, and underscores" , ErrInvalidOrgID )
9898 }
9999 return nil
100100}
101-
102-
0 commit comments