mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-05 15:46:01 +02:00
- Updated launchSettings.json for consistency. - Refactored FileValidationHelper to improve image validation logic. - Enhanced ServerDirectoryService for better connection handling and user count updates. - Improved DatabaseSetup for legacy database handling and seeding default channels. - Refined FirstRunSetup to ensure JWT secret generation. - Removed appsettings.Development.json as it is no longer needed. - Updated EchoHub.Tests project file for consistency. - Added unit tests for FileValidationHelper and PresenceTracker with improved assertions. - Updated ValidationConstantsTests to ensure regex validations are correct. - Cleaned up solution file formatting for better readability.
27 lines
882 B
C#
27 lines
882 B
C#
using System.Text.RegularExpressions;
|
|
|
|
namespace EchoHub.Core.Constants;
|
|
|
|
public static partial class ValidationConstants
|
|
{
|
|
public const string UsernamePattern = @"^[a-zA-Z0-9_-]{3,50}$";
|
|
public const string ChannelNamePattern = @"^[a-zA-Z0-9_-]{2,100}$";
|
|
public const string HexColorPattern = @"^#[0-9a-fA-F]{6}$";
|
|
|
|
public const int MaxPasswordLength = 128;
|
|
public const int MaxDisplayNameLength = 100;
|
|
public const int MaxBioLength = 500;
|
|
public const int MaxStatusMessageLength = 100;
|
|
public const int MaxChannelTopicLength = 500;
|
|
public const int MaxHistoryCount = 100;
|
|
|
|
[GeneratedRegex(UsernamePattern)]
|
|
public static partial Regex UsernameRegex();
|
|
|
|
[GeneratedRegex(ChannelNamePattern)]
|
|
public static partial Regex ChannelNameRegex();
|
|
|
|
[GeneratedRegex(HexColorPattern)]
|
|
public static partial Regex HexColorRegex();
|
|
}
|