diff --git a/src/Contracts/Masa.Auth.Contracts.Admin/Sso/Validator/AddCustomLoginValidator.cs b/src/Contracts/Masa.Auth.Contracts.Admin/Sso/Validator/AddCustomLoginValidator.cs index edf1126ba..ebce170b4 100644 --- a/src/Contracts/Masa.Auth.Contracts.Admin/Sso/Validator/AddCustomLoginValidator.cs +++ b/src/Contracts/Masa.Auth.Contracts.Admin/Sso/Validator/AddCustomLoginValidator.cs @@ -7,8 +7,8 @@ public class AddCustomLoginValidator : AbstractValidator { public AddCustomLoginValidator() { - RuleFor(CustomLogin => CustomLogin.Name).Required().ChineseLetterNumber().MinimumLength(2).MaximumLength(50); - RuleFor(CustomLogin => CustomLogin.Title).Required().ChineseLetterNumber().MinimumLength(2).MaximumLength(50); + RuleFor(CustomLogin => CustomLogin.Name).Required().MinimumLength(2).MaximumLength(50); + RuleFor(CustomLogin => CustomLogin.Title).Required().MinimumLength(2).MaximumLength(50); RuleFor(CustomLogin => CustomLogin.ClientId).Required(); } } diff --git a/src/Services/Masa.Auth.Service.Admin/Infrastructure/Extensions/SchedulerJobServiceCollectionExtensions.cs b/src/Services/Masa.Auth.Service.Admin/Infrastructure/Extensions/SchedulerJobServiceCollectionExtensions.cs index d5ac57506..c3190ac67 100644 --- a/src/Services/Masa.Auth.Service.Admin/Infrastructure/Extensions/SchedulerJobServiceCollectionExtensions.cs +++ b/src/Services/Masa.Auth.Service.Admin/Infrastructure/Extensions/SchedulerJobServiceCollectionExtensions.cs @@ -11,11 +11,18 @@ public static async Task AddSchedulerJobAsync(this IServiceCollection services) { using IServiceScope scope = services.BuildServiceProvider().CreateScope(); var serviceProvider = scope.ServiceProvider; - await serviceProvider.SafeExcuteAsync(AddSyncUserAutoCompleteJobAsync); - await serviceProvider.SafeExcuteAsync(AddSyncUserRedisJobAsync); - await serviceProvider.SafeExcuteAsync(AddSyncOidcRedisJobAsync); - await serviceProvider.SafeExcuteAsync(AddSyncPermissionRedisJobAsync); - await serviceProvider.SafeExcuteAsync(AddSyncLdapUserJobAsync); + try + { + await serviceProvider.SafeExcuteAsync(AddSyncUserAutoCompleteJobAsync); + await serviceProvider.SafeExcuteAsync(AddSyncUserRedisJobAsync); + await serviceProvider.SafeExcuteAsync(AddSyncOidcRedisJobAsync); + await serviceProvider.SafeExcuteAsync(AddSyncPermissionRedisJobAsync); + await serviceProvider.SafeExcuteAsync(AddSyncLdapUserJobAsync); + } + catch + { + // ignored + } } static async Task CreateAndRunAsync(this IServiceProvider serviceProvider, UpsertSchedulerJobRequest upsertSchedulerJobRequest) diff --git a/src/Services/Masa.Auth.Service.Admin/Program.cs b/src/Services/Masa.Auth.Service.Admin/Program.cs index c5bb493b7..8cd120ae7 100644 --- a/src/Services/Masa.Auth.Service.Admin/Program.cs +++ b/src/Services/Masa.Auth.Service.Admin/Program.cs @@ -10,14 +10,8 @@ var defaultStackConfig = builder.Configuration.GetDefaultStackConfig(); var webId = defaultStackConfig.GetWebId(project); var ssoDomain = defaultStackConfig.GetSsoDomain(); -var init = true; -#if DEBUG -init = false; -#endif -await builder.Services.AddMasaStackConfigAsync(project, MasaStackApp.Service, init, null, callerAction => -{ - callerAction.UseClientAuthentication(webId, ssoDomain); -}); + +await builder.Services.AddMasaStackConfigAsync(project, MasaStackApp.Service); var masaStackConfig = builder.Services.GetMasaStackConfig(); var publicConfiguration = builder.Services.GetMasaConfiguration().ConfigurationApi.GetPublic(); diff --git a/src/Services/Masa.Auth.Service.Admin/Properties/launchSettings.json b/src/Services/Masa.Auth.Service.Admin/Properties/launchSettings.json index 5088ded92..399305962 100644 --- a/src/Services/Masa.Auth.Service.Admin/Properties/launchSettings.json +++ b/src/Services/Masa.Auth.Service.Admin/Properties/launchSettings.json @@ -22,14 +22,14 @@ "MASA_NAMESPACE": "masastack", "MASA_CLUSTER": "Default", "OTLP_URL": "https://otel-collector.masastack:9013", - "REDIS": "{\"RedisHost\": \"10.130.0.19\", \"RedisPort\": 2135, \"RedisDb\": 3,\"RedisPassword\": \"Hzss@123\"}", + "REDIS": "{\"RedisHost\": \"10.130.0.19\", \"RedisPort\": 2135, \"RedisDb\": 2,\"RedisPassword\": \"Hzss@123\"}", "CONNECTIONSTRING": "{\"Server\": \"10.130.0.19\", \"Port\": 3815,\"Database\":\"pm-dev\",\"UserId\": \"ss\",\"Password\":\"Lsd@2023\",\"DbType\":\"PostgreSql\"}", "MASA_STACK": "[{\"id\":\"pm\",\"service\":{\"id\":\"pm-service-dev\",\"domain\":\"http://pm-service-dev.masastack.com\"},\"web\":{\"id\":\"pm-web-dev\",\"domain\":\"https://pm-dev.masastack.com\"}},{\"id\":\"dcc\",\"service\":{\"id\":\"dcc-service-dev\",\"domain\":\"http://dcc-service-dev.masastack.com\"},\"web\":{\"id\":\"dcc-web-dev\",\"domain\":\"https://dcc-dev.masastack.com\"}},{\"id\":\"tsc\",\"service\":{\"id\":\"tsc-service-dev\",\"domain\":\"http://tsc-service-dev.masastack.com\"},\"web\":{\"id\":\"tsc-web-dev\",\"domain\":\"https://tsc-dev.masastack.com\"}},{\"id\":\"alert\",\"service\":{\"id\":\"alert-service-dev\",\"domain\":\"http://alert-service-dev.masastack.com\"},\"web\":{\"id\":\"alert-web-dev\",\"domain\":\"https://alert-dev.masastack.com\"}},{\"id\":\"scheduler\",\"service\":{\"id\":\"scheduler-service-dev\",\"domain\":\"http://scheduler-service-dev.masastack.com\"},\"worker\":{\"id\":\"scheduler-worker-dev\",\"domain\":\"http://scheduler-worker-dev.masastack.com\"},\"web\":{\"id\":\"scheduler-web-dev\",\"domain\":\"https://scheduler-dev.masastack.com\"}},{\"id\":\"mc\",\"service\":{\"id\":\"mc-service-dev\",\"domain\":\"http://mc-service-dev.masastack.com\"},\"web\":{\"id\":\"mc-web-dev\",\"domain\":\"https://mc-dev.masastack.com\"}},{\"id\":\"auth\",\"service\":{\"id\":\"auth-service-dev\",\"domain\":\"http://auth-service-dev.masastack.com\"},\"web\":{\"id\":\"auth-web-dev\",\"domain\":\"https://auth-dev.masastack.com\"},\"sso\":{\"id\":\"auth-sso-dev\",\"domain\":\"https://auth-sso-dev.masastack.com\"}}]", "ELASTIC": "{\"Nodes\": [\"http://es-ydy-new.lonsid.cn:9200\"],\"Index\": \"auth_user_development\"}", - "MASA_ENVIRONMENT": "Development", + "MASA_ENVIRONMENT": "Test", "ADMIN_PWD": "admin123", "DCC_SECRET": "masastack.com", - "SUFFIX_IDENTITY": "dev" + "SUFFIX_IDENTITY": "test" }, "applicationUrl": "https://localhost:18102;http://localhost:18002", "dotnetRunMessages": true