Skip to content

Commit 0ca8e0a

Browse files
authored
Merge pull request #1 from honamic/IdentityPlus
identity plus
2 parents b18d4b2 + 5b3b571 commit 0ca8e0a

File tree

65 files changed

+5548
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+5548
-10
lines changed

Honamic.Framework.sln

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Honamic.Todo.Endpoints.WebA
9393
EndProject
9494
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{196209A4-3BCC-442B-9686-CF311ADEBF6D}"
9595
EndProject
96-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Honamic.Framework.Tools.IdGenerators", "src\Tools\Honamic.Framework.Tools.IdGenerators\Honamic.Framework.Tools.IdGenerators.csproj", "{462B177A-3E97-4F60-A141-7A01F8B437B5}"
96+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Honamic.Framework.Tools.IdGenerators", "src\Tools\Honamic.Framework.Tools.IdGenerators\Honamic.Framework.Tools.IdGenerators.csproj", "{462B177A-3E97-4F60-A141-7A01F8B437B5}"
97+
EndProject
98+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "IdentityPlus", "IdentityPlus", "{7ACD81EB-9F97-44A5-B91B-2E12C5F45607}"
99+
EndProject
100+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Honamic.IdentityPlus.Persistence", "src\IdentityPlus\Persistence\Honamic.IdentityPlus.Persistence.csproj", "{CD6164DC-0762-4E6E-8BAC-2D56CEB8C8C3}"
101+
EndProject
102+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Honamic.IdentityPlus.Domain.Abstractions", "src\IdentityPlus\Domain.Abstractions\Honamic.IdentityPlus.Domain.Abstractions.csproj", "{81DDE308-A3CF-4502-8CFF-A1A5411EE37D}"
103+
EndProject
104+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Honamic.IdentityPlus.Application", "src\IdentityPlus\Application\Honamic.IdentityPlus.Application.csproj", "{A46468C4-5C78-459C-BAF0-AF358CA57B65}"
105+
EndProject
106+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Honamic.IdentityPlus.Domain", "src\IdentityPlus\Domain\Honamic.IdentityPlus.Domain.csproj", "{B2FA9794-6654-4B7D-B996-EEB6F0C36072}"
107+
EndProject
108+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Honamic.IdentityPlus.WebApi", "src\IdentityPlus\WebApi\Honamic.IdentityPlus.WebApi.csproj", "{DBE18797-E5D4-4000-8BE8-D0F3BA1F8C9A}"
97109
EndProject
98110
Global
99111
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -225,6 +237,26 @@ Global
225237
{462B177A-3E97-4F60-A141-7A01F8B437B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
226238
{462B177A-3E97-4F60-A141-7A01F8B437B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
227239
{462B177A-3E97-4F60-A141-7A01F8B437B5}.Release|Any CPU.Build.0 = Release|Any CPU
240+
{CD6164DC-0762-4E6E-8BAC-2D56CEB8C8C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
241+
{CD6164DC-0762-4E6E-8BAC-2D56CEB8C8C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
242+
{CD6164DC-0762-4E6E-8BAC-2D56CEB8C8C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
243+
{CD6164DC-0762-4E6E-8BAC-2D56CEB8C8C3}.Release|Any CPU.Build.0 = Release|Any CPU
244+
{81DDE308-A3CF-4502-8CFF-A1A5411EE37D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
245+
{81DDE308-A3CF-4502-8CFF-A1A5411EE37D}.Debug|Any CPU.Build.0 = Debug|Any CPU
246+
{81DDE308-A3CF-4502-8CFF-A1A5411EE37D}.Release|Any CPU.ActiveCfg = Release|Any CPU
247+
{81DDE308-A3CF-4502-8CFF-A1A5411EE37D}.Release|Any CPU.Build.0 = Release|Any CPU
248+
{A46468C4-5C78-459C-BAF0-AF358CA57B65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
249+
{A46468C4-5C78-459C-BAF0-AF358CA57B65}.Debug|Any CPU.Build.0 = Debug|Any CPU
250+
{A46468C4-5C78-459C-BAF0-AF358CA57B65}.Release|Any CPU.ActiveCfg = Release|Any CPU
251+
{A46468C4-5C78-459C-BAF0-AF358CA57B65}.Release|Any CPU.Build.0 = Release|Any CPU
252+
{B2FA9794-6654-4B7D-B996-EEB6F0C36072}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
253+
{B2FA9794-6654-4B7D-B996-EEB6F0C36072}.Debug|Any CPU.Build.0 = Debug|Any CPU
254+
{B2FA9794-6654-4B7D-B996-EEB6F0C36072}.Release|Any CPU.ActiveCfg = Release|Any CPU
255+
{B2FA9794-6654-4B7D-B996-EEB6F0C36072}.Release|Any CPU.Build.0 = Release|Any CPU
256+
{DBE18797-E5D4-4000-8BE8-D0F3BA1F8C9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
257+
{DBE18797-E5D4-4000-8BE8-D0F3BA1F8C9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
258+
{DBE18797-E5D4-4000-8BE8-D0F3BA1F8C9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
259+
{DBE18797-E5D4-4000-8BE8-D0F3BA1F8C9A}.Release|Any CPU.Build.0 = Release|Any CPU
228260
EndGlobalSection
229261
GlobalSection(SolutionProperties) = preSolution
230262
HideSolutionNode = FALSE
@@ -274,6 +306,12 @@ Global
274306
{AED57B53-F951-4DE2-9367-18BD2DD063BB} = {39275E89-52E0-4D1B-ABD5-5A8D334A0A8D}
275307
{196209A4-3BCC-442B-9686-CF311ADEBF6D} = {E9FC6BF1-7A52-43AD-90F3-E8A20BE3FE99}
276308
{462B177A-3E97-4F60-A141-7A01F8B437B5} = {196209A4-3BCC-442B-9686-CF311ADEBF6D}
309+
{7ACD81EB-9F97-44A5-B91B-2E12C5F45607} = {E9FC6BF1-7A52-43AD-90F3-E8A20BE3FE99}
310+
{CD6164DC-0762-4E6E-8BAC-2D56CEB8C8C3} = {7ACD81EB-9F97-44A5-B91B-2E12C5F45607}
311+
{81DDE308-A3CF-4502-8CFF-A1A5411EE37D} = {7ACD81EB-9F97-44A5-B91B-2E12C5F45607}
312+
{A46468C4-5C78-459C-BAF0-AF358CA57B65} = {7ACD81EB-9F97-44A5-B91B-2E12C5F45607}
313+
{B2FA9794-6654-4B7D-B996-EEB6F0C36072} = {7ACD81EB-9F97-44A5-B91B-2E12C5F45607}
314+
{DBE18797-E5D4-4000-8BE8-D0F3BA1F8C9A} = {7ACD81EB-9F97-44A5-B91B-2E12C5F45607}
277315
EndGlobalSection
278316
GlobalSection(ExtensibilityGlobals) = postSolution
279317
SolutionGuid = {E15D83FC-8F5C-4D9C-9DCD-D114F5609922}

TodoSample/Core/Application/Extensions/ApplicationServiceCollectionExtensions.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using Honamic.Todo.Application.TodoItems.CommandHandlers;
66
using Honamic.Todo.Domain.Extensions;
77
using Honamic.Framework.Tools.IdGenerators;
8+
using Honamic.Todo.Application.TodoItems.EventHandlers;
9+
using Honamic.IdentityPlus.Domain.Users;
810

911
namespace Honamic.Todo.Application.Extensions;
1012

@@ -14,6 +16,7 @@ public static void AddApplicationServices(this IServiceCollection services, ICon
1416
{
1517
services.AddDefaultApplicationsServices();
1618
services.AddCommandHandlers();
19+
services.AddEventHandlers();
1720
services.AddDomainServices();
1821
services.AddSnowflakeIdGeneratorServices();
1922
}
@@ -23,4 +26,10 @@ private static void AddCommandHandlers(this IServiceCollection services)
2326
services.AddCommandHandler<DeleteTodoItemCommand, DeleteTodoItemCommandHandler>();
2427
services.AddCommandHandler<CreateTodoItemCommand, CreateTodoItemCommandHandler>();
2528
}
29+
30+
private static void AddEventHandlers(this IServiceCollection services)
31+
{
32+
services.AddEventHandler<UserCreatedEvent, UserCreatedEventHandler>();
33+
services.AddEventHandler<UserLoggedEvent, UserLoggedEventHandler>();
34+
}
2635
}

TodoSample/Core/Application/Honamic.Todo.Application.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
<ItemGroup>
1616
<ProjectReference Include="..\..\..\src\Core\Applications\Honamic.Framework.Applications.csproj" />
17+
<ProjectReference Include="..\..\..\src\IdentityPlus\Domain.Abstractions\Honamic.IdentityPlus.Domain.Abstractions.csproj" />
1718
<ProjectReference Include="..\..\..\src\Tools\Honamic.Framework.Tools.IdGenerators\Honamic.Framework.Tools.IdGenerators.csproj" />
1819
<ProjectReference Include="..\Application.Contracts\Honamic.Todo.Application.Contracts.csproj" />
1920
<ProjectReference Include="..\Domain\Honamic.Todo.Domain.csproj" />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Honamic.Framework.Events;
2+
using Honamic.IdentityPlus.Domain.Users;
3+
4+
namespace Honamic.Todo.Application.TodoItems.EventHandlers;
5+
public class UserCreatedEventHandler : IEventHandler<UserCreatedEvent>
6+
{
7+
public Task HandleAsync(UserCreatedEvent eventToHandle)
8+
{
9+
return Task.CompletedTask;
10+
}
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
using Honamic.Framework.Events;
2+
using Honamic.IdentityPlus.Domain.Users;
3+
4+
namespace Honamic.Todo.Application.TodoItems.EventHandlers;
5+
public class UserLoggedEventHandler : IEventHandler<UserLoggedEvent>
6+
{
7+
public Task HandleAsync(UserLoggedEvent eventToHandle)
8+
{
9+
return Task.CompletedTask;
10+
}
11+
}

TodoSample/Endpoints/WebApi/Honamic.Todo.Endpoints.WebApi/Extensions/ServiceCollectionExtensions.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Honamic.Framework.Endpoints.Web.Extensions;
22
using Honamic.Framework.Utilities.Web.Json;
33
using Honamic.Todo.Facade.Extensions;
4+
using Honamic.IdentityPlus.WebApi.Extensions;
45

56
namespace Honamic.Todo.Endpoints.WebApi.Extensions;
67

@@ -9,7 +10,9 @@ public static class ServiceCollectionExtensions
910
public static IServiceCollection ConfigureServices(this IServiceCollection services, IConfiguration configuration)
1011
{
1112
services.AddFacades(configuration);
13+
services.AddIdentityPlusApiEndpoint();
1214
services.AddEndpointsServices(configuration);
15+
1316
return services;
1417
}
1518

@@ -22,7 +25,7 @@ private static void AddEndpointsServices(this IServiceCollection services, IConf
2225
c.JsonSerializerOptions
2326
.Converters.Add(new CustomLongToStringConverter());
2427
});
25-
services.AddEndpointsApiExplorer();
28+
services.AddEndpointsApiExplorer();
2629
services.AddSwaggerGen();
2730
services.AddCors();
2831
}

TodoSample/Endpoints/WebApi/Honamic.Todo.Endpoints.WebApi/Extensions/WebApplicationExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Honamic.Framework.Endpoints.Web.Extensions;
22
using Honamic.Framework.Facade.Web.Middleware;
3-
3+
using Honamic.IdentityPlus.WebApi.Extensions;
44
namespace Honamic.Todo.Endpoints.WebApi.Extensions;
55

66
public static class WebApplicationExtensions
@@ -29,6 +29,8 @@ public static WebApplication UseConfigurations(this WebApplication app)
2929

3030
app.UseAuthorization();
3131

32+
app.MapIdentityPlusApi();
33+
3234
app.MapControllers();
3335

3436
return app;

TodoSample/Endpoints/WebApi/Honamic.Todo.Endpoints.WebApi/Honamic.Todo.Endpoints.WebApi.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<ItemGroup>
1919
<ProjectReference Include="..\..\..\..\src\Endpoints\Web\Honamic.Framework.Endpoints.Web.csproj" />
2020
<ProjectReference Include="..\..\..\..\src\Facade\Web\Honamic.Framework.Facade.Web.csproj" />
21+
<ProjectReference Include="..\..\..\..\src\IdentityPlus\WebApi\Honamic.IdentityPlus.WebApi.csproj" />
2122
<ProjectReference Include="..\..\..\Facade\Honamic.Todo.Facade.csproj" />
2223
</ItemGroup>
2324

TodoSample/Infra/Persistence/Extensions/ServiceCollectionExtensions.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using Honamic.Todo.Domain.TodoItems;
66
using Honamic.Todo.Domain;
77
using Honamic.Todo.Persistence.EntityFramework.TodoItems;
8+
using Honamic.IdentityPlus.Persistence.Extensions;
89

910

1011
namespace Honamic.Todo.Persistence.EntityFramework.Extensions;
@@ -28,6 +29,8 @@ public static void AddPersistenceEntityFrameworkServices(this IServiceCollection
2829
services.AddScoped<DbContext>((sp) => sp.GetRequiredService<TodoDbContext>());
2930
services.AddTransient<ITodoItemRepository, TodoItemRepository>();
3031
services.AddUnitOfWorkByEntityFramework();
32+
33+
services.AddIdentityPlusPersistence();
3134
}
3235

3336
private static void DebuggerConnectionStringLog(string? SqlServerConnection)

TodoSample/Infra/Persistence/Honamic.Todo.Persistence.EntityFramework.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
<ItemGroup>
2525
<ProjectReference Include="..\..\..\src\EntityFramework\Persistence\Honamic.Framework.EntityFramework.Persistence.csproj" />
26+
<ProjectReference Include="..\..\..\src\IdentityPlus\Persistence\Honamic.IdentityPlus.Persistence.csproj" />
2627
<ProjectReference Include="..\..\core\domain\Honamic.Todo.Domain.csproj" />
2728
</ItemGroup>
2829

0 commit comments

Comments
 (0)