Compare commits

...

5 Commits

17 changed files with 35 additions and 31 deletions

View File

@@ -32,8 +32,7 @@ try
builder.Services.AddDbContext<WFDBContext>(options => options.UseSqlServer(cnn_str).EnableDetailedErrors());
builder.Services.AddWorkFlow().AddUserManager<WFDBContext>();
builder.Services.AddCookieBasedLocalizer();
builder.ConfigureBySection<DirectorySearchOptions>();
builder.Services.AddDirectorySearchService();
builder.Services.AddDirectorySearchService(config.GetSection("DirectorySearchOptions"));
builder.Services.AddJWTService<UserReadDto>(user => new SecurityTokenDescriptor()
{
Claims = user.ToClaimList().ToDictionary(claim => claim.Type, claim => claim.Value as object)
@@ -48,12 +47,10 @@ try
else
throw new("The API Key Authorization configuration is not available in the app settings, even though the app is not in development or DiP mode and API Key Authorization is not disabled.");
// Created separately from AuthClientParams (added via options) for use in Jwt Bearer configuration
var authPublicKey = config.GetSection("AuthPublicKey").Get<ClientPublicKey>() ?? throw new InvalidOperationException("The AuthPublicKey configuration is missing or invalid.");
builder.Services.AddAuthHubClient(config, opt =>
{
opt.PublicKeys.Add(authPublicKey);
});
builder.Services.AddAuthHubClient(config.GetSection("AuthClientParams"), opt => opt.PublicKeys.Add(authPublicKey));
builder.Services.AddControllers();
@@ -66,7 +63,11 @@ try
IssuerSigningKeyResolver = (token, securityToken, identifier, parameters) =>
{
return [authPublicKey.SecurityKey];
}
},
ValidateIssuer = true,
ValidIssuer = authPublicKey.Issuer,
ValidateAudience = true,
ValidAudience = authPublicKey.Audience
};
});

View File

@@ -12,8 +12,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Auth.Client" Version="1.1.4.1" />
<PackageReference Include="DigitalData.Core.API" Version="2.0.0" />
<PackageReference Include="DigitalData.Auth.Client" Version="1.1.5" />
<PackageReference Include="DigitalData.Core.API" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.13" />
<PackageReference Include="NLog" Version="5.3.4" />
<PackageReference Include="NLog.Web.AspNetCore" Version="5.3.14" />

View File

