Integration des Active Directory Controllers und Active Directory Service abgeschlossen.

This commit is contained in:
Developer 02 2024-03-11 08:48:40 +01:00
parent 58f87e2be5
commit df9bc33795
420 changed files with 2611 additions and 4118 deletions

7
.editorconfig Normal file
View File

@ -0,0 +1,7 @@
[*.cs]
# Default severity for analyzer diagnostics with category 'Interoperability'
dotnet_analyzer_diagnostic.category-Interoperability.severity = warning
# IDE0058: Expression value is never used
dotnet_diagnostic.IDE0058.severity = none

Binary file not shown.

View File

@ -1,13 +0,0 @@
using DigitalData.Core.API;
using DigitalData.Core.Contracts.Authentication.Services;
using DigitalData.UserManager.Domain.Entities;
namespace DigitalData.UserManager.API.Controllers
{
public class ADGroupController : ADControllerBase<ADGroupController, ADGroup>
{
public ADGroupController(ILogger<ADGroupController> logger, IADService<ADGroup> service) : base(logger, service)
{
}
}
}

View File

@ -0,0 +1,39 @@
using DigitalData.Core.Contracts.Application;
using DigitalData.UserManager.Application.DTOs.User;
using Microsoft.AspNetCore.Mvc;
namespace DigitalData.UserManager.API.Controllers
{
[Route("api/[controller]")]
public class DirectoryController : ControllerBase
{
private ILogger<DirectoryController> _logger;
private IDirectoryService _dirService;
public DirectoryController(ILogger<DirectoryController> logger, IDirectoryService dirService)
{
_logger = logger;
_dirService = dirService;
}
[HttpGet("Group")]
public IActionResult GetGroupAd(string? propName = null)
{
if (propName is not null)
return Ok(_dirService.ReadGroupByPropertyName(propName));
else
return Ok(_dirService.ReadAllGroupAsCollection());
}
[HttpGet("User")]
public IActionResult GetUserByGroupName([FromQuery] string groupName)
{
if(groupName is null)
{
return BadRequest(_dirService.Failed());
}
return Ok(_dirService.ReadUserByGroup<UserPrincipalReadDto>(groupIdentityValue:groupName));
}
}
}

View File

@ -1,5 +1,4 @@
using DigitalData.Core.API;
using DigitalData.Core.Contracts.Authentication.Services;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.Group;
using DigitalData.UserManager.Domain.Entities;

View File

@ -1,6 +1,5 @@
using DigitalData.Core.API;
using DigitalData.Core.Contracts.CleanArchitecture.Application;
using DigitalData.Core.Contracts.Utilities.Service;
using DigitalData.Core.Contracts.Application;
using DigitalData.UserManager.Application.Contracts;
using DigitalData.UserManager.Application.DTOs.ModuleOfUser;
using DigitalData.UserManager.Domain.Entities;

View File

@ -16,6 +16,7 @@
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.15" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
<PackageReference Include="System.DirectoryServices" Version="7.0.1" />
<PackageReference Include="System.DirectoryServices.AccountManagement" Version="7.0.1" />
<PackageReference Include="System.DirectoryServices.Protocols" Version="7.0.1" />
</ItemGroup>
@ -28,29 +29,17 @@
<Reference Include="DigitalData.Core.API">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.API\bin\Debug\net7.0\DigitalData.Core.API.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.Attributes">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.Authentication\bin\Debug\net7.0\DigitalData.Core.Attributes.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.Authentication">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.Authentication\bin\Debug\net7.0\DigitalData.Core.Authentication.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.CleanArchitecture.Application">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.CleanArchitecture.Application\bin\Debug\net7.0\DigitalData.Core.CleanArchitecture.Application.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.CleanArchitecture.Infrastructure">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.CleanArchitecture.Infrastructure\bin\Debug\net7.0\DigitalData.Core.CleanArchitecture.Infrastructure.dll</HintPath>
<Reference Include="DigitalData.Core.Application">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.Application\bin\Debug\net7.0\DigitalData.Core.Application.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.Contracts">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.API\bin\Debug\net7.0\DigitalData.Core.Contracts.dll</HintPath>
<HintPath>..\..\DigitalData.Core\DigitalData.Core.Contracts\bin\Debug\net7.0\DigitalData.Core.Contracts.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.CultureServices">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.CultureServices\bin\Debug\net7.0\DigitalData.Core.CultureServices.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.Exceptions">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.CleanArchitecture.Application\bin\Debug\net7.0\DigitalData.Core.Exceptions.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Core.Utilities">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.Utilities\bin\Debug\net7.0\DigitalData.Core.Utilities.dll</HintPath>
<Reference Include="DigitalData.Core.Infrastructure">
<HintPath>..\..\DigitalData.Core\DigitalData.Core.Infrastructure\bin\Debug\net7.0\DigitalData.Core.Infrastructure.dll</HintPath>
</Reference>
</ItemGroup>

