Tuitio packages update

master
Tudor Stanciu 2023-02-04 11:14:21 +02:00
parent e3ca8df153
commit 359dc5dad1
14 changed files with 30 additions and 24 deletions

View File

@ -1,7 +1,7 @@
<Project>
<Import Project="dependencies.props" />
<PropertyGroup>
<Version>1.1.1</Version>
<Version>1.1.2</Version>
<Authors>Tudor Stanciu</Authors>
<Company>STA</Company>
<PackageTags>NetworkResurrector</PackageTags>

View File

@ -17,7 +17,7 @@
<Version>1.0.2</Version>
<Content>
Replaced Swagger and MediatR implementations with inhouse nuget packages.
Integration with local Identity Server.
Integration with Tuitio.
</Content>
</Note>
<Note>
@ -50,7 +50,7 @@
• Added README.md file
</Content>
</Note>
<Note>
<Note>
<Version>1.1.1</Version>
<Content>
Retouches after the last upgrade
@ -58,4 +58,12 @@
• Small fixes
</Content>
</Note>
<Note>
<Version>1.1.2</Version>
<Content>
Tuitio latest updates
• Tuitio nuget packages upgrade
• Tuitio configuration changes
</Content>
</Note>
</ReleaseNotes>

View File

@ -10,8 +10,8 @@
<MediatRPackageVersion>9.0.0</MediatRPackageVersion>
<NBBPackageVersion>6.0.30</NBBPackageVersion>
<EntityFrameworkCorePackageVersion>6.0.1</EntityFrameworkCorePackageVersion>
<NetmashExtensionsSwaggerPackageVersion>1.0.6</NetmashExtensionsSwaggerPackageVersion>
<NetmashSecurityAuthenticationPackageVersion>1.0.8</NetmashSecurityAuthenticationPackageVersion>
<NetmashExtensionsSwaggerPackageVersion>1.0.7</NetmashExtensionsSwaggerPackageVersion>
<NetmashTuitioAuthenticationPackageVersion>2.0.0</NetmashTuitioAuthenticationPackageVersion>
<NetmashDatabaseMigrationPackageVersion>1.2.0</NetmashDatabaseMigrationPackageVersion>
<CorreoPublishedLanguage>1.0.1</CorreoPublishedLanguage>
</PropertyGroup>

View File

@ -5,7 +5,7 @@ using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Netmash.Extensions.Swagger;
using Netmash.Extensions.Swagger.Constants;
using Netmash.Security.Authentication.Identity;
using Netmash.Security.Authentication.Tuitio;
using NetworkResurrector.Agent.Application;
using System.Reflection;
@ -18,7 +18,7 @@ namespace NetworkResurrector.Agent.Extensions
services.AddControllers();
// Add basic authentication
services.AddIdentityAuthentication(configuration.GetSection("IdentityServer")["BaseAddress"]);
services.AddTuitioAuthentication(configuration.GetSection("Tuitio")["BaseAddress"]);
// MediatR
services.AddMediatR(GetMediatRAssemblies());
@ -30,7 +30,7 @@ namespace NetworkResurrector.Agent.Extensions
// Swagger
var agentCode = configuration.GetValue<string>("Agent:Code");
services.AddSwagger($"NetworkResurrectorAgent {agentCode}", AuthorizationType.InhouseIdentity);
services.AddSwagger($"NetworkResurrectorAgent {agentCode}", AuthorizationType.Tuitio);
// Data access
// services.AddDataAccess();

View File

@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageReference Include="Netmash.Extensions.Swagger" Version="$(NetmashExtensionsSwaggerPackageVersion)" />
<PackageReference Include="Netmash.Security.Authentication.Identity" Version="$(NetmashSecurityAuthenticationPackageVersion)" />
<PackageReference Include="Netmash.Security.Authentication.Tuitio" Version="$(NetmashTuitioAuthenticationPackageVersion)" />
<PackageReference Include="Serilog.AspNetCore" Version="$(SerilogPackageVersion)" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="$(SerilogSinksMSSqlServerPackageVersion)" />
<PackageReference Include="Serilog.Sinks.Seq" Version="$(SerilogSinksSeqPackageVersion)" />

View File