@@ -11,8 +11,8 @@
"NLog": {
"throwConfigExceptions": true,
"variables": {
"logDirectory": "E:\\LogFiles\\Digital Data\\workFlow",
"logFileNamePrefix": "${shortdate}-ECM.EnvelopeGenerator.Web"
"logDirectory": "E:\\LogFiles\\Digital Data\\workFlow.API",
"logFileNamePrefix": "${shortdate}-workFlow.API"
},
"targets": {
"infoLogs": {
@@ -78,7 +78,8 @@
}
},
"AuthClientParams": {
"Url": "https://localhost:7192"
"Url": "https://localhost:7192",
"PublicKeys": []
},
"AuthPublicKey": {
"Issuer": "auth.digitaldata.works",

View File

@@ -4,7 +4,7 @@ using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IConfigService : ICRUDService<ConfigCreateDto, ConfigDto, ConfigUpdateDto, Config, int>
public interface IConfigService : ICRUDService<ConfigCreateDto, ConfigDto, Config, int>
{
}
}

View File

@@ -5,7 +5,7 @@ using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IProfileControlsTFService : ICRUDService<ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTFUpdateDto, ProfileControlsTF, int>
public interface IProfileControlsTFService : ICRUDService<ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTF, int>
{
Task<DataResult<IEnumerable<ProfileControlsTFDto>>> ReadAsync(
bool withProfile = true, bool withUser = false,

View File

@@ -5,7 +5,7 @@ using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IProfileObjStateService : ICRUDService<ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjStateUpdateDto, ProfileObjState, int>
public interface IProfileObjStateService : ICRUDService<ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjState, int>
{
Task<DataResult<IEnumerable<ProfileObjStateDto>>> ReadAsync(
bool withProfile = true, bool withUser = true, bool withState = true,

View File

@@ -4,7 +4,7 @@ using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IProfileService : ICRUDService<ProfileCreateDto, ProfileDto, ProfileUpdateDto, Profile, int>
public interface IProfileService : ICRUDService<ProfileCreateDto, ProfileDto, Profile, int>
{
}
}

View File

@@ -4,7 +4,7 @@ using WorkFlow.Domain.Entities;
namespace WorkFlow.Application.Contracts
{
public interface IStateService : ICRUDService<StateCreateDto, StateDto, StateUpdateDto, State, int>
public interface IStateService : ICRUDService<StateCreateDto, StateDto, State, int>
{
}
}

View File

@@ -9,8 +9,8 @@ using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class ConfigService(IConfigRepository repository, IMapper mapper)
: CRUDService<IConfigRepository, ConfigCreateDto, ConfigDto, ConfigUpdateDto, Config, int>(repository, mapper),
IConfigService, ICRUDService<ConfigCreateDto, ConfigDto, ConfigUpdateDto, Config, int>
: CRUDService<IConfigRepository, ConfigCreateDto, ConfigDto, Config, int>(repository, mapper),
IConfigService, ICRUDService<ConfigCreateDto, ConfigDto, Config, int>
{
}
}

View File

@@ -10,8 +10,8 @@ using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class ProfileControlsTFService(IProfileControlsTFRepository repository, IMapper mapper)
: CRUDService<IProfileControlsTFRepository, ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTFUpdateDto, ProfileControlsTF, int>(repository, mapper),
IProfileControlsTFService, ICRUDService<ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTFUpdateDto, ProfileControlsTF, int>
: CRUDService<IProfileControlsTFRepository, ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTF, int>(repository, mapper),
IProfileControlsTFService, ICRUDService<ProfileControlsTFCreateDto, ProfileControlsTFDto, ProfileControlsTF, int>
{
public async Task<DataResult<IEnumerable<ProfileControlsTFDto>>> ReadAsync(
bool withProfile = true, bool withUser = false,

View File

@@ -10,8 +10,8 @@ using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class ProfileObjStateService(IProfileObjStateRepository repository, IMapper mapper)
: CRUDService<IProfileObjStateRepository, ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjStateUpdateDto, ProfileObjState, int>(repository, mapper),
IProfileObjStateService, ICRUDService<ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjStateUpdateDto, ProfileObjState, int>
: CRUDService<IProfileObjStateRepository, ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjState, int>(repository, mapper),
IProfileObjStateService, ICRUDService<ProfileObjStateCreateDto, ProfileObjStateDto, ProfileObjState, int>
{
public async Task<DataResult<IEnumerable<ProfileObjStateDto>>> ReadAsync(
bool withProfile = true, bool withUser = true, bool withState = true,

View File

@@ -8,8 +8,8 @@ using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class ProfileService(IProfileRepository repository, AutoMapper.IMapper mapper)
: CRUDService<IProfileRepository, ProfileCreateDto, ProfileDto, ProfileUpdateDto, Profile, int>(repository, mapper),
IProfileService, ICRUDService<ProfileCreateDto, ProfileDto, ProfileUpdateDto, Profile, int>
: CRUDService<IProfileRepository, ProfileCreateDto, ProfileDto, Profile, int>(repository, mapper),
IProfileService, ICRUDService<ProfileCreateDto, ProfileDto, Profile, int>
{
}
}

View File

@@ -9,8 +9,8 @@ using WorkFlow.Infrastructure.Contracts;
namespace WorkFlow.Application.Services
{
public class StateService(IStateRepository repository, IMapper mapper)
: CRUDService<IStateRepository, StateCreateDto, StateDto, StateUpdateDto, State, int>(repository, mapper),
IStateService, ICRUDService<StateCreateDto, StateDto, StateUpdateDto, State, int>
: CRUDService<IStateRepository, StateCreateDto, StateDto, State, int>(repository, mapper),
IStateService, ICRUDService<StateCreateDto, StateDto, State, int>
{
}
}

View File

@@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DigitalData.Core.Application" Version="2.0.0" />
<PackageReference Include="UserManager.Application" Version="2.0.0" />
<PackageReference Include="DigitalData.Core.Application" Version="3.2.0" />
<PackageReference Include="UserManager.Application" Version="3.1.2" />
</ItemGroup>
<ItemGroup>

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="UserManager.Domain" Version="2.0.0" />
<PackageReference Include="UserManager.Domain" Version="3.0.1" />
</ItemGroup>
</Project>

View File

@@ -30,6 +30,8 @@ namespace WorkFlow.Infrastructure
public DbSet<UserRep> UserReps { get; set; }
public DbSet<ClientUser> ClientUsers { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
//configure model builder for user manager tables

View File

@@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="DigitalData.Core.Infrastructure" Version="2.0.0" />
<PackageReference Include="UserManager.Infrastructure" Version="2.0.0" />
<PackageReference Include="UserManager.Infrastructure" Version="3.0.1" />
</ItemGroup>
<ItemGroup>