View File

@ -5,9 +5,9 @@ using DigitalData.UserManager.Application.Services;
using DigitalData.UserManager.Infrastructure.Repositories;
using DigitalData.UserManager.Infrastructure.Contracts;
using DigitalData.Core.CultureServices;
using DigitalData.Core.Contracts.Authentication.Services;
using DigitalData.UserManager.Domain.Entities;
using DigitalData.Core.Authentication.Services;
using DigitalData.Core.Application;
using System.DirectoryServices;
using DigitalData.UserManager.API;
var builder = WebApplication.CreateBuilder(args);
@ -25,7 +25,6 @@ builder.Services.AddSwaggerGen();
// options.ReportApiVersions = true;
//});
builder.Services.AddDbContext<DDECMDbContext>(options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("DD_ECM_Connection")));
@ -48,6 +47,7 @@ builder.Services.AddAutoMapper(typeof(GroupOfUserMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(ModuleMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(ModuleOfUserMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(UserRepMappingProfile).Assembly);
builder.Services.AddAutoMapper(typeof(DirectoryMappingProfile).Assembly);
builder.Services.AddScoped<IUserRepository, UserRepository>();
builder.Services.AddScoped<IGroupRepository, GroupRepository>();
@ -63,7 +63,7 @@ builder.Services.AddScoped<IModuleService, ModuleService>();
builder.Services.AddScoped<IModuleOfUserService, ModuleOfUserService>();
builder.Services.AddScoped<IUserRepService, UserRepService>();
builder.Services.AddScoped<IADService<ADGroup>, ADService<ADGroup>>();
builder.Services.AddDirectoryService();
var app = builder.Build();

View File

@ -16,16 +16,13 @@
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.15",
"Swashbuckle.AspNetCore": "6.4.0",
"System.DirectoryServices": "7.0.1",
"System.DirectoryServices.AccountManagement": "7.0.1",
"System.DirectoryServices.Protocols": "7.0.1",
"DigitalData.Core.API": "1.0.0.0",
"DigitalData.Core.Attributes": "1.0.0.0",
"DigitalData.Core.Authentication": "1.0.0.0",
"DigitalData.Core.CleanArchitecture.Application": "1.0.0.0",
"DigitalData.Core.CleanArchitecture.Infrastructure": "1.0.0.0",
"DigitalData.Core.Application": "1.0.0.0",
"DigitalData.Core.Contracts": "1.0.0.0",
"DigitalData.Core.CultureServices": "1.0.0.0",
"DigitalData.Core.Exceptions": "1.0.0.0",
"DigitalData.Core.Utilities": "1.0.0.0"
"DigitalData.Core.Infrastructure": "1.0.0.0"
},
"runtime": {
"DigitalData.UserManager.API.dll": {}
@ -65,7 +62,7 @@
"Microsoft.Identity.Client": "4.47.2",
"Microsoft.Identity.Client.Extensions.Msal": "2.19.3",
"System.Memory": "4.5.4",
"System.Security.Cryptography.ProtectedData": "6.0.0",
"System.Security.Cryptography.ProtectedData": "7.0.0",
"System.Text.Json": "7.0.0",
"System.Threading.Tasks.Extensions": "4.5.4"
},
@ -112,7 +109,7 @@
"Microsoft.IdentityModel.JsonWebTokens": "6.24.0",
"Microsoft.IdentityModel.Protocols.OpenIdConnect": "6.24.0",
"Microsoft.SqlServer.Server": "1.0.0",
"System.Configuration.ConfigurationManager": "6.0.1",
"System.Configuration.ConfigurationManager": "7.0.0",
"System.Diagnostics.DiagnosticSource": "6.0.0",
"System.Runtime.Caching": "6.0.0",
"System.Security.Cryptography.Cng": "5.0.0",
@ -295,7 +292,7 @@
"Microsoft.Identity.Client.Extensions.Msal/2.19.3": {
"dependencies": {
"Microsoft.Identity.Client": "4.47.2",
"System.Security.Cryptography.ProtectedData": "6.0.0"
"System.Security.Cryptography.ProtectedData": "7.0.0"
},
"runtime": {
"lib/netcoreapp2.1/Microsoft.Identity.Client.Extensions.Msal.dll": {
@ -464,15 +461,16 @@
}
}
},
"System.Configuration.ConfigurationManager/6.0.1": {
"System.Configuration.ConfigurationManager/7.0.0": {
"dependencies": {
"System.Security.Cryptography.ProtectedData": "6.0.0",
"System.Diagnostics.EventLog": "7.0.0",
"System.Security.Cryptography.ProtectedData": "7.0.0",
"System.Security.Permissions": "7.0.0"
},
"runtime": {
"lib/net6.0/System.Configuration.ConfigurationManager.dll": {
"assemblyVersion": "6.0.0.0",
"fileVersion": "6.0.922.41905"
"lib/net7.0/System.Configuration.ConfigurationManager.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
@ -481,6 +479,7 @@
"System.Runtime.CompilerServices.Unsafe": "6.0.0"
}
},
"System.Diagnostics.EventLog/7.0.0": {},
"System.DirectoryServices/7.0.1": {
"dependencies": {
"System.Security.Permissions": "7.0.0"
@ -500,6 +499,27 @@
}
}
},
"System.DirectoryServices.AccountManagement/7.0.1": {
"dependencies": {
"System.Configuration.ConfigurationManager": "7.0.0",
"System.DirectoryServices": "7.0.1",
"System.DirectoryServices.Protocols": "7.0.1"
},
"runtime": {
"lib/net7.0/System.DirectoryServices.AccountManagement.dll": {
"assemblyVersion": "4.0.0.0",
"fileVersion": "7.0.1123.42427"
}
},
"runtimeTargets": {
"runtimes/win/lib/net7.0/System.DirectoryServices.AccountManagement.dll": {
"rid": "win",
"assetType": "runtime",
"assemblyVersion": "4.0.0.0",
"fileVersion": "7.0.1123.42427"
}
}
},
"System.DirectoryServices.Protocols/7.0.1": {
"runtime": {
"lib/net7.0/System.DirectoryServices.Protocols.dll": {
@ -582,7 +602,7 @@
},
"System.Runtime.Caching/6.0.0": {
"dependencies": {
"System.Configuration.ConfigurationManager": "6.0.1"
"System.Configuration.ConfigurationManager": "7.0.0"
},
"runtime": {
"lib/net6.0/System.Runtime.Caching.dll": {
@ -605,19 +625,19 @@
"System.Formats.Asn1": "5.0.0"
}
},
"System.Security.Cryptography.ProtectedData/6.0.0": {
"System.Security.Cryptography.ProtectedData/7.0.0": {
"runtime": {
"lib/net6.0/System.Security.Cryptography.ProtectedData.dll": {
"assemblyVersion": "6.0.0.0",
"fileVersion": "6.0.21.52210"
"lib/net7.0/System.Security.Cryptography.ProtectedData.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
},
"runtimeTargets": {
"runtimes/win/lib/net6.0/System.Security.Cryptography.ProtectedData.dll": {
"runtimes/win/lib/net7.0/System.Security.Cryptography.ProtectedData.dll": {
"rid": "win",
"assetType": "runtime",
"assemblyVersion": "6.0.0.0",
"fileVersion": "6.0.21.52210"
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
}
}
},
@ -675,7 +695,9 @@
"dependencies": {
"AutoMapper": "13.0.1",
"DigitalData.UserManager.Domain": "1.0.0",
"DigitalData.UserManager.Infrastructure": "1.0.0"
"DigitalData.UserManager.Infrastructure": "1.0.0",
"System.DirectoryServices": "7.0.1",
"System.DirectoryServices.AccountManagement": "7.0.1"
},
"runtime": {
"DigitalData.UserManager.Application.dll": {}
@ -704,33 +726,9 @@
}
}
},
"DigitalData.Core.Attributes/1.0.0.0": {
"DigitalData.Core.Application/1.0.0.0": {
"runtime": {
"DigitalData.Core.Attributes.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"DigitalData.Core.Authentication/1.0.0.0": {
"runtime": {
"DigitalData.Core.Authentication.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"DigitalData.Core.CleanArchitecture.Application/1.0.0.0": {
"runtime": {
"DigitalData.Core.CleanArchitecture.Application.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"DigitalData.Core.CleanArchitecture.Infrastructure/1.0.0.0": {
"runtime": {
"DigitalData.Core.CleanArchitecture.Infrastructure.dll": {
"DigitalData.Core.Application.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
@ -752,17 +750,17 @@
}
}
},
"DigitalData.Core.Exceptions/1.0.0.0": {
"DigitalData.Core.Infrastructure/1.0.0.0": {
"runtime": {
"DigitalData.Core.Exceptions.dll": {
"DigitalData.Core.Infrastructure.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
}
},
"DigitalData.Core.Utilities/1.0.0.0": {
"DigitalData.Core.Attributes/1.0.0.0": {
"runtime": {
"DigitalData.Core.Utilities.dll": {
"DigitalData.Core.Attributes.dll": {
"assemblyVersion": "1.0.0.0",
"fileVersion": "1.0.0.0"
}
@ -1091,12 +1089,12 @@
"path": "system.codedom/4.4.0",
"hashPath": "system.codedom.4.4.0.nupkg.sha512"
},
"System.Configuration.ConfigurationManager/6.0.1": {
"System.Configuration.ConfigurationManager/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-jXw9MlUu/kRfEU0WyTptAVueupqIeE3/rl0EZDMlf8pcvJnitQ8HeVEp69rZdaStXwTV72boi/Bhw8lOeO+U2w==",
"path": "system.configuration.configurationmanager/6.0.1",
"hashPath": "system.configuration.configurationmanager.6.0.1.nupkg.sha512"
"sha512": "sha512-WvRUdlL1lB0dTRZSs5XcQOd5q9MYNk90GkbmRmiCvRHThWiojkpGqWdmEDJdXyHbxG/BhE5hmVbMfRLXW9FJVA==",
"path": "system.configuration.configurationmanager/7.0.0",
"hashPath": "system.configuration.configurationmanager.7.0.0.nupkg.sha512"
},
"System.Diagnostics.DiagnosticSource/6.0.0": {
"type": "package",
@ -1105,6 +1103,13 @@
"path": "system.diagnostics.diagnosticsource/6.0.0",
"hashPath": "system.diagnostics.diagnosticsource.6.0.0.nupkg.sha512"
},
"System.Diagnostics.EventLog/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-eUDP47obqQm3SFJfP6z+Fx2nJ4KKTQbXB4Q9Uesnzw9SbYdhjyoGXuvDn/gEmFY6N5Z3bFFbpAQGA7m6hrYJCw==",
"path": "system.diagnostics.eventlog/7.0.0",
"hashPath": "system.diagnostics.eventlog.7.0.0.nupkg.sha512"
},
"System.DirectoryServices/7.0.1": {
"type": "package",
"serviceable": true,
@ -1112,6 +1117,13 @@
"path": "system.directoryservices/7.0.1",
"hashPath": "system.directoryservices.7.0.1.nupkg.sha512"
},
"System.DirectoryServices.AccountManagement/7.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-UNytHYwA5IF55WQhashsMG57ize83JUGJxD8YJlOyO9ZlMTOD4Nt7y+A6mvmrU/swDoYWaVL+TNwE6hk9lyvbA==",
"path": "system.directoryservices.accountmanagement/7.0.1",
"hashPath": "system.directoryservices.accountmanagement.7.0.1.nupkg.sha512"
},
"System.DirectoryServices.Protocols/7.0.1": {
"type": "package",
"serviceable": true,
@ -1189,12 +1201,12 @@
"path": "system.security.cryptography.cng/5.0.0",
"hashPath": "system.security.cryptography.cng.5.0.0.nupkg.sha512"
},
"System.Security.Cryptography.ProtectedData/6.0.0": {
"System.Security.Cryptography.ProtectedData/7.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-rp1gMNEZpvx9vP0JW0oHLxlf8oSiQgtno77Y4PLUBjSiDYoD77Y8uXHr1Ea5XG4/pIKhqAdxZ8v8OTUtqo9PeQ==",
"path": "system.security.cryptography.protecteddata/6.0.0",
"hashPath": "system.security.cryptography.protecteddata.6.0.0.nupkg.sha512"
"sha512": "sha512-xSPiLNlHT6wAHtugASbKAJwV5GVqQK351crnILAucUioFqqieDN79evO1rku1ckt/GfjIn+b17UaSskoY03JuA==",
"path": "system.security.cryptography.protecteddata/7.0.0",
"hashPath": "system.security.cryptography.protecteddata.7.0.0.nupkg.sha512"
},
"System.Security.Permissions/7.0.0": {
"type": "package",
@ -1272,22 +1284,7 @@
"serviceable": false,
"sha512": ""
},
"DigitalData.Core.Attributes/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"DigitalData.Core.Authentication/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"DigitalData.Core.CleanArchitecture.Application/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"DigitalData.Core.CleanArchitecture.Infrastructure/1.0.0.0": {
"DigitalData.Core.Application/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
@ -1302,12 +1299,12 @@
"serviceable": false,
"sha512": ""
},
"DigitalData.Core.Exceptions/1.0.0.0": {
"DigitalData.Core.Infrastructure/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""
},
"DigitalData.Core.Utilities/1.0.0.0": {
"DigitalData.Core.Attributes/1.0.0.0": {
"type": "reference",
"serviceable": false,
"sha512": ""

View File

@ -1,21 +0,0 @@
{
"runtimeOptions": {
"tfm": "net7.0",
"frameworks": [
{
"name": "Microsoft.NETCore.App",
"version": "7.0.0"
},
{
"name": "Microsoft.AspNetCore.App",
"version": "7.0.0"
}
],
"configProperties": {
"System.GC.Server": true,
"System.Reflection.Metadata.MetadataUpdater.IsSupported": false,
"System.Reflection.NullabilityInfoContext.IsSupported": true,
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
}
}
}

Some files were not shown because too many files have changed in this diff Show More