From d105f752760d1c97b00cf740177945a088232ff2 Mon Sep 17 00:00:00 2001 From: "Alexey.Berezhnykh" Date: Mon, 22 Sep 2025 01:41:55 +0300 Subject: [PATCH 1/8] wip --- .../HwProj.APIGateway.API/Startup.cs | 16 +++- .../HwProj.APIGateway.API/appsettings.json | 5 +- .../HwProj.AuthService.API.csproj | 16 ++-- .../Repositories/ExpertsRepository.cs | 2 - .../Repositories/IExpertsRepository.cs | 2 - .../Services/AccountService.cs | 2 - .../Services/ExpertsService.cs | 5 +- .../HwProj.AuthService.API/Startup.cs | 47 ++-------- .../HwProj.AuthService.API/appsettings.json | 2 +- .../AuthServiceTests.cs | 2 +- .../HwProj.Common.Net8/ConnectionString.cs | 16 ++++ .../HwProj.Common.Net8.csproj | 13 +++ .../HwProj.Common.Net8/StartupExtensions.cs | 93 +++++++++++++++++++ .../HwProj.Utils/Auth/AuthorizationKey.cs | 11 --- .../Configuration/StartupExtensions.cs | 25 ----- .../Extensions/ConfigurationExtensions.cs | 27 ------ .../AuthService/AdminRegisterEvent.cs | 11 +++ .../AuthService/InviteLecturerEvent.cs | 10 ++ .../AuthService/PasswordRecoveryEvent.cs | 13 +++ .../AuthService/RegisterEvent.cs | 22 +++++ .../AuthService/StudentRegisterEvent.cs | 11 +++ .../HwProj.NotificationService.Events.csproj | 11 +++ .../InviteLecturerEventHandler.cs | 3 +- .../PasswordRecoveryEventHandler.cs | 2 +- .../EventHandlers/RegisterEventHandler.cs | 2 +- .../HwProj.NotificationsService.API.csproj | 2 +- .../Startup.cs | 4 +- HwProj.sln | 14 +++ 28 files changed, 257 insertions(+), 132 deletions(-) create mode 100644 HwProj.Common/HwProj.Common.Net8/ConnectionString.cs create mode 100644 HwProj.Common/HwProj.Common.Net8/HwProj.Common.Net8.csproj create mode 100644 HwProj.Common/HwProj.Common.Net8/StartupExtensions.cs delete mode 100644 HwProj.Common/HwProj.Utils/Auth/AuthorizationKey.cs create mode 100644 HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/AdminRegisterEvent.cs create mode 100644 HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/InviteLecturerEvent.cs create mode 100644 HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/PasswordRecoveryEvent.cs create mode 100644 HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/RegisterEvent.cs create mode 100644 HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/StudentRegisterEvent.cs create mode 100644 HwProj.NotificationsService/HwProj.NotificationService.Events/HwProj.NotificationService.Events.csproj diff --git a/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs b/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs index cf053dec6..747721f19 100644 --- a/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs +++ b/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs @@ -1,9 +1,9 @@ -using HwProj.AuthService.Client; +using System.Text; +using HwProj.AuthService.Client; using HwProj.ContentService.Client; using HwProj.CoursesService.Client; using HwProj.NotificationsService.Client; using HwProj.SolutionsService.Client; -using HwProj.Utils.Auth; using HwProj.Utils.Configuration; using HwProj.APIGateway.API.Filters; using Microsoft.AspNetCore.Builder; @@ -13,6 +13,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.IdentityModel.Tokens; using IStudentsInfo; +using Microsoft.AspNetCore.Authentication.JwtBearer; using StudentsInfo; namespace HwProj.APIGateway.API @@ -37,7 +38,13 @@ public void ConfigureServices(IServiceCollection services) Configuration["StudentsInfo:SearchBase"])); const string authenticationProviderKey = "GatewayKey"; - services.AddAuthentication() + var appSettings = Configuration.GetSection("AppSettings"); + + services.AddAuthentication(options => + { + options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + }) .AddJwtBearer(authenticationProviderKey, x => { x.RequireHttpsMetadata = false; @@ -47,7 +54,8 @@ public void ConfigureServices(IServiceCollection services) ValidateIssuer = true, ValidateAudience = false, ValidateLifetime = true, - IssuerSigningKey = AuthorizationKey.SecurityKey, + IssuerSigningKey = + new SymmetricSecurityKey(Encoding.UTF8.GetBytes(appSettings["SecurityKey"])), ValidateIssuerSigningKey = true }; }); diff --git a/HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json b/HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json index 92453a812..20c0d8322 100644 --- a/HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json +++ b/HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json @@ -5,7 +5,10 @@ "Notifications": "http://localhost:5006", "Solutions": "http://localhost:5007", "Content": "http://localhost:5008" - }, + }, + "AppSettings": { + "SecurityKey": "U8_.wpast4gergwef345890349tsav24g" + }, "StudentsInfo": { "Login": "", "Password": "", diff --git a/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj b/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj index d3584aa31..4a8db524b 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj +++ b/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj @@ -1,29 +1,27 @@  - netcoreapp2.2 + net8.0 Linux ..\..\docker-compose.dcproj ..\.. $(CSharpLanguageVersion) 603911e4-ace8-4439-96f8-1705a0dae761 - $(NullableReferenceTypes) + disable - + - - - - - + + + + - diff --git a/HwProj.AuthService/HwProj.AuthService.API/Repositories/ExpertsRepository.cs b/HwProj.AuthService/HwProj.AuthService.API/Repositories/ExpertsRepository.cs index 1470ae60e..5d9af6c59 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/Repositories/ExpertsRepository.cs +++ b/HwProj.AuthService/HwProj.AuthService.API/Repositories/ExpertsRepository.cs @@ -1,9 +1,7 @@ using System.Linq; using System.Threading.Tasks; using HwProj.AuthService.API.Models; -using HwProj.Models.AuthService.ViewModels; using HwProj.Repositories; -using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; namespace HwProj.AuthService.API.Repositories diff --git a/HwProj.AuthService/HwProj.AuthService.API/Repositories/IExpertsRepository.cs b/HwProj.AuthService/HwProj.AuthService.API/Repositories/IExpertsRepository.cs index b619f530a..0a23c6a52 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/Repositories/IExpertsRepository.cs +++ b/HwProj.AuthService/HwProj.AuthService.API/Repositories/IExpertsRepository.cs @@ -1,7 +1,5 @@ using System.Threading.Tasks; using HwProj.AuthService.API.Models; -using HwProj.Models.AuthService.DTO; -using HwProj.Models.AuthService.ViewModels; using HwProj.Repositories; namespace HwProj.AuthService.API.Repositories diff --git a/HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs b/HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs index b9ae20be5..17a815533 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs +++ b/HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs @@ -9,12 +9,10 @@ using HwProj.AuthService.API.Extensions; using HwProj.Models.Roles; using HwProj.AuthService.API.Events; -using HwProj.AuthService.API.Repositories; using HwProj.EventBus.Client.Interfaces; using HwProj.Models.AuthService.DTO; using HwProj.Models.AuthService.ViewModels; using HwProj.Models.Result; -using HwProj.Utils.Authorization; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Octokit; diff --git a/HwProj.AuthService/HwProj.AuthService.API/Services/ExpertsService.cs b/HwProj.AuthService/HwProj.AuthService.API/Services/ExpertsService.cs index 94c5dbee9..bc48b14b2 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/Services/ExpertsService.cs +++ b/HwProj.AuthService/HwProj.AuthService.API/Services/ExpertsService.cs @@ -9,7 +9,6 @@ using HwProj.Models.Result; using HwProj.Models.Roles; using Microsoft.AspNetCore.Identity; -using Microsoft.EntityFrameworkCore.Internal; using User = HwProj.AuthService.API.Models.User; namespace HwProj.AuthService.API.Services @@ -69,7 +68,7 @@ await _expertsRepository.AddAsync(new ExpertData Id = user.Id, LecturerId = lecturerId, IsProfileEdited = false, - Tags = model.Tags.Join(";") + Tags = string.Join(';', model.Tags) }); return Result.Success(); @@ -172,7 +171,7 @@ public async Task UpdateExpertTags(string lecturerId, UpdateExpertTagsDT await _expertsRepository.UpdateAsync(updateExpertTagsDto.ExpertId, data => new ExpertData() { - Tags = updateExpertTagsDto.Tags.Join(";") + Tags = string.Join(';', updateExpertTagsDto.Tags) }); return Result.Success(); diff --git a/HwProj.AuthService/HwProj.AuthService.API/Startup.cs b/HwProj.AuthService/HwProj.AuthService.API/Startup.cs index 79682521d..d7244266f 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/Startup.cs +++ b/HwProj.AuthService/HwProj.AuthService.API/Startup.cs @@ -1,5 +1,4 @@ using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using HwProj.AuthService.API.Models; @@ -7,14 +6,10 @@ using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; using HwProj.AuthService.API.Services; +using HwProj.Common.Net8; using HwProj.EventBus.Client; using HwProj.EventBus.Client.Interfaces; -using Microsoft.IdentityModel.Tokens; -using Microsoft.AspNetCore.Authentication.JwtBearer; -using HwProj.Utils.Configuration; -using HwProj.Models.AuthService.ViewModels; -using HwProj.Models.Roles; -using HwProj.Utils.Auth; +using Microsoft.Extensions.Hosting; using User = HwProj.AuthService.API.Models.User; namespace HwProj.AuthService.API @@ -31,25 +26,6 @@ public Startup(IConfiguration configuration) public void ConfigureServices(IServiceCollection services) { services.ConfigureHwProjServices("AuthService API"); - - //var appSettingsSection = Configuration.GetSection("AppSettings"); - //services.Configure(appSettingsSection); - - services.AddAuthentication(options => { options.DefaultScheme = JwtBearerDefaults.AuthenticationScheme; }) - .AddJwtBearer(x => - { - x.RequireHttpsMetadata = false; //TODO: dev env setting - x.TokenValidationParameters = new TokenValidationParameters - { - ValidIssuer = "AuthService", - ValidateIssuer = true, - ValidateAudience = false, - ValidateLifetime = true, - IssuerSigningKey = AuthorizationKey.SecurityKey, - ValidateIssuerSigningKey = true - }; - }); - services.AddHttpClient(); var connectionString = ConnectionString.GetConnectionString(Configuration); @@ -79,22 +55,19 @@ public void ConfigureServices(IServiceCollection services) .AddScoped(); } - public void Configure(IApplicationBuilder app, IHostingEnvironment env, IdentityContext context) + public void Configure(IApplicationBuilder app, IHostEnvironment env, IdentityContext context) { app.ConfigureHwProj(env, "AuthService API", context); - using (var scope = app.ApplicationServices.CreateScope()) - { - var userManager = scope.ServiceProvider.GetService(typeof(UserManager)) as UserManager; + using var scope = app.ApplicationServices.CreateScope(); + var userManager = scope.ServiceProvider.GetService>(); - var rolesManager = - scope.ServiceProvider.GetService(typeof(RoleManager)) as RoleManager; - var eventBus = scope.ServiceProvider.GetService(); + var rolesManager = scope.ServiceProvider.GetService>(); + var eventBus = scope.ServiceProvider.GetService(); - if (env.IsDevelopment()) - { - RoleInitializer.InitializeAsync(userManager, rolesManager, eventBus).Wait(); - } + if (env.IsDevelopment()) + { + RoleInitializer.InitializeAsync(userManager, rolesManager, eventBus).Wait(); } } } diff --git a/HwProj.AuthService/HwProj.AuthService.API/appsettings.json b/HwProj.AuthService/HwProj.AuthService.API/appsettings.json index 34f0e2986..3293eddb3 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/appsettings.json +++ b/HwProj.AuthService/HwProj.AuthService.API/appsettings.json @@ -10,7 +10,7 @@ }, "AllowedHosts": "*", "AppSettings": { - "SecurityKey": "U8_.wpvk93fPWG resultData) ValidateIssuer = true, ValidateAudience = false, ValidateLifetime = true, - IssuerSigningKey = AuthorizationKey.SecurityKey, + IssuerSigningKey = null, ValidateIssuerSigningKey = true }; var claims = handler.ValidateToken(resultData.Value.AccessToken, validations, out var tokenSecure); diff --git a/HwProj.Common/HwProj.Common.Net8/ConnectionString.cs b/HwProj.Common/HwProj.Common.Net8/ConnectionString.cs new file mode 100644 index 000000000..32bc4db97 --- /dev/null +++ b/HwProj.Common/HwProj.Common.Net8/ConnectionString.cs @@ -0,0 +1,16 @@ +using System.Runtime.InteropServices; +using Microsoft.Extensions.Configuration; +using IConfiguration = Microsoft.Extensions.Configuration.IConfiguration; + +namespace HwProj.Common.Net8; + +public static class ConnectionString +{ + public static string GetConnectionString(IConfiguration configuration) + { + var option = RuntimeInformation.IsOSPlatform(OSPlatform.Linux) + ? "DefaultConnectionForLinux" + : "DefaultConnectionForWindows"; + return configuration.GetConnectionString(option) ?? ""; + } +} \ No newline at end of file diff --git a/HwProj.Common/HwProj.Common.Net8/HwProj.Common.Net8.csproj b/HwProj.Common/HwProj.Common.Net8/HwProj.Common.Net8.csproj new file mode 100644 index 000000000..bae0d37c5 --- /dev/null +++ b/HwProj.Common/HwProj.Common.Net8/HwProj.Common.Net8.csproj @@ -0,0 +1,13 @@ + + + net8.0 + enable + enable + + + + + + + + diff --git a/HwProj.Common/HwProj.Common.Net8/StartupExtensions.cs b/HwProj.Common/HwProj.Common.Net8/StartupExtensions.cs new file mode 100644 index 000000000..380c6aaa9 --- /dev/null +++ b/HwProj.Common/HwProj.Common.Net8/StartupExtensions.cs @@ -0,0 +1,93 @@ +using System.Reflection; +using System.Text.Json.Serialization; +using Microsoft.AspNetCore.Builder; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Microsoft.OpenApi.Models; + +namespace HwProj.Common.Net8; + +public static class StartupExtensions +{ + public static IServiceCollection ConfigureHwProjServices(this IServiceCollection services, string serviceName) + { + services.AddAutoMapper(x => x.AddMaps(Assembly.GetCallingAssembly())) + .AddCors() + .AddControllers() + .AddJsonOptions(options => + options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles); + + services.ConfigureHwProjServiceSwaggerGen(serviceName); + services.AddHttpContextAccessor(); + + return services; + } + + private static void ConfigureHwProjServiceSwaggerGen(this IServiceCollection services, string serviceName) + { + services.AddSwaggerGen(c => + { + c.SwaggerDoc("v1", new OpenApiInfo { Title = serviceName, Version = "v1" }); + c.CustomOperationIds(apiDesc => + { + var controllerName = apiDesc.ActionDescriptor.RouteValues["controller"]; + var actionName = apiDesc.ActionDescriptor.RouteValues["action"]; + return $"{controllerName}{actionName}"; + }); + }); + } + + public static IApplicationBuilder ConfigureHwProj(this IApplicationBuilder app, IHostEnvironment env, + string serviceName, DbContext? context = null) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage() + .UseSwagger() + .UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", serviceName); }); + } + else + { + app.UseHsts(); + } + + app.UseRouting(); + app.UseAuthentication(); + app.UseCors(x => x + .AllowAnyMethod() + .AllowAnyHeader() + .SetIsOriginAllowed(_ => true) + .AllowCredentials()); + + app.UseEndpoints(x => x.MapControllers()); + + if (context != null) + { + if (env.IsDevelopment()) + { + context.Database.EnsureCreated(); + return app; + } + + var logger = app.ApplicationServices + .GetService()! + .CreateLogger(typeof(StartupExtensions)); + + var tries = 0; + const int maxTries = 100; + + while (!context.Database.CanConnect() && ++tries <= maxTries) + { + logger.LogWarning($"Can't connect to database. Try {tries}."); + Thread.Sleep(5000); + } + + if (tries > maxTries) throw new Exception("Can't connect to database"); + context.Database.Migrate(); + } + + return app; + } +} diff --git a/HwProj.Common/HwProj.Utils/Auth/AuthorizationKey.cs b/HwProj.Common/HwProj.Utils/Auth/AuthorizationKey.cs deleted file mode 100644 index ef3db41b5..000000000 --- a/HwProj.Common/HwProj.Utils/Auth/AuthorizationKey.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Text; -using Microsoft.IdentityModel.Tokens; - -namespace HwProj.Utils.Auth -{ - public static class AuthorizationKey - { - private const string _key = "U8_.wpvk93fPWG new SymmetricSecurityKey(Encoding.ASCII.GetBytes(_key)); - } -} diff --git a/HwProj.Common/HwProj.Utils/Configuration/StartupExtensions.cs b/HwProj.Common/HwProj.Utils/Configuration/StartupExtensions.cs index b53dd0549..920b10f97 100644 --- a/HwProj.Common/HwProj.Utils/Configuration/StartupExtensions.cs +++ b/HwProj.Common/HwProj.Utils/Configuration/StartupExtensions.cs @@ -4,14 +4,12 @@ using AutoMapper; using HwProj.Utils.Auth; using HwProj.Utils.Configuration.Middleware; -using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using Newtonsoft.Json; @@ -29,30 +27,7 @@ public static IServiceCollection ConfigureHwProjServices(this IServiceCollection .SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.ConfigureHwProjServiceSwaggerGen(serviceName); - if (serviceName != "AuthService API") - { - services.AddAuthentication(options => - { - options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; - options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; - }) - .AddJwtBearer(x => - { - x.RequireHttpsMetadata = false; //TODO: dev env setting - x.TokenValidationParameters = new TokenValidationParameters - { - ValidIssuer = "AuthService", - ValidateIssuer = true, - ValidateAudience = false, - ValidateLifetime = true, - IssuerSigningKey = AuthorizationKey.SecurityKey, - ValidateIssuerSigningKey = true - }; - }); - } - services.AddTransient(); - services.AddHttpContextAccessor(); return services; diff --git a/HwProj.ContentService/HwProj.ContentService.API/Extensions/ConfigurationExtensions.cs b/HwProj.ContentService/HwProj.ContentService.API/Extensions/ConfigurationExtensions.cs index eb6b3b043..f332e4e8d 100644 --- a/HwProj.ContentService/HwProj.ContentService.API/Extensions/ConfigurationExtensions.cs +++ b/HwProj.ContentService/HwProj.ContentService.API/Extensions/ConfigurationExtensions.cs @@ -9,12 +9,9 @@ using HwProj.ContentService.API.Repositories; using HwProj.ContentService.API.Services; using HwProj.ContentService.API.Services.Interfaces; -using HwProj.Utils.Auth; using HwProj.Utils.Configuration; -using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Http.Features; using Microsoft.EntityFrameworkCore; -using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using Newtonsoft.Json; @@ -120,8 +117,6 @@ private static void ConfigureHwProjContentService(this IServiceCollection servic options.SerializerSettings.ReferenceLoopHandling = ReferenceLoopHandling.Ignore; }); services.ConfigureContentServiceSwaggerGen(); - services.ConfigureContentServiceAuthentication(); - services.AddHttpContextAccessor(); } @@ -138,26 +133,4 @@ private static void ConfigureContentServiceSwaggerGen(this IServiceCollection se }); }); } - - private static void ConfigureContentServiceAuthentication(this IServiceCollection services) - { - services.AddAuthentication(options => - { - options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; - options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; - }) - .AddJwtBearer(x => - { - x.RequireHttpsMetadata = false; //TODO: dev env setting - x.TokenValidationParameters = new TokenValidationParameters - { - ValidIssuer = "AuthService", - ValidateIssuer = true, - ValidateAudience = false, - ValidateLifetime = true, - IssuerSigningKey = AuthorizationKey.SecurityKey, - ValidateIssuerSigningKey = true - }; - }); - } } \ No newline at end of file diff --git a/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/AdminRegisterEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/AdminRegisterEvent.cs new file mode 100644 index 000000000..c3e5762a8 --- /dev/null +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/AdminRegisterEvent.cs @@ -0,0 +1,11 @@ +namespace HwProj.NotificationService.Events.AuthService +{ + public class AdminRegisterEvent : RegisterEvent + { + public AdminRegisterEvent(string userId, string email, string name, string surname = "", string middleName = "") + : base(userId, email, name, surname, middleName) + { + + } + } +} diff --git a/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/InviteLecturerEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/InviteLecturerEvent.cs new file mode 100644 index 000000000..81b3ff76d --- /dev/null +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/InviteLecturerEvent.cs @@ -0,0 +1,10 @@ +using HwProj.EventBus.Client; + +namespace HwProj.NotificationService.Events.AuthService +{ + public class InviteLecturerEvent : Event + { + public string UserId { get; set; } + public string UserEmail { get; set; } + } +} diff --git a/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/PasswordRecoveryEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/PasswordRecoveryEvent.cs new file mode 100644 index 000000000..4e48570f7 --- /dev/null +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/PasswordRecoveryEvent.cs @@ -0,0 +1,13 @@ +using HwProj.EventBus.Client; + +namespace HwProj.NotificationService.Events.AuthService +{ + public class PasswordRecoveryEvent : Event + { + public string UserId { get; set; } + public string Name { get; set; } + public string Surname { get; set; } + public string Email { get; set; } + public string Token { get; set; } + } +} diff --git a/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/RegisterEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/RegisterEvent.cs new file mode 100644 index 000000000..3f6d4f864 --- /dev/null +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/RegisterEvent.cs @@ -0,0 +1,22 @@ +using HwProj.EventBus.Client; + +namespace HwProj.NotificationService.Events.AuthService +{ + public abstract class RegisterEvent : Event + { + public string UserId { get; set; } + public string Name { get; set; } + public string Surname { get; set; } + public string MiddleName { get; set; } + public string Email { get; set; } + + protected RegisterEvent(string userId, string email, string name, string surname = "", string middleName = "") + { + UserId = userId; + Name = name; + Surname = surname; + MiddleName = middleName; + Email = email; + } + } +} diff --git a/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/StudentRegisterEvent.cs b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/StudentRegisterEvent.cs new file mode 100644 index 000000000..bc5b8ccd8 --- /dev/null +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/AuthService/StudentRegisterEvent.cs @@ -0,0 +1,11 @@ +namespace HwProj.NotificationService.Events.AuthService +{ + public class StudentRegisterEvent : RegisterEvent + { + public StudentRegisterEvent(string userId, string email, string name, string surname = "", string middleName = "") + : base(userId, email, name, surname, middleName) + { + } + public string ChangePasswordToken { get; set; } + } +} diff --git a/HwProj.NotificationsService/HwProj.NotificationService.Events/HwProj.NotificationService.Events.csproj b/HwProj.NotificationsService/HwProj.NotificationService.Events/HwProj.NotificationService.Events.csproj new file mode 100644 index 000000000..e377245a3 --- /dev/null +++ b/HwProj.NotificationsService/HwProj.NotificationService.Events/HwProj.NotificationService.Events.csproj @@ -0,0 +1,11 @@ + + + + netstandard2.0 + + + + + + + diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/InviteLecturerEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/InviteLecturerEventHandler.cs index 1549cb68d..c65be2085 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/InviteLecturerEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/InviteLecturerEventHandler.cs @@ -1,9 +1,9 @@ using System; using System.Threading.Tasks; -using HwProj.AuthService.API.Events; using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.AuthService; using HwProj.NotificationsService.API.Models; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; @@ -19,7 +19,6 @@ public class InviteLecturerEventHandler : EventHandlerBase public InviteLecturerEventHandler( INotificationsRepository notificationRepository, IEmailService emailService, - IAuthServiceClient authServiceClient, INotificationSettingsService settingsService) { _notificationRepository = notificationRepository; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/PasswordRecoveryEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/PasswordRecoveryEventHandler.cs index 9f8711bce..d6eb234f2 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/PasswordRecoveryEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/PasswordRecoveryEventHandler.cs @@ -1,10 +1,10 @@ using System; using System.Threading.Tasks; using System.Web; -using HwProj.AuthService.API.Events; using HwProj.EventBus.Client.Interfaces; using HwProj.Models; using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.AuthService; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; using Microsoft.AspNetCore.Hosting; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RegisterEventHandler.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RegisterEventHandler.cs index a15018679..e3c58aeb5 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RegisterEventHandler.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/EventHandlers/RegisterEventHandler.cs @@ -1,9 +1,9 @@ using System; using System.Threading.Tasks; using System.Web; -using HwProj.AuthService.API.Events; using HwProj.EventBus.Client.Interfaces; using HwProj.Models.NotificationsService; +using HwProj.NotificationService.Events.AuthService; using HwProj.NotificationsService.API.Repositories; using HwProj.NotificationsService.API.Services; using Microsoft.AspNetCore.Hosting; diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj b/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj index 24abc2bd8..ccc08d04b 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/HwProj.NotificationsService.API.csproj @@ -23,12 +23,12 @@ - + diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Startup.cs b/HwProj.NotificationsService/HwProj.NotificationsService.API/Startup.cs index aece35219..d797a89f9 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Startup.cs +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Startup.cs @@ -1,5 +1,4 @@ -using HwProj.AuthService.API.Events; -using HwProj.AuthService.Client; +using HwProj.AuthService.Client; using HwProj.EventBus.Client.Interfaces; using HwProj.NotificationsService.API.EventHandlers; using HwProj.NotificationsService.API.Models; @@ -13,6 +12,7 @@ using Microsoft.Extensions.DependencyInjection; using HwProj.CoursesService.API.Events; using HwProj.EventBus.Client; +using HwProj.NotificationService.Events.AuthService; using HwProj.SolutionsService.API.Events; using UpdateTaskMaxRatingEvent = HwProj.CoursesService.API.Events.UpdateTaskMaxRatingEvent; diff --git a/HwProj.sln b/HwProj.sln index 61dabe1e8..77476a393 100644 --- a/HwProj.sln +++ b/HwProj.sln @@ -76,6 +76,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IStudentsInfo", "HwProj.Stu EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StudentInfo.Tests", "HwProj.StudentInfo\StudentsInfo.Tests\StudentsInfo.Tests.csproj", "{8DE955D7-FD97-4F11-B6D4-414E631B9F83}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HwProj.Common.Net8", "HwProj.Common\HwProj.Common.Net8\HwProj.Common.Net8.csproj", "{6D9F7095-5E38-4FC6-9913-C4015B233656}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HwProj.NotificationService.Events", "HwProj.NotificationsService\HwProj.NotificationService.Events\HwProj.NotificationService.Events.csproj", "{C04A9D3D-B299-4534-B7B1-36DF92B1BC87}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -182,6 +186,14 @@ Global {8DE955D7-FD97-4F11-B6D4-414E631B9F83}.Debug|Any CPU.Build.0 = Debug|Any CPU {8DE955D7-FD97-4F11-B6D4-414E631B9F83}.Release|Any CPU.ActiveCfg = Release|Any CPU {8DE955D7-FD97-4F11-B6D4-414E631B9F83}.Release|Any CPU.Build.0 = Release|Any CPU + {6D9F7095-5E38-4FC6-9913-C4015B233656}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D9F7095-5E38-4FC6-9913-C4015B233656}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D9F7095-5E38-4FC6-9913-C4015B233656}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D9F7095-5E38-4FC6-9913-C4015B233656}.Release|Any CPU.Build.0 = Release|Any CPU + {C04A9D3D-B299-4534-B7B1-36DF92B1BC87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C04A9D3D-B299-4534-B7B1-36DF92B1BC87}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C04A9D3D-B299-4534-B7B1-36DF92B1BC87}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C04A9D3D-B299-4534-B7B1-36DF92B1BC87}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -212,6 +224,8 @@ Global {886E6A4F-9F11-482D-AADF-CCB1049B6C14} = {CCA598FB-F8A9-4F20-BCE5-BE21725156BD} {72A4C047-1F47-45DA-9BD6-54E62E7CFB78} = {CCA598FB-F8A9-4F20-BCE5-BE21725156BD} {8DE955D7-FD97-4F11-B6D4-414E631B9F83} = {CCA598FB-F8A9-4F20-BCE5-BE21725156BD} + {6D9F7095-5E38-4FC6-9913-C4015B233656} = {77D857A8-45C6-4432-B4BF-A2F2C9ECA7FE} + {C04A9D3D-B299-4534-B7B1-36DF92B1BC87} = {1EAEB779-E7C8-4EF9-B9A9-22CB8E3C246D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C03BF138-4A5B-4261-9495-6D3AC6CE9779} From e744c2cc353abe64c1b99bd25a929f65ae9a2490 Mon Sep 17 00:00:00 2001 From: "Alexey.Berezhnykh" Date: Mon, 22 Sep 2025 01:43:27 +0300 Subject: [PATCH 2/8] wip --- HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs b/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs index 747721f19..c885fbc6c 100644 --- a/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs +++ b/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs @@ -55,7 +55,7 @@ public void ConfigureServices(IServiceCollection services) ValidateAudience = false, ValidateLifetime = true, IssuerSigningKey = - new SymmetricSecurityKey(Encoding.UTF8.GetBytes(appSettings["SecurityKey"])), + new SymmetricSecurityKey(Encoding.ASCII.GetBytes(appSettings["SecurityKey"])), ValidateIssuerSigningKey = true }; }); From db9020887281c27418a34858e4da6fedcacead5d Mon Sep 17 00:00:00 2001 From: "Alexey.Berezhnykh" Date: Mon, 22 Sep 2025 01:47:26 +0300 Subject: [PATCH 3/8] wip --- HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs b/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs index c885fbc6c..3e2a467da 100644 --- a/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs +++ b/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs @@ -36,7 +36,6 @@ public void ConfigureServices(IServiceCollection services) Configuration["StudentsInfo:Password"], Configuration["StudentsInfo:LdapHost"], int.Parse(Configuration["StudentsInfo:LdapPort"]), Configuration["StudentsInfo:SearchBase"])); - const string authenticationProviderKey = "GatewayKey"; var appSettings = Configuration.GetSection("AppSettings"); @@ -45,7 +44,7 @@ public void ConfigureServices(IServiceCollection services) options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; }) - .AddJwtBearer(authenticationProviderKey, x => + .AddJwtBearer(JwtBearerDefaults.AuthenticationScheme, x => { x.RequireHttpsMetadata = false; x.TokenValidationParameters = new TokenValidationParameters From fd4c6b5831aa32d2d95a627762e5fd086ab53e17 Mon Sep 17 00:00:00 2001 From: "Alexey.Berezhnykh" Date: Mon, 22 Sep 2025 01:50:21 +0300 Subject: [PATCH 4/8] wip --- .../Events/AdminRegisterEvent.cs | 11 ---------- .../Events/InviteLecturerEvent.cs | 10 --------- .../Events/PasswordRecoveryEvent.cs | 13 ----------- .../Events/RegisterEvent.cs | 22 ------------------- .../Events/StudentRegisterEvent.cs | 11 ---------- .../HwProj.AuthService.API.csproj | 1 + .../HwProj.AuthService.API/RoleInitializer.cs | 2 +- .../Services/AccountService.cs | 2 +- 8 files changed, 3 insertions(+), 69 deletions(-) delete mode 100644 HwProj.AuthService/HwProj.AuthService.API/Events/AdminRegisterEvent.cs delete mode 100644 HwProj.AuthService/HwProj.AuthService.API/Events/InviteLecturerEvent.cs delete mode 100644 HwProj.AuthService/HwProj.AuthService.API/Events/PasswordRecoveryEvent.cs delete mode 100644 HwProj.AuthService/HwProj.AuthService.API/Events/RegisterEvent.cs delete mode 100644 HwProj.AuthService/HwProj.AuthService.API/Events/StudentRegisterEvent.cs diff --git a/HwProj.AuthService/HwProj.AuthService.API/Events/AdminRegisterEvent.cs b/HwProj.AuthService/HwProj.AuthService.API/Events/AdminRegisterEvent.cs deleted file mode 100644 index 09fc75942..000000000 --- a/HwProj.AuthService/HwProj.AuthService.API/Events/AdminRegisterEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace HwProj.AuthService.API.Events -{ - public class AdminRegisterEvent : RegisterEvent - { - public AdminRegisterEvent(string userId, string email, string name, string surname = "", string middleName = "") - : base(userId, email, name, surname, middleName) - { - - } - } -} diff --git a/HwProj.AuthService/HwProj.AuthService.API/Events/InviteLecturerEvent.cs b/HwProj.AuthService/HwProj.AuthService.API/Events/InviteLecturerEvent.cs deleted file mode 100644 index 345d6cc40..000000000 --- a/HwProj.AuthService/HwProj.AuthService.API/Events/InviteLecturerEvent.cs +++ /dev/null @@ -1,10 +0,0 @@ -using HwProj.EventBus.Client; - -namespace HwProj.AuthService.API.Events -{ - public class InviteLecturerEvent : Event - { - public string UserId { get; set; } - public string UserEmail { get; set; } - } -} diff --git a/HwProj.AuthService/HwProj.AuthService.API/Events/PasswordRecoveryEvent.cs b/HwProj.AuthService/HwProj.AuthService.API/Events/PasswordRecoveryEvent.cs deleted file mode 100644 index c751d6521..000000000 --- a/HwProj.AuthService/HwProj.AuthService.API/Events/PasswordRecoveryEvent.cs +++ /dev/null @@ -1,13 +0,0 @@ -using HwProj.EventBus.Client; - -namespace HwProj.AuthService.API.Events -{ - public class PasswordRecoveryEvent : Event - { - public string UserId { get; set; } - public string Name { get; set; } - public string Surname { get; set; } - public string Email { get; set; } - public string Token { get; set; } - } -} diff --git a/HwProj.AuthService/HwProj.AuthService.API/Events/RegisterEvent.cs b/HwProj.AuthService/HwProj.AuthService.API/Events/RegisterEvent.cs deleted file mode 100644 index c2625e5ba..000000000 --- a/HwProj.AuthService/HwProj.AuthService.API/Events/RegisterEvent.cs +++ /dev/null @@ -1,22 +0,0 @@ -using HwProj.EventBus.Client; - -namespace HwProj.AuthService.API.Events -{ - public abstract class RegisterEvent : Event - { - public string UserId { get; set; } - public string Name { get; set; } - public string Surname { get; set; } - public string MiddleName { get; set; } - public string Email { get; set; } - - protected RegisterEvent(string userId, string email, string name, string surname = "", string middleName = "") - { - UserId = userId; - Name = name; - Surname = surname; - MiddleName = middleName; - Email = email; - } - } -} diff --git a/HwProj.AuthService/HwProj.AuthService.API/Events/StudentRegisterEvent.cs b/HwProj.AuthService/HwProj.AuthService.API/Events/StudentRegisterEvent.cs deleted file mode 100644 index 69e540d23..000000000 --- a/HwProj.AuthService/HwProj.AuthService.API/Events/StudentRegisterEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace HwProj.AuthService.API.Events -{ - public class StudentRegisterEvent : RegisterEvent - { - public StudentRegisterEvent(string userId, string email, string name, string surname = "", string middleName = "") - : base(userId, email, name, surname, middleName) - { - } - public string ChangePasswordToken { get; set; } - } -} diff --git a/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj b/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj index 4a8db524b..68975147f 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj +++ b/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj @@ -23,6 +23,7 @@ + diff --git a/HwProj.AuthService/HwProj.AuthService.API/RoleInitializer.cs b/HwProj.AuthService/HwProj.AuthService.API/RoleInitializer.cs index d2ada883b..f8cb0f20d 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/RoleInitializer.cs +++ b/HwProj.AuthService/HwProj.AuthService.API/RoleInitializer.cs @@ -1,8 +1,8 @@ using Microsoft.AspNetCore.Identity; using System.Threading.Tasks; -using HwProj.AuthService.API.Events; using HwProj.EventBus.Client.Interfaces; using HwProj.Models.Roles; +using HwProj.NotificationService.Events.AuthService; using User = HwProj.AuthService.API.Models.User; namespace HwProj.AuthService.API diff --git a/HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs b/HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs index 17a815533..956f3589e 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs +++ b/HwProj.AuthService/HwProj.AuthService.API/Services/AccountService.cs @@ -8,11 +8,11 @@ using AutoMapper; using HwProj.AuthService.API.Extensions; using HwProj.Models.Roles; -using HwProj.AuthService.API.Events; using HwProj.EventBus.Client.Interfaces; using HwProj.Models.AuthService.DTO; using HwProj.Models.AuthService.ViewModels; using HwProj.Models.Result; +using HwProj.NotificationService.Events.AuthService; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Octokit; From f7f4727a3b3df6e5c99a9f0c798bd48ee5a50513 Mon Sep 17 00:00:00 2001 From: "Alexey.Berezhnykh" Date: Mon, 22 Sep 2025 01:54:00 +0300 Subject: [PATCH 5/8] update docker --- HwProj.AuthService/HwProj.AuthService.API/Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/HwProj.AuthService/HwProj.AuthService.API/Dockerfile b/HwProj.AuthService/HwProj.AuthService.API/Dockerfile index 22da9c224..82538b03b 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/Dockerfile +++ b/HwProj.AuthService/HwProj.AuthService.API/Dockerfile @@ -1,18 +1,18 @@ -FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /src COPY ["Directory.Build.props", "Directory.Build.props"] COPY ["HwProj.AuthService/HwProj.AuthService.API/", "HwProj.AuthService/HwProj.AuthService.API/"] -COPY ["HwProj.Common/HwProj.Utils/", "HwProj.Common/HwProj.Utils/"] -COPY ["HwProj.EventBus/HwProj.EventBus.Client/", "HwProj.EventBus/HwProj.EventBus.Client/"] +COPY ["HwProj.Common/HwProj.Common.Net8/", "HwProj.Common/HwProj.Common.Net8/"] COPY ["HwProj.Common/HwProj.Models/", "HwProj.Common/HwProj.Models/"] -COPY ["HwProj.Common/HwProj.Repositories/", "HwProj.Common/HwProj.Repositories/"] +COPY ["HwProj.EventBus/HwProj.EventBus.Client/", "HwProj.EventBus/HwProj.EventBus.Client/"] +COPY ["HwProj.NotificationsService/HwProj.NotificationService.Events/", "HwProj.NotificationsService/HwProj.NotificationService.Events/"] WORKDIR "/src/HwProj.AuthService/HwProj.AuthService.API" RUN dotnet publish "HwProj.AuthService.API.csproj" -c Release -o /app/publish -FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS final +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final WORKDIR /app COPY --from=build /app/publish . From 8dc5fb266ce456d42a53cb78d2c4b0c1973d6d58 Mon Sep 17 00:00:00 2001 From: "Alexey.Berezhnykh" Date: Mon, 22 Sep 2025 01:58:10 +0300 Subject: [PATCH 6/8] wip --- .../HwProj.NotificationsService.API/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HwProj.NotificationsService/HwProj.NotificationsService.API/Dockerfile b/HwProj.NotificationsService/HwProj.NotificationsService.API/Dockerfile index 2733d4b86..b8445a7eb 100644 --- a/HwProj.NotificationsService/HwProj.NotificationsService.API/Dockerfile +++ b/HwProj.NotificationsService/HwProj.NotificationsService.API/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /src COPY ["Directory.Build.props", "Directory.Build.props"] COPY ["HwProj.NotificationsService/HwProj.NotificationsService.API/", "HwProj.NotificationsService/HwProj.NotificationsService.API/"] -COPY ["HwProj.AuthService/HwProj.AuthService.API/", "HwProj.AuthService/HwProj.AuthService.API/"] +COPY ["HwProj.NotificationsService/HwProj.NotificationService.Events/", "HwProj.NotificationsService/HwProj.NotificationService.Events/"] COPY ["HwProj.Common/HwProj.Utils/", "HwProj.Common/HwProj.Utils/"] COPY ["HwProj.EventBus/HwProj.EventBus.Client/", "HwProj.EventBus/HwProj.EventBus.Client/"] COPY ["HwProj.Common/HwProj.Models/", "HwProj.Common/HwProj.Models/"] From af3304a614471df2ef864129bc497faeeb47cc2e Mon Sep 17 00:00:00 2001 From: "Alexey.Berezhnykh" Date: Mon, 22 Sep 2025 02:02:49 +0300 Subject: [PATCH 7/8] cleanup --- .../HwProj.AuthService.API/HwProj.AuthService.API.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj b/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj index 68975147f..efa5b3ad8 100644 --- a/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj +++ b/HwProj.AuthService/HwProj.AuthService.API/HwProj.AuthService.API.csproj @@ -11,7 +11,6 @@ - From dd734e79f0631b7b82cbed33e90aaf46c7297290 Mon Sep 17 00:00:00 2001 From: "Alexey.Berezhnykh" Date: Sat, 27 Sep 2025 02:13:23 +0300 Subject: [PATCH 8/8] wip --- HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs | 2 +- HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json | 4 ++-- HwProj.AuthService/HwProj.AuthService.API/appsettings.json | 4 ++-- .../HwProj.ContentService.API/appsettings.json | 2 +- docker-compose.override.yml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs b/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs index 3e2a467da..c0ed38a0f 100644 --- a/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs +++ b/HwProj.APIGateway/HwProj.APIGateway.API/Startup.cs @@ -37,7 +37,7 @@ public void ConfigureServices(IServiceCollection services) Configuration["StudentsInfo:LdapHost"], int.Parse(Configuration["StudentsInfo:LdapPort"]), Configuration["StudentsInfo:SearchBase"])); - var appSettings = Configuration.GetSection("AppSettings"); + var appSettings = Configuration.GetSection("Security"); services.AddAuthentication(options => { diff --git a/HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json b/HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json index 20c0d8322..b3e146a09 100644 --- a/HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json +++ b/HwProj.APIGateway/HwProj.APIGateway.API/appsettings.json @@ -6,8 +6,8 @@ "Solutions": "http://localhost:5007", "Content": "http://localhost:5008" }, - "AppSettings": { - "SecurityKey": "U8_.wpast4gergwef345890349tsav24g" + "Security": { + "SecurityKey": "U8_.wpvk93fPWG