@ -26,7 +26,7 @@
"Agent": {
"Code": "DEV_AGENT"
},
"IdentityServer": {
"Tuitio": {
"BaseAddress": "http://<host>:<port>/api/"
},
"Restrictions": {

View File

@ -5,7 +5,7 @@ using NetworkResurrector.Api.Application.Queries;
using System;
using System.Threading.Tasks;
namespace IdentityServer.Api.Controllers
namespace NetworkResurrector.Api.Controllers
{
[Authorize]
[ApiController]

View File

@ -7,7 +7,7 @@ using Netmash.Extensions.Swagger;
using Netmash.Extensions.Swagger.Constants;
using Netmash.Infrastructure.DatabaseMigration;
using Netmash.Infrastructure.DatabaseMigration.Constants;
using Netmash.Security.Authentication.Identity;
using Netmash.Security.Authentication.Tuitio;
using NetworkResurrector.Agent.Wrapper;
using NetworkResurrector.Api.Application;
using NetworkResurrector.Api.Domain.Abstractions;
@ -26,7 +26,7 @@ namespace NetworkResurrector.Api.Extensions
.AddNewtonsoftJson(o => o.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc);
// Add basic authentication
services.AddIdentityAuthentication(configuration.GetSection("IdentityServer")["BaseAddress"]);
services.AddTuitioAuthentication(configuration.GetSection("Tuitio")["BaseAddress"]);
services.AddHttpContextAccessor();
services.AddScoped<IUserService, UserService>();
@ -40,7 +40,7 @@ namespace NetworkResurrector.Api.Extensions
services.AddAutoMapper(typeof(Application.Mappings.MappingProfile).Assembly);
// Swagger
services.AddSwagger("NetworkResurrector API", AuthorizationType.InhouseIdentity);
services.AddSwagger("NetworkResurrector API", AuthorizationType.Tuitio);
// Add network resurrector server services
services.UseResurrectorServices(configuration.GetSection("NetworkResurrectorServer")["BaseAddress"]);

View File

@ -14,7 +14,7 @@
<PackageReference Include="NBB.Messaging.Nats" Version="$(NBBPackageVersion)" />
<PackageReference Include="Netmash.Extensions.Swagger" Version="$(NetmashExtensionsSwaggerPackageVersion)" />
<PackageReference Include="Netmash.Infrastructure.DatabaseMigration" Version="$(NetmashDatabaseMigrationPackageVersion)" />
<PackageReference Include="Netmash.Security.Authentication.Identity" Version="$(NetmashSecurityAuthenticationPackageVersion)" />
<PackageReference Include="Netmash.Security.Authentication.Tuitio" Version="$(NetmashTuitioAuthenticationPackageVersion)" />
<PackageReference Include="Serilog.AspNetCore" Version="$(SerilogPackageVersion)" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="$(SerilogSinksMSSqlServerPackageVersion)" />
<PackageReference Include="Serilog.Sinks.Seq" Version="$(SerilogSinksSeqPackageVersion)" />

View File

@ -39,7 +39,7 @@ namespace NetworkResurrector.Api.Services
public bool UserIsGuest()
{
var userIsGuest = _httpAccessor.HttpContext.User?.Claims.FirstOrDefault(z => z.Type == Netmash.Security.Authentication.Identity.Constants.ClaimTypes.IsGuestUser)?.Value;
var userIsGuest = _httpAccessor.HttpContext.User?.Claims.FirstOrDefault(z => z.Type == Netmash.Security.Authentication.Tuitio.Constants.ClaimTypes.IsGuestUser)?.Value;
return !string.IsNullOrEmpty(userIsGuest) && bool.TrueString == userIsGuest;
}
}

View File

@ -26,7 +26,7 @@
"Service": {
"Code": "NETWORK_RESURRECTOR_API"
},
"IdentityServer": {
"Tuitio": {
"BaseAddress": "http://<host>:<port>/api/"
},
"NetworkResurrectorServer": {

View File

@ -1,13 +1,11 @@
using MediatR;
using MediatR.Pipeline;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Netmash.Extensions.Swagger;
using Netmash.Extensions.Swagger.Constants;
using Netmash.Security.Authentication.Identity;
using Netmash.Security.Authentication.Tuitio;
using NetworkResurrector.Server.Application;
using Newtonsoft.Json;
using System.Reflection;
@ -22,7 +20,7 @@ namespace NetworkResurrector.Server.Extensions
.AddNewtonsoftJson(o => o.SerializerSettings.DateTimeZoneHandling = DateTimeZoneHandling.Utc);
// Add basic authentication
services.AddIdentityAuthentication(configuration.GetSection("IdentityServer")["BaseAddress"]);
services.AddTuitioAuthentication(configuration.GetSection("Tuitio")["BaseAddress"]);
services.AddHttpContextAccessor();
@ -36,7 +34,7 @@ namespace NetworkResurrector.Server.Extensions
typeof(Application.Mappings.MappingProfile).Assembly);
// Swagger
services.AddSwagger("NetworkResurrector Server API", AuthorizationType.InhouseIdentity);
services.AddSwagger("NetworkResurrector Server API", AuthorizationType.Tuitio);
// Application
services.AddApplicationServices();

View File

@ -11,7 +11,7 @@
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="$(MicrosoftExtensionsPackageVersion)" />
<PackageReference Include="Netmash.Extensions.Swagger" Version="$(NetmashExtensionsSwaggerPackageVersion)" />
<PackageReference Include="Netmash.Security.Authentication.Identity" Version="$(NetmashSecurityAuthenticationPackageVersion)" />
<PackageReference Include="Netmash.Security.Authentication.Tuitio" Version="$(NetmashTuitioAuthenticationPackageVersion)" />
<PackageReference Include="Serilog.AspNetCore" Version="$(SerilogPackageVersion)" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="$(SerilogSinksMSSqlServerPackageVersion)" />
<PackageReference Include="Serilog.Sinks.Seq" Version="$(SerilogSinksSeqPackageVersion)" />

View File

@ -23,7 +23,7 @@
}
},
"AllowedHosts": "*",
"IdentityServer": {
"Tuitio": {
"BaseAddress": "http://<host>:<port>/api/"
},
"WakeOnLan": {