feat(auth): AD-Authentifizierungsprüfung hinzugefügt

This commit is contained in:
Developer 02 2024-04-02 15:02:07 +02:00
parent fa66e7ba0d
commit 59619702ab
56 changed files with 47 additions and 34 deletions

Binary file not shown.

View File

@ -66,7 +66,7 @@ namespace DigitalData.Core.API
/// <param name="id">The identifier of the entity to retrieve.</param>
/// <returns>A task that represents the asynchronous read operation. The task result contains the action result.</returns>
[HttpGet("{id}")]
public virtual async Task<IActionResult> GetById([FromRoute]TId id)
public virtual async Task<IActionResult> GetById([FromRoute] TId id)
{
var result = await _service.ReadByIdAsync(id);
if (result.IsSuccess)
@ -113,7 +113,7 @@ namespace DigitalData.Core.API
/// <param name="id">The identifier of the entity to delete.</param>
/// <returns>A task that represents the asynchronous delete operation. The task result contains the action result.</returns>
[HttpDelete("{id}")]
public virtual async Task<IActionResult> Delete([FromRoute]TId id)
public virtual async Task<IActionResult> Delete([FromRoute] TId id)
{
var result = await _service.DeleteAsyncById(id);
if (result.IsSuccess)

View File

@ -42,7 +42,7 @@ namespace DigitalData.Core.API
/// <param name="id">The identifier of the entity to retrieve.</param>
/// <returns>A task that represents the asynchronous read operation. The task result contains the action result.</returns>
[HttpGet("{id}")]
public virtual async Task<IActionResult> GetById([FromRoute]TId id)
public virtual async Task<IActionResult> GetById([FromRoute] TId id)
{
var result = await _service.ReadByIdAsync(id);
if (result.IsSuccess)

View File

@ -1,6 +0,0 @@
namespace DigitalData.Core.Application
{
public class AuthService
{
}
}

View File

@ -48,7 +48,7 @@ namespace DigitalData.Core.Application
{
var entity = _mapper.MapOrThrow<TEntity>(createDto);
var createdEntity = await _repository.CreateAsync(entity);
if(createdEntity is null)
if (createdEntity is null)
return Failed<TId>();
else
return Successful(KeyValueOf(createdEntity));
@ -145,7 +145,7 @@ namespace DigitalData.Core.Application
/// <returns>The ID of the entity.</returns>
protected virtual TId KeyValueOf(TEntity entity)
{
if(_keyPropertyInfo is null)
if (_keyPropertyInfo is null)
throw new InvalidOperationException($"No property with [Key] attribute found on {typeof(TEntity).Name} entity.");
object idObj = _keyPropertyInfo?.GetValue(entity) ?? throw new InvalidOperationException($"The ID property of {typeof(TEntity).Name} entity cannot be null.");

View File

@ -1 +1 @@
27b4d1c0e521dbdcdae7e49ff5b85233b84a7ece
9c98a8de39558d32de60bd00a4f3744b3887e0d2

View File

@ -1,11 +0,0 @@
using System.DirectoryServices;
namespace DigitalData.Core.Contracts.Infrastructure
{
public interface IADDataAccessor
{
SearchResultCollection ReadAll();
SearchResult? ReadOne();
}
}

View File

@ -1,9 +0,0 @@
using System.DirectoryServices;
namespace DigitalData.Core.Contracts.Infrastructure
{
public interface ISearcherProvider<ADDataAccessor>
{
public Func<DirectorySearcher> Provide { get; }
}
}

View File

@ -1 +1 @@
f4387e0fddd1173993a6db1f0ae947a265e040d2
c04ab3cbc3319f5880fb96acc2dc1da3e8fd9daa

View File

@ -0,0 +1,12 @@
{
"profiles": {
"DigitalData.Core.CultureServices": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:61600;http://localhost:61602"
}
}
}

View File

@ -0,0 +1,12 @@
{
"profiles": {
"DigitalData.Core.Infrastructure": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:61601;http://localhost:61604"
}
}
}

View File

@ -0,0 +1,12 @@
{
"profiles": {
"DigitalData.Core.Tests": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "https://localhost:61599;http://localhost:61603"
}
}
}

View File

@ -1171,7 +1171,8 @@
"lib/net45/Microsoft.VisualStudio.CodeCoverage.Shim.dll",
"lib/netcoreapp1.0/Microsoft.VisualStudio.CodeCoverage.Shim.dll",
"microsoft.codecoverage.17.3.2.nupkg.sha512",
"microsoft.codecoverage.nuspec"
"microsoft.codecoverage.nuspec",
"r5jqoi1l.cal"
]
},
"Microsoft.CSharp/4.0.1": {
@ -1306,6 +1307,7 @@
".signature.p7s",
"Icon.png",
"LICENSE_NET.txt",
"hctajusm.1yt",
"lib/net45/Microsoft.TestPlatform.CoreUtilities.dll",
"lib/net45/Microsoft.TestPlatform.PlatformAbstractions.dll",
"lib/net45/Microsoft.VisualStudio.TestPlatform.ObjectModel.dll",
@ -1644,6 +1646,7 @@
"build/uap10.0/zh-Hant/Microsoft.TestPlatform.Utilities.resources.dll",
"build/uap10.0/zh-Hant/Microsoft.VisualStudio.TestPlatform.Common.resources.dll",
"build/uap10.0/zh-Hant/Microsoft.VisualStudio.TestPlatform.ObjectModel.resources.dll",
"jvo0yirh.p50",
"lib/net45/_._",
"lib/netcoreapp1.0/Microsoft.TestPlatform.CommunicationUtilities.dll",
"lib/netcoreapp1.0/Microsoft.TestPlatform.CoreUtilities.dll",