From 46f9535b4a9096fdc287f46b052a900c2ce8dca3 Mon Sep 17 00:00:00 2001 From: Patrick Bateman Date: Thu, 15 Aug 2024 13:21:17 +0000 Subject: [PATCH] Rename API to AuthorizationService --- services/AuthorizationService/AppDBContext.cs | 4 ++-- .../Application/Users/Commands/CreateUser.cs | 6 +++--- .../Application/Users/Commands/DeleteUser.cs | 6 +++--- .../Application/Users/Commands/LoginUser.cs | 6 +++--- .../Application/Users/Commands/UpdateUser.cs | 6 +++--- .../Application/Users/Commands/UpdateUserPassword.cs | 6 +++--- .../Application/Users/Queries/QueryAllUsers.cs | 6 +++--- .../Application/Users/Queries/QueryUserById.cs | 6 +++--- .../{API.csproj => AuthorizationService.csproj} | 0 ...PI.csproj.user => AuthorizationService.csproj.user} | 2 +- .../{API.http => AuthorizationService.http} | 0 .../{API.sln => AuthorizationService.sln} | 2 +- .../Controllers/HealthCheckController.cs | 2 +- .../Controllers/UsersController.cs | 8 ++++---- services/AuthorizationService/Dockerfile | 10 +++++----- .../Migrations/20240812084720_CreateUser.Designer.cs | 6 +++--- .../Migrations/20240812084720_CreateUser.cs | 2 +- .../20240813075158_ChangedUserWithGuid.Designer.cs | 6 +++--- .../Migrations/20240813075158_ChangedUserWithGuid.cs | 2 +- .../Migrations/20240813112418_NoMoreGuid.Designer.cs | 6 +++--- .../Migrations/20240813112418_NoMoreGuid.cs | 2 +- .../Migrations/AppDBContextModelSnapshot.cs | 6 +++--- services/AuthorizationService/Models/BaseModel.cs | 2 +- services/AuthorizationService/Models/User.cs | 2 +- .../Persistence/Repositories/IUserRepository.cs | 4 ++-- .../Persistence/Repositories/UserRepository.cs | 4 ++-- services/AuthorizationService/Program.cs | 8 ++++---- .../skantravels-authorization.service | 2 +- 28 files changed, 61 insertions(+), 61 deletions(-) rename services/AuthorizationService/{API.csproj => AuthorizationService.csproj} (100%) rename services/AuthorizationService/{API.csproj.user => AuthorizationService.csproj.user} (89%) rename services/AuthorizationService/{API.http => AuthorizationService.http} (100%) rename services/AuthorizationService/{API.sln => AuthorizationService.sln} (86%) diff --git a/services/AuthorizationService/AppDBContext.cs b/services/AuthorizationService/AppDBContext.cs index bdeb5cf..9bd16cd 100644 --- a/services/AuthorizationService/AppDBContext.cs +++ b/services/AuthorizationService/AppDBContext.cs @@ -1,7 +1,7 @@ -using API.Models; +using AuthorizationService.Models; using Microsoft.EntityFrameworkCore; -namespace API; +namespace AuthorizationService; public class AppDBContext(DbContextOptions options) : DbContext(options) { diff --git a/services/AuthorizationService/Application/Users/Commands/CreateUser.cs b/services/AuthorizationService/Application/Users/Commands/CreateUser.cs index 9954904..734e68c 100644 --- a/services/AuthorizationService/Application/Users/Commands/CreateUser.cs +++ b/services/AuthorizationService/Application/Users/Commands/CreateUser.cs @@ -1,9 +1,9 @@ -using API.Models; -using API.Persistence.Repositories; +using AuthorizationService.Models; +using AuthorizationService.Persistence.Repositories; using Microsoft.AspNetCore.Mvc; using System.Text.RegularExpressions; -namespace API.Application.Users.Commands +namespace AuthorizationService.Application.Users.Commands { public class CreateUser { diff --git a/services/AuthorizationService/Application/Users/Commands/DeleteUser.cs b/services/AuthorizationService/Application/Users/Commands/DeleteUser.cs index 0a73ee7..2e66806 100644 --- a/services/AuthorizationService/Application/Users/Commands/DeleteUser.cs +++ b/services/AuthorizationService/Application/Users/Commands/DeleteUser.cs @@ -1,8 +1,8 @@ -using API.Models; -using API.Persistence.Repositories; +using AuthorizationService.Models; +using AuthorizationService.Persistence.Repositories; using Microsoft.AspNetCore.Mvc; -namespace API.Application.Users.Commands +namespace AuthorizationService.Application.Users.Commands { public class DeleteUser { diff --git a/services/AuthorizationService/Application/Users/Commands/LoginUser.cs b/services/AuthorizationService/Application/Users/Commands/LoginUser.cs index 2659503..2573d4e 100644 --- a/services/AuthorizationService/Application/Users/Commands/LoginUser.cs +++ b/services/AuthorizationService/Application/Users/Commands/LoginUser.cs @@ -1,5 +1,5 @@ -using API.Models; -using API.Persistence.Repositories; +using AuthorizationService.Models; +using AuthorizationService.Persistence.Repositories; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using Microsoft.IdentityModel.Tokens; @@ -9,7 +9,7 @@ using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; using System.Text; -namespace API.Application.Users.Commands +namespace AuthorizationService.Application.Users.Commands { public class LoginUser { diff --git a/services/AuthorizationService/Application/Users/Commands/UpdateUser.cs b/services/AuthorizationService/Application/Users/Commands/UpdateUser.cs index 1b5165f..fcb37f2 100644 --- a/services/AuthorizationService/Application/Users/Commands/UpdateUser.cs +++ b/services/AuthorizationService/Application/Users/Commands/UpdateUser.cs @@ -1,8 +1,8 @@ -using API.Models; -using API.Persistence.Repositories; +using AuthorizationService.Models; +using AuthorizationService.Persistence.Repositories; using Microsoft.AspNetCore.Mvc; -namespace API.Application.Users.Commands +namespace AuthorizationService.Application.Users.Commands { public class UpdateUser { diff --git a/services/AuthorizationService/Application/Users/Commands/UpdateUserPassword.cs b/services/AuthorizationService/Application/Users/Commands/UpdateUserPassword.cs index 4a2efb1..2722e11 100644 --- a/services/AuthorizationService/Application/Users/Commands/UpdateUserPassword.cs +++ b/services/AuthorizationService/Application/Users/Commands/UpdateUserPassword.cs @@ -1,9 +1,9 @@ -using API.Models; -using API.Persistence.Repositories; +using AuthorizationService.Models; +using AuthorizationService.Persistence.Repositories; using Microsoft.AspNetCore.Mvc; using System.Text.RegularExpressions; -namespace API.Application.Users.Commands +namespace AuthorizationService.Application.Users.Commands { public class UpdateUserPassword { diff --git a/services/AuthorizationService/Application/Users/Queries/QueryAllUsers.cs b/services/AuthorizationService/Application/Users/Queries/QueryAllUsers.cs index 4d74f42..43c26e6 100644 --- a/services/AuthorizationService/Application/Users/Queries/QueryAllUsers.cs +++ b/services/AuthorizationService/Application/Users/Queries/QueryAllUsers.cs @@ -1,8 +1,8 @@ -using API.Models; -using API.Persistence.Repositories; +using AuthorizationService.Models; +using AuthorizationService.Persistence.Repositories; using Microsoft.AspNetCore.Mvc; -namespace API.Application.Users.Queries +namespace AuthorizationService.Application.Users.Queries { public class QueryAllUsers { diff --git a/services/AuthorizationService/Application/Users/Queries/QueryUserById.cs b/services/AuthorizationService/Application/Users/Queries/QueryUserById.cs index def7b62..3af9720 100644 --- a/services/AuthorizationService/Application/Users/Queries/QueryUserById.cs +++ b/services/AuthorizationService/Application/Users/Queries/QueryUserById.cs @@ -1,9 +1,9 @@ -using API.Models; -using API.Persistence.Repositories; +using AuthorizationService.Models; +using AuthorizationService.Persistence.Repositories; using Microsoft.AspNetCore.Mvc; using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages.Manage; -namespace API.Application.Users.Queries +namespace AuthorizationService.Application.Users.Queries { public class QueryUserById { diff --git a/services/AuthorizationService/API.csproj b/services/AuthorizationService/AuthorizationService.csproj similarity index 100% rename from services/AuthorizationService/API.csproj rename to services/AuthorizationService/AuthorizationService.csproj diff --git a/services/AuthorizationService/API.csproj.user b/services/AuthorizationService/AuthorizationService.csproj.user similarity index 89% rename from services/AuthorizationService/API.csproj.user rename to services/AuthorizationService/AuthorizationService.csproj.user index 880bcb5..acdde23 100644 --- a/services/AuthorizationService/API.csproj.user +++ b/services/AuthorizationService/AuthorizationService.csproj.user @@ -9,7 +9,7 @@ False True - API.AppDBContext + AuthorizationService.AppDBContext False diff --git a/services/AuthorizationService/API.http b/services/AuthorizationService/AuthorizationService.http similarity index 100% rename from services/AuthorizationService/API.http rename to services/AuthorizationService/AuthorizationService.http diff --git a/services/AuthorizationService/API.sln b/services/AuthorizationService/AuthorizationService.sln similarity index 86% rename from services/AuthorizationService/API.sln rename to services/AuthorizationService/AuthorizationService.sln index 2b04475..3da2bde 100644 --- a/services/AuthorizationService/API.sln +++ b/services/AuthorizationService/AuthorizationService.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34511.84 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "API", "API.csproj", "{5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AuthorizationService", "AuthorizationService.csproj", "{5DF9B7D8-FA4E-4209-A677-C4CF4886D4B3}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/services/AuthorizationService/Controllers/HealthCheckController.cs b/services/AuthorizationService/Controllers/HealthCheckController.cs index c2943d9..e52277f 100644 --- a/services/AuthorizationService/Controllers/HealthCheckController.cs +++ b/services/AuthorizationService/Controllers/HealthCheckController.cs @@ -1,6 +1,6 @@ using Microsoft.AspNetCore.Mvc; -namespace API.Controllers +namespace AuthorizationService.Controllers { [ApiController] [Route("[controller]")] diff --git a/services/AuthorizationService/Controllers/UsersController.cs b/services/AuthorizationService/Controllers/UsersController.cs index 1a0f564..787d211 100644 --- a/services/AuthorizationService/Controllers/UsersController.cs +++ b/services/AuthorizationService/Controllers/UsersController.cs @@ -1,6 +1,6 @@ -using API.Application.Users.Commands; -using API.Application.Users.Queries; -using API.Models; +using AuthorizationService.Application.Users.Commands; +using AuthorizationService.Application.Users.Queries; +using AuthorizationService.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; @@ -10,7 +10,7 @@ using System.Security.Claims; using System.Text; using System.Text.RegularExpressions; -namespace API.Controllers +namespace AuthorizationService.Controllers { [Route("api/[controller]")] [ApiController] diff --git a/services/AuthorizationService/Dockerfile b/services/AuthorizationService/Dockerfile index a23f64c..51652e3 100644 --- a/services/AuthorizationService/Dockerfile +++ b/services/AuthorizationService/Dockerfile @@ -9,17 +9,17 @@ EXPOSE 8081 FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build ARG BUILD_CONFIGURATION=Release WORKDIR /src -COPY ["API.csproj", "."] -RUN dotnet restore "./././API.csproj" +COPY ["AuthorizationService.csproj", "."] +RUN dotnet restore "./././AuthorizationService.csproj" COPY . . WORKDIR "/src/." -RUN dotnet build "./API.csproj" -c $BUILD_CONFIGURATION -o /app/build +RUN dotnet build "./AuthorizationService.csproj" -c $BUILD_CONFIGURATION -o /app/build FROM build AS publish ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./API.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false +RUN dotnet publish "./AuthorizationService.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -ENTRYPOINT ["dotnet", "API.dll"] \ No newline at end of file +ENTRYPOINT ["dotnet", "AuthorizationService.dll"] \ No newline at end of file diff --git a/services/AuthorizationService/Migrations/20240812084720_CreateUser.Designer.cs b/services/AuthorizationService/Migrations/20240812084720_CreateUser.Designer.cs index 44f332b..8479597 100644 --- a/services/AuthorizationService/Migrations/20240812084720_CreateUser.Designer.cs +++ b/services/AuthorizationService/Migrations/20240812084720_CreateUser.Designer.cs @@ -1,5 +1,5 @@ // -using API; +using AuthorizationService; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; @@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable -namespace API.Migrations +namespace AuthorizationService.Migrations { [DbContext(typeof(AppDBContext))] [Migration("20240812084720_CreateUser")] @@ -19,7 +19,7 @@ namespace API.Migrations #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "9.0.0-preview.6.24327.4"); - modelBuilder.Entity("API.Models.User", b => + modelBuilder.Entity("AuthorizationService.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/services/AuthorizationService/Migrations/20240812084720_CreateUser.cs b/services/AuthorizationService/Migrations/20240812084720_CreateUser.cs index 7277c11..ca3cf05 100644 --- a/services/AuthorizationService/Migrations/20240812084720_CreateUser.cs +++ b/services/AuthorizationService/Migrations/20240812084720_CreateUser.cs @@ -2,7 +2,7 @@ #nullable disable -namespace API.Migrations +namespace AuthorizationService.Migrations { /// public partial class CreateUser : Migration diff --git a/services/AuthorizationService/Migrations/20240813075158_ChangedUserWithGuid.Designer.cs b/services/AuthorizationService/Migrations/20240813075158_ChangedUserWithGuid.Designer.cs index bbe7c84..1082edb 100644 --- a/services/AuthorizationService/Migrations/20240813075158_ChangedUserWithGuid.Designer.cs +++ b/services/AuthorizationService/Migrations/20240813075158_ChangedUserWithGuid.Designer.cs @@ -1,6 +1,6 @@ // using System; -using API; +using AuthorizationService; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; @@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable -namespace API.Migrations +namespace AuthorizationService.Migrations { [DbContext(typeof(AppDBContext))] [Migration("20240813075158_ChangedUserWithGuid")] @@ -20,7 +20,7 @@ namespace API.Migrations #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - modelBuilder.Entity("API.Models.User", b => + modelBuilder.Entity("AuthorizationService.Models.User", b => { b.Property("Id") .ValueGeneratedOnAdd() diff --git a/services/AuthorizationService/Migrations/20240813075158_ChangedUserWithGuid.cs b/services/AuthorizationService/Migrations/20240813075158_ChangedUserWithGuid.cs index bbf29be..f9de7b2 100644 --- a/services/AuthorizationService/Migrations/20240813075158_ChangedUserWithGuid.cs +++ b/services/AuthorizationService/Migrations/20240813075158_ChangedUserWithGuid.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore.Migrations; #nullable disable -namespace API.Migrations +namespace AuthorizationService.Migrations { /// public partial class ChangedUserWithGuid : Migration diff --git a/services/AuthorizationService/Migrations/20240813112418_NoMoreGuid.Designer.cs b/services/AuthorizationService/Migrations/20240813112418_NoMoreGuid.Designer.cs index 549aeb5..48cb648 100644 --- a/services/AuthorizationService/Migrations/20240813112418_NoMoreGuid.Designer.cs +++ b/services/AuthorizationService/Migrations/20240813112418_NoMoreGuid.Designer.cs @@ -1,6 +1,6 @@ // using System; -using API; +using AuthorizationService; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; @@ -8,7 +8,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable -namespace API.Migrations +namespace AuthorizationService.Migrations { [DbContext(typeof(AppDBContext))] [Migration("20240813112418_NoMoreGuid")] @@ -20,7 +20,7 @@ namespace API.Migrations #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - modelBuilder.Entity("API.Models.User", b => + modelBuilder.Entity("AuthorizationService.Models.User", b => { b.Property("Id") .HasColumnType("TEXT"); diff --git a/services/AuthorizationService/Migrations/20240813112418_NoMoreGuid.cs b/services/AuthorizationService/Migrations/20240813112418_NoMoreGuid.cs index 813cdf5..1291109 100644 --- a/services/AuthorizationService/Migrations/20240813112418_NoMoreGuid.cs +++ b/services/AuthorizationService/Migrations/20240813112418_NoMoreGuid.cs @@ -2,7 +2,7 @@ #nullable disable -namespace API.Migrations +namespace AuthorizationService.Migrations { /// public partial class NoMoreGuid : Migration diff --git a/services/AuthorizationService/Migrations/AppDBContextModelSnapshot.cs b/services/AuthorizationService/Migrations/AppDBContextModelSnapshot.cs index 19b280c..c321b6d 100644 --- a/services/AuthorizationService/Migrations/AppDBContextModelSnapshot.cs +++ b/services/AuthorizationService/Migrations/AppDBContextModelSnapshot.cs @@ -1,13 +1,13 @@ // using System; -using API; +using AuthorizationService; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable -namespace API.Migrations +namespace AuthorizationService.Migrations { [DbContext(typeof(AppDBContext))] partial class AppDBContextModelSnapshot : ModelSnapshot @@ -17,7 +17,7 @@ namespace API.Migrations #pragma warning disable 612, 618 modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - modelBuilder.Entity("API.Models.User", b => + modelBuilder.Entity("AuthorizationService.Models.User", b => { b.Property("Id") .HasColumnType("TEXT"); diff --git a/services/AuthorizationService/Models/BaseModel.cs b/services/AuthorizationService/Models/BaseModel.cs index e08448f..ba96092 100644 --- a/services/AuthorizationService/Models/BaseModel.cs +++ b/services/AuthorizationService/Models/BaseModel.cs @@ -1,4 +1,4 @@ -namespace API.Models +namespace AuthorizationService.Models { public class BaseModel { diff --git a/services/AuthorizationService/Models/User.cs b/services/AuthorizationService/Models/User.cs index 4cac344..2dfe2e0 100644 --- a/services/AuthorizationService/Models/User.cs +++ b/services/AuthorizationService/Models/User.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace API.Models; +namespace AuthorizationService.Models; public class User : BaseModel { diff --git a/services/AuthorizationService/Persistence/Repositories/IUserRepository.cs b/services/AuthorizationService/Persistence/Repositories/IUserRepository.cs index 51548ee..789b900 100644 --- a/services/AuthorizationService/Persistence/Repositories/IUserRepository.cs +++ b/services/AuthorizationService/Persistence/Repositories/IUserRepository.cs @@ -1,6 +1,6 @@ -using API.Models; +using AuthorizationService.Models; -namespace API.Persistence.Repositories +namespace AuthorizationService.Persistence.Repositories { public interface IUserRepository { diff --git a/services/AuthorizationService/Persistence/Repositories/UserRepository.cs b/services/AuthorizationService/Persistence/Repositories/UserRepository.cs index 26f0e33..e504c7b 100644 --- a/services/AuthorizationService/Persistence/Repositories/UserRepository.cs +++ b/services/AuthorizationService/Persistence/Repositories/UserRepository.cs @@ -1,8 +1,8 @@ -using API.Models; +using AuthorizationService.Models; using Microsoft.EntityFrameworkCore; using Microsoft.VisualStudio.Web.CodeGenerators.Mvc.Templates.BlazorIdentity.Pages; -namespace API.Persistence.Repositories +namespace AuthorizationService.Persistence.Repositories { public class UserRepository(AppDBContext context) : IUserRepository { diff --git a/services/AuthorizationService/Program.cs b/services/AuthorizationService/Program.cs index 22885e1..82f3e51 100644 --- a/services/AuthorizationService/Program.cs +++ b/services/AuthorizationService/Program.cs @@ -1,13 +1,13 @@ -using API.Application.Users.Commands; -using API.Application.Users.Queries; -using API.Persistence.Repositories; +using AuthorizationService.Application.Users.Commands; +using AuthorizationService.Application.Users.Queries; +using AuthorizationService.Persistence.Repositories; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.EntityFrameworkCore; using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using System.Text; -namespace API +namespace AuthorizationService { public class Program { diff --git a/services/AuthorizationService/skantravels-authorization.service b/services/AuthorizationService/skantravels-authorization.service index 1ca9378..8f08e1c 100644 --- a/services/AuthorizationService/skantravels-authorization.service +++ b/services/AuthorizationService/skantravels-authorization.service @@ -7,7 +7,7 @@ Environment=DOTNET_ROOT=/home/reimar/.dotnet Environment=PATH=$PATH:/home/reimar/.dotnet Environment=DEFAULT_CONNECTION="Data Source=/home/reimar/skantravels/database.sqlite3" ExecStartPre=/home/reimar/skantravels/efbundle -ExecStart=/home/reimar/skantravels/API --urls=http://0.0.0.0:5001 +ExecStart=/home/reimar/skantravels/AuthorizationService --urls=http://0.0.0.0:5001 Type=simple [Install]