From f577d77f4ba42456976d07e2aaf0431698359006 Mon Sep 17 00:00:00 2001 From: Phong Nguyen Date: Fri, 17 Jan 2025 10:05:16 +0700 Subject: [PATCH] (#263) Upgrade .Net 9 --- .../workflows/.net-build-microservices.yml | 2 +- .github/workflows/.net-build-monolith.yml | 2 +- .../ClassifiedAds.AspireAppHost.csproj | 2 +- .../ClassifiedAds.Application.csproj | 6 +- .../ClassifiedAds.CrossCuttingConcerns.csproj | 4 +- .../ClassifiedAds.Domain.csproj | 5 +- .../ClassifiedAds.Infrastructure.csproj | 92 ++++++++--------- .../RabbitMQ/RabbitMQHealthCheck.cs | 10 +- .../RabbitMQ/RabbitMQReceiver.cs | 58 +++++------ .../MessageBrokers/RabbitMQ/RabbitMQSender.cs | 51 +++++----- .../ClassifiedAds.Gateways.GraphQL.csproj | 2 +- .../ClassifiedAds.Gateways.WebAPI.csproj | 8 +- .../ClassifiedAds.Gateways.WebAPI/Dockerfile | 4 +- ...ClassifiedAds.Services.AuditLog.Api.csproj | 8 +- .../Dockerfile | 4 +- .../Certs/CreateSelfSignedCertificate.ps1 | 6 -- .../Certs/classifiedads.grpc.pfx | Bin 2677 -> 0 bytes ...lassifiedAds.Services.AuditLog.Grpc.csproj | 10 +- .../Dockerfile | 4 +- .../appsettings.json | 6 -- .../ClassifiedAds.Services.AuditLog.csproj | 12 +-- ...ifiedAds.Services.Configuration.Api.csproj | 18 ++-- .../Dockerfile | 4 +- .../appsettings.json | 3 +- ...ClassifiedAds.Services.Identity.Api.csproj | 6 +- .../Dockerfile | 4 +- .../Certs/CreateSelfSignedCertificate.ps1 | 6 -- .../Certs/classifiedads.grpc.pfx | Bin 2677 -> 0 bytes ...lassifiedAds.Services.Identity.Grpc.csproj | 10 +- .../Dockerfile | 4 +- .../appsettings.json | 6 -- ....Services.Identity.IntegrationTests.csproj | 12 +-- .../ClassifiedAds.Services.Identity.csproj | 16 +-- ...sifiedAds.Services.Notification.Api.csproj | 6 +- .../Dockerfile | 4 +- ...ds.Services.Notification.Background.csproj | 6 +- .../Dockerfile | 4 +- .../Certs/CreateSelfSignedCertificate.ps1 | 6 -- .../Certs/classifiedads.grpc.pfx | Bin 2677 -> 0 bytes ...ifiedAds.Services.Notification.Grpc.csproj | 10 +- .../Dockerfile | 4 +- .../appsettings.json | 6 -- ...ClassifiedAds.Services.Notification.csproj | 10 +- .../ClassifiedAds.Services.Product.Api.csproj | 22 ++-- .../Dockerfile | 4 +- .../ClassifiedAds.Services.Storage.Api.csproj | 16 +-- .../Dockerfile | 4 +- .../ClassifiedAds.Application.csproj | 6 +- .../ClassifiedAds.ArchTests.csproj | 10 +- .../ClassifiedAds.AspireAppHost.csproj | 2 +- .../ClassifiedAds.Background.csproj | 6 +- .../ClassifiedAds.Background/Dockerfile | 4 +- .../ClassifiedAds.Blazor.Modules.csproj | 14 +-- .../ClassifiedAds.BlazorServerSide.csproj | 14 +-- .../ClassifiedAds.BlazorServerSide/Dockerfile | 4 +- .../ClassifiedAds.BlazorWebAssembly.csproj | 10 +- .../ClassifiedAds.ContractTests.csproj | 12 +-- .../ClassifiedAds.CrossCuttingConcerns.csproj | 4 +- .../ClassifiedAds.Domain.csproj | 5 +- .../ClassifiedAds.EndToEndTests.csproj | 16 +-- .../ClassifiedAds.Infrastructure.csproj | 94 +++++++++--------- .../RabbitMQ/RabbitMQHealthCheck.cs | 10 +- .../RabbitMQ/RabbitMQReceiver.cs | 58 +++++------ .../MessageBrokers/RabbitMQ/RabbitMQSender.cs | 51 +++++----- .../ClassifiedAds.IntegrationTests.csproj | 24 ++--- .../ClassifiedAds.Migrator.csproj | 8 +- .../ClassifiedAds.Migrator/Dockerfile | 4 +- .../ClassifiedAds.Persistence.csproj | 12 +-- .../ClassifiedAds.UnitTests.csproj | 14 +-- .../ClassifiedAds.WebAPI.csproj | 8 +- src/Monolith/ClassifiedAds.WebAPI/Dockerfile | 4 +- .../ClassifiedAds.WebAPI/appsettings.json | 3 +- .../ClassifiedAds.WebMVC.csproj | 20 ++-- src/Monolith/ClassifiedAds.WebMVC/Dockerfile | 4 +- 74 files changed, 423 insertions(+), 485 deletions(-) delete mode 100644 src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Certs/CreateSelfSignedCertificate.ps1 delete mode 100644 src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Certs/classifiedads.grpc.pfx delete mode 100644 src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Certs/CreateSelfSignedCertificate.ps1 delete mode 100644 src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Certs/classifiedads.grpc.pfx delete mode 100644 src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Certs/CreateSelfSignedCertificate.ps1 delete mode 100644 src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Certs/classifiedads.grpc.pfx diff --git a/.github/workflows/.net-build-microservices.yml b/.github/workflows/.net-build-microservices.yml index afe5d6741..960814d66 100644 --- a/.github/workflows/.net-build-microservices.yml +++ b/.github/workflows/.net-build-microservices.yml @@ -22,7 +22,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 8.0.100 + dotnet-version: 9.0.102 - name: Build run: dotnet build --configuration Release diff --git a/.github/workflows/.net-build-monolith.yml b/.github/workflows/.net-build-monolith.yml index 64ed0fe1b..9800dd704 100644 --- a/.github/workflows/.net-build-monolith.yml +++ b/.github/workflows/.net-build-monolith.yml @@ -22,7 +22,7 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v1 with: - dotnet-version: 8.0.100 + dotnet-version: 9.0.102 - name: Build diff --git a/src/Microservices/AspireAppHost/ClassifiedAds.AspireAppHost.csproj b/src/Microservices/AspireAppHost/ClassifiedAds.AspireAppHost.csproj index 25c662834..27abbcd50 100644 --- a/src/Microservices/AspireAppHost/ClassifiedAds.AspireAppHost.csproj +++ b/src/Microservices/AspireAppHost/ClassifiedAds.AspireAppHost.csproj @@ -4,7 +4,7 @@ Exe - net8.0 + net9.0 enable enable true diff --git a/src/Microservices/Common/ClassifiedAds.Application/ClassifiedAds.Application.csproj b/src/Microservices/Common/ClassifiedAds.Application/ClassifiedAds.Application.csproj index a4db53708..ca1f84252 100644 --- a/src/Microservices/Common/ClassifiedAds.Application/ClassifiedAds.Application.csproj +++ b/src/Microservices/Common/ClassifiedAds.Application/ClassifiedAds.Application.csproj @@ -1,12 +1,12 @@ - net8.0 + net9.0 - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Common/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj b/src/Microservices/Common/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj index 881ce0e4c..f6d8203f8 100644 --- a/src/Microservices/Common/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj +++ b/src/Microservices/Common/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 ClassifiedAds.CrossCuttingConcerns @@ -10,7 +10,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Common/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj b/src/Microservices/Common/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj index 03c316641..a96515b13 100644 --- a/src/Microservices/Common/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj +++ b/src/Microservices/Common/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj @@ -1,18 +1,17 @@  - net8.0 + net9.0 - + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/Microservices/Common/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj b/src/Microservices/Common/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj index 61dd91f5d..dadcc865b 100644 --- a/src/Microservices/Common/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj +++ b/src/Microservices/Common/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj @@ -1,68 +1,70 @@  - net8.0 + net9.0 ClassifiedAds.Infrastructure - + - - - - - - - + + + + + + + - - - - + + + + - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQHealthCheck.cs b/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQHealthCheck.cs index ff7be2abd..c14208e91 100644 --- a/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQHealthCheck.cs +++ b/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQHealthCheck.cs @@ -15,7 +15,7 @@ public RabbitMQHealthCheck(RabbitMQHealthCheckOptions options) _options = options; } - public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) + public async Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) { try { @@ -26,14 +26,14 @@ public Task CheckHealthAsync(HealthCheckContext context, Canc Password = _options.Password, }; - using var connection = connectionFactory.CreateConnection(); - using var model = connection.CreateModel(); + using var connection = await connectionFactory.CreateConnectionAsync(cancellationToken); + using var channel = await connection.CreateChannelAsync(cancellationToken: cancellationToken); - return Task.FromResult(HealthCheckResult.Healthy($"HostName: {_options.HostName}")); + return HealthCheckResult.Healthy($"HostName: {_options.HostName}"); } catch (Exception exception) { - return Task.FromResult(new HealthCheckResult(context.Registration.FailureStatus, null, exception)); + return new HealthCheckResult(context.Registration.FailureStatus, null, exception); } } } diff --git a/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQReceiver.cs b/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQReceiver.cs index bc5447465..7e0ae797c 100644 --- a/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQReceiver.cs +++ b/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQReceiver.cs @@ -16,36 +16,34 @@ namespace ClassifiedAds.Infrastructure.MessageBrokers.RabbitMQ; public class RabbitMQReceiver : IMessageReceiver, IDisposable { private readonly RabbitMQReceiverOptions _options; - private readonly IConnection _connection; - private IModel _channel; - private string _queueName; + private IConnection _connection; + private IChannel _channel; public RabbitMQReceiver(RabbitMQReceiverOptions options) { _options = options; - - _connection = new ConnectionFactory - { - HostName = options.HostName, - UserName = options.UserName, - Password = options.Password, - AutomaticRecoveryEnabled = true, - DispatchConsumersAsync = true - }.CreateConnection(); - - _queueName = options.QueueName; - - _connection.ConnectionShutdown += Connection_ConnectionShutdown; } - private void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e) + private Task Connection_ConnectionShutdownAsync(object sender, ShutdownEventArgs e) { // TODO: add log here + + return Task.CompletedTask; } - public Task ReceiveAsync(Func action, CancellationToken cancellationToken = default) + public async Task ReceiveAsync(Func action, CancellationToken cancellationToken = default) { - _channel = _connection.CreateModel(); + _connection = await new ConnectionFactory + { + HostName = _options.HostName, + UserName = _options.UserName, + Password = _options.Password, + AutomaticRecoveryEnabled = true, + }.CreateConnectionAsync(cancellationToken); + + _connection.ConnectionShutdownAsync += Connection_ConnectionShutdownAsync; + + _channel = await _connection.CreateChannelAsync(cancellationToken: cancellationToken); if (_options.AutomaticCreateEnabled) { @@ -79,21 +77,21 @@ public Task ReceiveAsync(Func action, CancellationToken cance if (_options.DeadLetter.AutomaticCreateEnabled && !string.IsNullOrEmpty(_options.DeadLetter.QueueName)) { - _channel.QueueDeclare(_options.DeadLetter.QueueName, true, false, false, null); - _channel.QueueBind(_options.DeadLetter.QueueName, _options.DeadLetter.ExchangeName, _options.DeadLetter.RoutingKey, null); + await _channel.QueueDeclareAsync(_options.DeadLetter.QueueName, true, false, false, null, cancellationToken: cancellationToken); + await _channel.QueueBindAsync(_options.DeadLetter.QueueName, _options.DeadLetter.ExchangeName, _options.DeadLetter.RoutingKey, null, cancellationToken: cancellationToken); } } arguments = arguments.Count == 0 ? null : arguments; - _channel.QueueDeclare(_options.QueueName, true, false, false, arguments); - _channel.QueueBind(_options.QueueName, _options.ExchangeName, _options.RoutingKey, null); + await _channel.QueueDeclareAsync(_options.QueueName, true, false, false, arguments, cancellationToken: cancellationToken); + await _channel.QueueBindAsync(_options.QueueName, _options.ExchangeName, _options.RoutingKey, null, cancellationToken: cancellationToken); } - _channel.BasicQos(prefetchSize: 0, prefetchCount: 1, global: false); + await _channel.BasicQosAsync(prefetchSize: 0, prefetchCount: 1, global: false, cancellationToken: cancellationToken); var consumer = new AsyncEventingBasicConsumer(_channel); - consumer.Received += async (model, ea) => + consumer.ReceivedAsync += async (model, ea) => { try { @@ -122,21 +120,17 @@ public Task ReceiveAsync(Func action, CancellationToken cance await action(message.Data, message.MetaData); - _channel.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false); + await _channel.BasicAckAsync(deliveryTag: ea.DeliveryTag, multiple: false); } catch (Exception ex) { // TODO: log here await Task.Delay(1000); - _channel.BasicNack(deliveryTag: ea.DeliveryTag, multiple: false, requeue: _options.RequeueOnFailure); + await _channel.BasicNackAsync(deliveryTag: ea.DeliveryTag, multiple: false, requeue: _options.RequeueOnFailure); } }; - _channel.BasicConsume(queue: _queueName, - autoAck: false, - consumer: consumer); - - return Task.CompletedTask; + await _channel.BasicConsumeAsync(queue: _options.QueueName, autoAck: false, consumer: consumer, cancellationToken: cancellationToken); } public void Dispose() diff --git a/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQSender.cs b/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQSender.cs index 8dafa4a86..5c48ca708 100644 --- a/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQSender.cs +++ b/src/Microservices/Common/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQSender.cs @@ -11,7 +11,7 @@ namespace ClassifiedAds.Infrastructure.MessageBrokers.RabbitMQ; public class RabbitMQSender : IMessageSender { private readonly RabbitMQSenderOptions _options; - private readonly IConnectionFactory _connectionFactory; + private readonly ConnectionFactory _connectionFactory; private readonly string _exchangeName; private readonly string _routingKey; @@ -32,33 +32,34 @@ public RabbitMQSender(RabbitMQSenderOptions options) public async Task SendAsync(T message, MetaData metaData = null, CancellationToken cancellationToken = default) { - await Task.Run(() => + using var connection = await _connectionFactory.CreateConnectionAsync(cancellationToken); + using var channel = await connection.CreateChannelAsync(cancellationToken: cancellationToken); + var body = new Message { - using var connection = _connectionFactory.CreateConnection(); - using var channel = connection.CreateModel(); - var body = new Message - { - Data = message, - MetaData = metaData, - }.GetBytes(); + Data = message, + MetaData = metaData, + }.GetBytes(); - if (_options.MessageEncryptionEnabled) - { - var iv = SymmetricCrypto.GenerateKey(16); - body = (iv.ToBase64String() + "." + body.UseAES(_options.MessageEncryptionKey.FromBase64String()) - .WithCipher(CipherMode.CBC) - .WithIV(iv) - .WithPadding(PaddingMode.PKCS7) - .Encrypt().ToBase64String()).GetBytes(); - } + if (_options.MessageEncryptionEnabled) + { + var iv = SymmetricCrypto.GenerateKey(16); + body = (iv.ToBase64String() + "." + body.UseAES(_options.MessageEncryptionKey.FromBase64String()) + .WithCipher(CipherMode.CBC) + .WithIV(iv) + .WithPadding(PaddingMode.PKCS7) + .Encrypt().ToBase64String()).GetBytes(); + } - var properties = channel.CreateBasicProperties(); - properties.Persistent = true; + var properties = new BasicProperties + { + Persistent = true + }; - channel.BasicPublish(exchange: _exchangeName, - routingKey: _routingKey, - basicProperties: properties, - body: body); - }, cancellationToken); + await channel.BasicPublishAsync(exchange: _exchangeName, + routingKey: _routingKey, + mandatory: true, + basicProperties: properties, + body: body, + cancellationToken: cancellationToken); } } diff --git a/src/Microservices/Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL.csproj b/src/Microservices/Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL.csproj index a866af01f..a018417aa 100644 --- a/src/Microservices/Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL.csproj +++ b/src/Microservices/Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL/ClassifiedAds.Gateways.GraphQL.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 diff --git a/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj b/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj index 64cffad1b..fd5e4ed38 100644 --- a/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj +++ b/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj @@ -1,14 +1,14 @@  - net8.0 + net9.0 4a8b7447-cb04-4631-8420-8ac41700e230 - - - + + + diff --git a/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile b/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile index 871f116d4..69b5d3c69 100644 --- a/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile +++ b/src/Microservices/Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -17,7 +17,7 @@ COPY . ./ RUN dotnet publish ./Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI/ClassifiedAds.Gateways.WebAPI.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj index 7a90ae94b..a86f413ea 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj @@ -1,13 +1,13 @@  - net8.0 + net9.0 c0d90214-b332-43c7-baa7-9a7ebf96ae71 - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/Dockerfile b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/Dockerfile index ed53ac37c..9152d931a 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/Dockerfile +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.AuditLog/ClassifiedAds.Services.AuditLog.Api/ClassifiedAds.Services.AuditLog.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Certs/CreateSelfSignedCertificate.ps1 b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Certs/CreateSelfSignedCertificate.ps1 deleted file mode 100644 index 61931cf7c..000000000 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Certs/CreateSelfSignedCertificate.ps1 +++ /dev/null @@ -1,6 +0,0 @@ -$date_now = Get-Date -$extended_date = $date_now.AddYears(3) -$cert = New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname classifiedads.grpc -notafter $extended_date -$pwd = ConvertTo-SecureString -String 'password1234' -Force -AsPlainText -$path = 'cert:\localMachine\my\' + $cert.thumbprint -Export-PfxCertificate -cert $path -FilePath classifiedads.grpc.pfx -Password $pwd \ No newline at end of file diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Certs/classifiedads.grpc.pfx b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Certs/classifiedads.grpc.pfx deleted file mode 100644 index 16792450e7ccd69956c5c548be3830afef7b0236..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2677 zcmZWqc{tQ-8~zz%Fm`3jl0DfPWh>aaaf@(mxRc~0`*x_U2 zWGf;;WxyopF%~TfBS8fIM}h!g62}3I#IehYO$g6lUA#~>P!S3I9Yz8(VNww2-!#jd zAI$ZiZ-ahJs!D*nnN)*Dge_ z$$rw{lcAw!W%a|Z8=v+bbk!v|LRUtcTp;C6^;{D&!zeJlvc_C4>-R17FS>i2Q0~5;a!fOcmq*9(302 zNkG|QH}U>2h1o3!v1kxkEvEVxu$4wkBs~tEixocOeWk9;#f1d~7+`8k}hzcR9smM+|pH-#gvl zT_j$t?QFtw@DLRA#yV$uKY)#LiD!&0z?c1yn zt%C6)u8#KGDvGWNX%6)+lp7~X+Ab+55>+3FPp4lm9YGC(PN7;$UncI?2EW%-n`EeWSA7ZWO5{wpXB>l6o{X0$yNGrddNH7=^rkzgpr`rnPMt`R zbsdo@wb^_GyHO5*lJj)@nP;Rm6(T^K4BJXnl{U=@NagE=?UhW|{?@@~(m>Kzt&gO; z<8OI1=gqv`J+{sZ9s%=Slw_=P?uu>mZW+`#&jmYx8X58XQrsn9( z$h^K(ioU_az(O9&2}!t-#00{6C)Pblw>X8CW8#tFd)2rVQDH2|G_dTjy042MVkfaD7;!sL7EU)) zuT~Dlu#L3F8K;}j-=`LZE>`y0?X_mnMkKF?e^kHis7N@wjtJjkH@`WapH6vn#%JPc zw27dzfm!MH28#C%RpMdCnK!+h&nz!)uD!b~&7mwySpdz-(La?imKMt5FaPB2e|AQ&Jn*c2 zD2&AZq`Q{$GXd|NntNFPsJMVs6i$|3CtXy{Tr)IF<5pUA@wf z2c@f8Oqs2Zxz$|RqRV@NE~K!2c;8vGD?sGhLSOS)vzE*}>=luvl9##8!5*nfeOsbZ zmS`9DbN-4+=&VIIZaV{W;D&sy2qnw;c$Go}?F-gu&6evRXX5ED%?f+h`w1s(fuYwA z-Qd_1pF<>i=)5)~u0?AfJg#7Vs0&QvIgC$~kC>QsvfNMAH4_bWGj8Iv32h!E2a^Vj zaqkE%Y@!Xa<^mMmU5vvigL*SGj~nEw^)--U+v7U8SyM`SlP*a!eAdK)u6%GXHcU+k zlFlo#7B|t0VYErpr{JAT#aQM~YV_BuIE zkv8T6dzt1uZTfmn`P15&MLRzb;XBdgb{NTN z^&e~5lqw?F@&5Ufx5qrvXq8(Z@BKaw@$>!^DmeAz+v)YmWHT-uG0E8LE;eJU$t8}p zsN&DxGP*vQ&zq~2{>Qgoez=eFI#83kZLE!KDVFBd+W6cu@<%~u(C7x>je2@9Ht4j= z`Ms_0XupZwyZ(N5wGIh&@?^rJOGmFXX6%!r&zroxOyJ>8;i^yffejR8YfpSa5IY1m zxdKyUeiV;PR=gV84ZNe>?BK0JF%M35 zEXik){Z;S1<_{iIMtM?ss~f(QY_aT}VRL`|7LNYNF5I=(MlaQHh%f`d&jO0t8*N52 z#X_EasFLPj?sxANaNlUYT=YO3qs6;f_0D*mV`Cn^&~IYfpOZe&R+F%2=}OiZ$}%m4 zjf9klNoeFi@XlQ8-1@^_Q2XM@U+$k}3uvfJlcu_=a2UOn7uH&Czvf8^oa99e0 z$|z%2msTF~pPP3?)T*yE;5e4uwbMb8|cKk(icugRM7O?M6bQu-ja58zseEeiIvu)^9dbR@J ziBjtlt28kS!m58_3A^nLG-~b!DWe-M*V*9fda_?DiJJF}h&UTpJvDT(ZFub6|aPb*@)iQTkM>w=`W - net8.0 + net9.0 c0d90214-b332-43c7-baa7-9a7ebf96ae71 @@ -10,7 +10,7 @@ - + @@ -20,11 +20,5 @@ - - - - Always - - diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Dockerfile b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Dockerfile index 2bdb46849..6e8588bea 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Dockerfile +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/ClassifiedAds.Services.AuditLog.Grpc.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/appsettings.json b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/appsettings.json index 90964b887..8035b2587 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/appsettings.json +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog.Grpc/appsettings.json @@ -46,12 +46,6 @@ "Kestrel": { "EndpointDefaults": { "Protocols": "Http2" - }, - "Certificates": { - "Default": { - "Path": "Certs/classifiedads.grpc.pfx", - "Password": "password1234" - } } }, "MessageBroker": { diff --git a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog/ClassifiedAds.Services.AuditLog.csproj b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog/ClassifiedAds.Services.AuditLog.csproj index 7dcaadba6..42a6d00d4 100644 --- a/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog/ClassifiedAds.Services.AuditLog.csproj +++ b/src/Microservices/Services.AuditLog/ClassifiedAds.Services.AuditLog/ClassifiedAds.Services.AuditLog.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable enable @@ -9,14 +9,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj index b8919c6b5..a96d650b1 100644 --- a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj +++ b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj @@ -1,26 +1,26 @@  - net8.0 + net9.0 - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/Dockerfile b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/Dockerfile index 5453e26e6..51991347c 100644 --- a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/Dockerfile +++ b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -17,7 +17,7 @@ COPY . ./ RUN dotnet publish ./Services.Configuration/ClassifiedAds.Services.Configuration.Api/ClassifiedAds.Services.Configuration.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/appsettings.json b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/appsettings.json index 76d3b9eeb..2491cc06f 100644 --- a/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/appsettings.json +++ b/src/Microservices/Services.Configuration/ClassifiedAds.Services.Configuration.Api/appsettings.json @@ -47,7 +47,8 @@ "SettingsEncryption": { "Thumbprint": null, "Path": "Certs/classifiedads.secretsencryption.pfx", - "Password": "password1234" + "Password": "password1234", + "X509KeyStorageFlags": "EphemeralKeySet" } }, "Services": { diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj index 258998a63..cc65b0504 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj @@ -1,13 +1,13 @@  - net8.0 + net9.0 37e169d5-ecb0-4b12-acf3-07a624b9c6c9 - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -15,7 +15,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/Dockerfile b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/Dockerfile index b88deaf8d..031d7f598 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/Dockerfile +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Identity/ClassifiedAds.Services.Identity.Api/ClassifiedAds.Services.Identity.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Certs/CreateSelfSignedCertificate.ps1 b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Certs/CreateSelfSignedCertificate.ps1 deleted file mode 100644 index 61931cf7c..000000000 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Certs/CreateSelfSignedCertificate.ps1 +++ /dev/null @@ -1,6 +0,0 @@ -$date_now = Get-Date -$extended_date = $date_now.AddYears(3) -$cert = New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname classifiedads.grpc -notafter $extended_date -$pwd = ConvertTo-SecureString -String 'password1234' -Force -AsPlainText -$path = 'cert:\localMachine\my\' + $cert.thumbprint -Export-PfxCertificate -cert $path -FilePath classifiedads.grpc.pfx -Password $pwd \ No newline at end of file diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Certs/classifiedads.grpc.pfx b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Certs/classifiedads.grpc.pfx deleted file mode 100644 index 16792450e7ccd69956c5c548be3830afef7b0236..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2677 zcmZWqc{tQ-8~zz%Fm`3jl0DfPWh>aaaf@(mxRc~0`*x_U2 zWGf;;WxyopF%~TfBS8fIM}h!g62}3I#IehYO$g6lUA#~>P!S3I9Yz8(VNww2-!#jd zAI$ZiZ-ahJs!D*nnN)*Dge_ z$$rw{lcAw!W%a|Z8=v+bbk!v|LRUtcTp;C6^;{D&!zeJlvc_C4>-R17FS>i2Q0~5;a!fOcmq*9(302 zNkG|QH}U>2h1o3!v1kxkEvEVxu$4wkBs~tEixocOeWk9;#f1d~7+`8k}hzcR9smM+|pH-#gvl zT_j$t?QFtw@DLRA#yV$uKY)#LiD!&0z?c1yn zt%C6)u8#KGDvGWNX%6)+lp7~X+Ab+55>+3FPp4lm9YGC(PN7;$UncI?2EW%-n`EeWSA7ZWO5{wpXB>l6o{X0$yNGrddNH7=^rkzgpr`rnPMt`R zbsdo@wb^_GyHO5*lJj)@nP;Rm6(T^K4BJXnl{U=@NagE=?UhW|{?@@~(m>Kzt&gO; z<8OI1=gqv`J+{sZ9s%=Slw_=P?uu>mZW+`#&jmYx8X58XQrsn9( z$h^K(ioU_az(O9&2}!t-#00{6C)Pblw>X8CW8#tFd)2rVQDH2|G_dTjy042MVkfaD7;!sL7EU)) zuT~Dlu#L3F8K;}j-=`LZE>`y0?X_mnMkKF?e^kHis7N@wjtJjkH@`WapH6vn#%JPc zw27dzfm!MH28#C%RpMdCnK!+h&nz!)uD!b~&7mwySpdz-(La?imKMt5FaPB2e|AQ&Jn*c2 zD2&AZq`Q{$GXd|NntNFPsJMVs6i$|3CtXy{Tr)IF<5pUA@wf z2c@f8Oqs2Zxz$|RqRV@NE~K!2c;8vGD?sGhLSOS)vzE*}>=luvl9##8!5*nfeOsbZ zmS`9DbN-4+=&VIIZaV{W;D&sy2qnw;c$Go}?F-gu&6evRXX5ED%?f+h`w1s(fuYwA z-Qd_1pF<>i=)5)~u0?AfJg#7Vs0&QvIgC$~kC>QsvfNMAH4_bWGj8Iv32h!E2a^Vj zaqkE%Y@!Xa<^mMmU5vvigL*SGj~nEw^)--U+v7U8SyM`SlP*a!eAdK)u6%GXHcU+k zlFlo#7B|t0VYErpr{JAT#aQM~YV_BuIE zkv8T6dzt1uZTfmn`P15&MLRzb;XBdgb{NTN z^&e~5lqw?F@&5Ufx5qrvXq8(Z@BKaw@$>!^DmeAz+v)YmWHT-uG0E8LE;eJU$t8}p zsN&DxGP*vQ&zq~2{>Qgoez=eFI#83kZLE!KDVFBd+W6cu@<%~u(C7x>je2@9Ht4j= z`Ms_0XupZwyZ(N5wGIh&@?^rJOGmFXX6%!r&zroxOyJ>8;i^yffejR8YfpSa5IY1m zxdKyUeiV;PR=gV84ZNe>?BK0JF%M35 zEXik){Z;S1<_{iIMtM?ss~f(QY_aT}VRL`|7LNYNF5I=(MlaQHh%f`d&jO0t8*N52 z#X_EasFLPj?sxANaNlUYT=YO3qs6;f_0D*mV`Cn^&~IYfpOZe&R+F%2=}OiZ$}%m4 zjf9klNoeFi@XlQ8-1@^_Q2XM@U+$k}3uvfJlcu_=a2UOn7uH&Czvf8^oa99e0 z$|z%2msTF~pPP3?)T*yE;5e4uwbMb8|cKk(icugRM7O?M6bQu-ja58zseEeiIvu)^9dbR@J ziBjtlt28kS!m58_3A^nLG-~b!DWe-M*V*9fda_?DiJJF}h&UTpJvDT(ZFub6|aPb*@)iQTkM>w=`W - net8.0 + net9.0 @@ -9,7 +9,7 @@ - + @@ -20,10 +20,4 @@ - - - Always - - - diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Dockerfile b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Dockerfile index 85ec6a5a3..06f522d16 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Dockerfile +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Identity/ClassifiedAds.Services.Identity.Grpc/ClassifiedAds.Services.Identity.Grpc.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/appsettings.json b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/appsettings.json index 87f947e90..90abdbd1b 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/appsettings.json +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.Grpc/appsettings.json @@ -46,12 +46,6 @@ "Kestrel": { "EndpointDefaults": { "Protocols": "Http2" - }, - "Certificates": { - "Default": { - "Path": "Certs/classifiedads.grpc.pfx", - "Password": "password1234" - } } }, "Services": { diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.IntegrationTests/ClassifiedAds.Services.Identity.IntegrationTests.csproj b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.IntegrationTests/ClassifiedAds.Services.Identity.IntegrationTests.csproj index 779d8c226..bb64983fc 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.IntegrationTests/ClassifiedAds.Services.Identity.IntegrationTests.csproj +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity.IntegrationTests/ClassifiedAds.Services.Identity.IntegrationTests.csproj @@ -1,23 +1,23 @@  - net8.0 + net9.0 false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity/ClassifiedAds.Services.Identity.csproj b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity/ClassifiedAds.Services.Identity.csproj index 4ffe0def8..d90653cf6 100644 --- a/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity/ClassifiedAds.Services.Identity.csproj +++ b/src/Microservices/Services.Identity/ClassifiedAds.Services.Identity/ClassifiedAds.Services.Identity.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 enable @@ -9,16 +9,16 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj index ce98561f0..f2a98e3fb 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj @@ -1,12 +1,12 @@  - net8.0 + net9.0 3bb18abd-09c2-44f2-900e-28cc944866e1 - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -14,7 +14,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/Dockerfile b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/Dockerfile index 605118cb3..eac2dd45f 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/Dockerfile +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Notification/ClassifiedAds.Services.Notification.Api/ClassifiedAds.Services.Notification.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj index f2247cc44..e6b96524b 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj @@ -1,13 +1,13 @@  - net8.0 + net9.0 3bb18abd-09c2-44f2-900e-28cc944866e1 - - + + diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/Dockerfile b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/Dockerfile index 78b225fb9..de6cf4486 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/Dockerfile +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Background/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Notification/ClassifiedAds.Services.Notification.Background/ClassifiedAds.Services.Notification.Background.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Certs/CreateSelfSignedCertificate.ps1 b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Certs/CreateSelfSignedCertificate.ps1 deleted file mode 100644 index 61931cf7c..000000000 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Certs/CreateSelfSignedCertificate.ps1 +++ /dev/null @@ -1,6 +0,0 @@ -$date_now = Get-Date -$extended_date = $date_now.AddYears(3) -$cert = New-SelfSignedCertificate -certstorelocation cert:\localmachine\my -dnsname classifiedads.grpc -notafter $extended_date -$pwd = ConvertTo-SecureString -String 'password1234' -Force -AsPlainText -$path = 'cert:\localMachine\my\' + $cert.thumbprint -Export-PfxCertificate -cert $path -FilePath classifiedads.grpc.pfx -Password $pwd \ No newline at end of file diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Certs/classifiedads.grpc.pfx b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Certs/classifiedads.grpc.pfx deleted file mode 100644 index 16792450e7ccd69956c5c548be3830afef7b0236..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2677 zcmZWqc{tQ-8~zz%Fm`3jl0DfPWh>aaaf@(mxRc~0`*x_U2 zWGf;;WxyopF%~TfBS8fIM}h!g62}3I#IehYO$g6lUA#~>P!S3I9Yz8(VNww2-!#jd zAI$ZiZ-ahJs!D*nnN)*Dge_ z$$rw{lcAw!W%a|Z8=v+bbk!v|LRUtcTp;C6^;{D&!zeJlvc_C4>-R17FS>i2Q0~5;a!fOcmq*9(302 zNkG|QH}U>2h1o3!v1kxkEvEVxu$4wkBs~tEixocOeWk9;#f1d~7+`8k}hzcR9smM+|pH-#gvl zT_j$t?QFtw@DLRA#yV$uKY)#LiD!&0z?c1yn zt%C6)u8#KGDvGWNX%6)+lp7~X+Ab+55>+3FPp4lm9YGC(PN7;$UncI?2EW%-n`EeWSA7ZWO5{wpXB>l6o{X0$yNGrddNH7=^rkzgpr`rnPMt`R zbsdo@wb^_GyHO5*lJj)@nP;Rm6(T^K4BJXnl{U=@NagE=?UhW|{?@@~(m>Kzt&gO; z<8OI1=gqv`J+{sZ9s%=Slw_=P?uu>mZW+`#&jmYx8X58XQrsn9( z$h^K(ioU_az(O9&2}!t-#00{6C)Pblw>X8CW8#tFd)2rVQDH2|G_dTjy042MVkfaD7;!sL7EU)) zuT~Dlu#L3F8K;}j-=`LZE>`y0?X_mnMkKF?e^kHis7N@wjtJjkH@`WapH6vn#%JPc zw27dzfm!MH28#C%RpMdCnK!+h&nz!)uD!b~&7mwySpdz-(La?imKMt5FaPB2e|AQ&Jn*c2 zD2&AZq`Q{$GXd|NntNFPsJMVs6i$|3CtXy{Tr)IF<5pUA@wf z2c@f8Oqs2Zxz$|RqRV@NE~K!2c;8vGD?sGhLSOS)vzE*}>=luvl9##8!5*nfeOsbZ zmS`9DbN-4+=&VIIZaV{W;D&sy2qnw;c$Go}?F-gu&6evRXX5ED%?f+h`w1s(fuYwA z-Qd_1pF<>i=)5)~u0?AfJg#7Vs0&QvIgC$~kC>QsvfNMAH4_bWGj8Iv32h!E2a^Vj zaqkE%Y@!Xa<^mMmU5vvigL*SGj~nEw^)--U+v7U8SyM`SlP*a!eAdK)u6%GXHcU+k zlFlo#7B|t0VYErpr{JAT#aQM~YV_BuIE zkv8T6dzt1uZTfmn`P15&MLRzb;XBdgb{NTN z^&e~5lqw?F@&5Ufx5qrvXq8(Z@BKaw@$>!^DmeAz+v)YmWHT-uG0E8LE;eJU$t8}p zsN&DxGP*vQ&zq~2{>Qgoez=eFI#83kZLE!KDVFBd+W6cu@<%~u(C7x>je2@9Ht4j= z`Ms_0XupZwyZ(N5wGIh&@?^rJOGmFXX6%!r&zroxOyJ>8;i^yffejR8YfpSa5IY1m zxdKyUeiV;PR=gV84ZNe>?BK0JF%M35 zEXik){Z;S1<_{iIMtM?ss~f(QY_aT}VRL`|7LNYNF5I=(MlaQHh%f`d&jO0t8*N52 z#X_EasFLPj?sxANaNlUYT=YO3qs6;f_0D*mV`Cn^&~IYfpOZe&R+F%2=}OiZ$}%m4 zjf9klNoeFi@XlQ8-1@^_Q2XM@U+$k}3uvfJlcu_=a2UOn7uH&Czvf8^oa99e0 z$|z%2msTF~pPP3?)T*yE;5e4uwbMb8|cKk(icugRM7O?M6bQu-ja58zseEeiIvu)^9dbR@J ziBjtlt28kS!m58_3A^nLG-~b!DWe-M*V*9fda_?DiJJF}h&UTpJvDT(ZFub6|aPb*@)iQTkM>w=`W - net8.0 + net9.0 3bb18abd-09c2-44f2-900e-28cc944866e1 @@ -11,7 +11,7 @@ - + @@ -21,11 +21,5 @@ - - - - Always - - diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Dockerfile b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Dockerfile index a39302196..a853893ce 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Dockerfile +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./Services.Notification/ClassifiedAds.Services.Notification.Grpc/ClassifiedAds.Services.Notification.Grpc.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/appsettings.json b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/appsettings.json index 67c7b2e43..c199fc2cb 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/appsettings.json +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification.Grpc/appsettings.json @@ -46,12 +46,6 @@ "Kestrel": { "EndpointDefaults": { "Protocols": "Http2" - }, - "Certificates": { - "Default": { - "Path": "Certs/classifiedads.grpc.pfx", - "Password": "password1234" - } } }, "Notification": { diff --git a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification/ClassifiedAds.Services.Notification.csproj b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification/ClassifiedAds.Services.Notification.csproj index 19f1f77f0..b0af5479d 100644 --- a/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification/ClassifiedAds.Services.Notification.csproj +++ b/src/Microservices/Services.Notification/ClassifiedAds.Services.Notification/ClassifiedAds.Services.Notification.csproj @@ -1,15 +1,15 @@  - net8.0 + net9.0 enable - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj index 950beb313..f9e54f722 100644 --- a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj +++ b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj @@ -1,34 +1,34 @@  - net8.0 + net9.0 0de8f61d-276a-4df2-a419-89d3cbb127ff - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/Dockerfile b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/Dockerfile index aff3daf0a..02d0fb160 100644 --- a/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/Dockerfile +++ b/src/Microservices/Services.Product/ClassifiedAds.Services.Product.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -17,7 +17,7 @@ COPY . ./ RUN dotnet publish ./Services.Product/ClassifiedAds.Services.Product.Api/ClassifiedAds.Services.Product.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj index eb7cec13a..b36a8ef25 100644 --- a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj +++ b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj @@ -1,30 +1,30 @@  - net8.0 + net9.0 f2e298d9-f756-4769-92a2-d920b7e1a422 - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/Dockerfile b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/Dockerfile index 0223dab7c..39c071b13 100644 --- a/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/Dockerfile +++ b/src/Microservices/Services.Storage/ClassifiedAds.Services.Storage.Api/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Microservices # Copy csproj and restore as distinct layers @@ -17,7 +17,7 @@ COPY . ./ RUN dotnet publish ./Services.Storage/ClassifiedAds.Services.Storage.Api/ClassifiedAds.Services.Storage.Api.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Microservices COPY --from=build-env /ClassifiedAds.Microservices/out . diff --git a/src/Monolith/ClassifiedAds.Application/ClassifiedAds.Application.csproj b/src/Monolith/ClassifiedAds.Application/ClassifiedAds.Application.csproj index f7f888237..ee6e4525e 100644 --- a/src/Monolith/ClassifiedAds.Application/ClassifiedAds.Application.csproj +++ b/src/Monolith/ClassifiedAds.Application/ClassifiedAds.Application.csproj @@ -1,14 +1,14 @@  - net8.0 + net9.0 Recommended All - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.ArchTests/ClassifiedAds.ArchTests.csproj b/src/Monolith/ClassifiedAds.ArchTests/ClassifiedAds.ArchTests.csproj index 9cbed7a8b..03ae43d9a 100644 --- a/src/Monolith/ClassifiedAds.ArchTests/ClassifiedAds.ArchTests.csproj +++ b/src/Monolith/ClassifiedAds.ArchTests/ClassifiedAds.ArchTests.csproj @@ -1,21 +1,21 @@ - net8.0 + net9.0 Recommended All false - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.AspireAppHost/ClassifiedAds.AspireAppHost.csproj b/src/Monolith/ClassifiedAds.AspireAppHost/ClassifiedAds.AspireAppHost.csproj index 98747767d..47a6d7120 100644 --- a/src/Monolith/ClassifiedAds.AspireAppHost/ClassifiedAds.AspireAppHost.csproj +++ b/src/Monolith/ClassifiedAds.AspireAppHost/ClassifiedAds.AspireAppHost.csproj @@ -4,7 +4,7 @@ Exe - net8.0 + net9.0 enable enable true diff --git a/src/Monolith/ClassifiedAds.Background/ClassifiedAds.Background.csproj b/src/Monolith/ClassifiedAds.Background/ClassifiedAds.Background.csproj index ebef6b5d2..2ef00ad09 100644 --- a/src/Monolith/ClassifiedAds.Background/ClassifiedAds.Background.csproj +++ b/src/Monolith/ClassifiedAds.Background/ClassifiedAds.Background.csproj @@ -1,15 +1,15 @@  - net8.0 + net9.0 Recommended All 2afdbe02-eb10-41d2-8fee-1cb29d0dfffb - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.Background/Dockerfile b/src/Monolith/ClassifiedAds.Background/Dockerfile index a8fb4ed6e..e75574037 100644 --- a/src/Monolith/ClassifiedAds.Background/Dockerfile +++ b/src/Monolith/ClassifiedAds.Background/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Monolith # Copy csproj and restore as distinct layers @@ -19,7 +19,7 @@ COPY . ./ RUN dotnet publish ./ClassifiedAds.Background/ClassifiedAds.Background.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Monolith COPY --from=build-env /ClassifiedAds.Monolith/out . diff --git a/src/Monolith/ClassifiedAds.Blazor.Modules/ClassifiedAds.Blazor.Modules.csproj b/src/Monolith/ClassifiedAds.Blazor.Modules/ClassifiedAds.Blazor.Modules.csproj index 768ee1c5f..73634b1a0 100644 --- a/src/Monolith/ClassifiedAds.Blazor.Modules/ClassifiedAds.Blazor.Modules.csproj +++ b/src/Monolith/ClassifiedAds.Blazor.Modules/ClassifiedAds.Blazor.Modules.csproj @@ -1,19 +1,19 @@  - net8.0 + net9.0 Recommended All - - - - - - + + + + + + diff --git a/src/Monolith/ClassifiedAds.BlazorServerSide/ClassifiedAds.BlazorServerSide.csproj b/src/Monolith/ClassifiedAds.BlazorServerSide/ClassifiedAds.BlazorServerSide.csproj index 9e307a927..24ec75116 100644 --- a/src/Monolith/ClassifiedAds.BlazorServerSide/ClassifiedAds.BlazorServerSide.csproj +++ b/src/Monolith/ClassifiedAds.BlazorServerSide/ClassifiedAds.BlazorServerSide.csproj @@ -1,19 +1,19 @@  - net8.0 + net9.0 Recommended All 752c7fb1-d2cf-490b-aa64-c3a9ea7b6734 - - - - - - + + + + + + diff --git a/src/Monolith/ClassifiedAds.BlazorServerSide/Dockerfile b/src/Monolith/ClassifiedAds.BlazorServerSide/Dockerfile index d1eb677cd..52282d489 100644 --- a/src/Monolith/ClassifiedAds.BlazorServerSide/Dockerfile +++ b/src/Monolith/ClassifiedAds.BlazorServerSide/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Monolith # Copy csproj and restore as distinct layers @@ -20,7 +20,7 @@ COPY . ./ RUN dotnet publish ./ClassifiedAds.BlazorServerSide/ClassifiedAds.BlazorServerSide.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Monolith COPY --from=build-env /ClassifiedAds.Monolith/out . diff --git a/src/Monolith/ClassifiedAds.BlazorWebAssembly/ClassifiedAds.BlazorWebAssembly.csproj b/src/Monolith/ClassifiedAds.BlazorWebAssembly/ClassifiedAds.BlazorWebAssembly.csproj index 7f0c6101b..c50fc9871 100644 --- a/src/Monolith/ClassifiedAds.BlazorWebAssembly/ClassifiedAds.BlazorWebAssembly.csproj +++ b/src/Monolith/ClassifiedAds.BlazorWebAssembly/ClassifiedAds.BlazorWebAssembly.csproj @@ -1,16 +1,16 @@  - net8.0 + net9.0 Recommended All - - - - + + + + diff --git a/src/Monolith/ClassifiedAds.ContractTests/ClassifiedAds.ContractTests.csproj b/src/Monolith/ClassifiedAds.ContractTests/ClassifiedAds.ContractTests.csproj index de7101c5e..f2f2213af 100644 --- a/src/Monolith/ClassifiedAds.ContractTests/ClassifiedAds.ContractTests.csproj +++ b/src/Monolith/ClassifiedAds.ContractTests/ClassifiedAds.ContractTests.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Recommended All false @@ -9,14 +9,14 @@ - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj b/src/Monolith/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj index 913aedb8d..052d5d6d3 100644 --- a/src/Monolith/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj +++ b/src/Monolith/ClassifiedAds.CrossCuttingConcerns/ClassifiedAds.CrossCuttingConcerns.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Recommended All @@ -11,7 +11,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Monolith/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj b/src/Monolith/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj index 4641cebe6..4118179c4 100644 --- a/src/Monolith/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj +++ b/src/Monolith/ClassifiedAds.Domain/ClassifiedAds.Domain.csproj @@ -1,20 +1,19 @@  - net8.0 + net9.0 Recommended All - + all runtime; build; native; contentfiles; analyzers; buildtransitive - diff --git a/src/Monolith/ClassifiedAds.EndToEndTests/ClassifiedAds.EndToEndTests.csproj b/src/Monolith/ClassifiedAds.EndToEndTests/ClassifiedAds.EndToEndTests.csproj index e229de8fa..88b0bad57 100644 --- a/src/Monolith/ClassifiedAds.EndToEndTests/ClassifiedAds.EndToEndTests.csproj +++ b/src/Monolith/ClassifiedAds.EndToEndTests/ClassifiedAds.EndToEndTests.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Recommended All false @@ -16,17 +16,17 @@ - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj b/src/Monolith/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj index a406f884d..01c62046f 100644 --- a/src/Monolith/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj +++ b/src/Monolith/ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Recommended All @@ -9,62 +9,62 @@ - + - - - - - - - + + + + + + + - - - - - + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQHealthCheck.cs b/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQHealthCheck.cs index ff7be2abd..c14208e91 100644 --- a/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQHealthCheck.cs +++ b/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQHealthCheck.cs @@ -15,7 +15,7 @@ public RabbitMQHealthCheck(RabbitMQHealthCheckOptions options) _options = options; } - public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) + public async Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) { try { @@ -26,14 +26,14 @@ public Task CheckHealthAsync(HealthCheckContext context, Canc Password = _options.Password, }; - using var connection = connectionFactory.CreateConnection(); - using var model = connection.CreateModel(); + using var connection = await connectionFactory.CreateConnectionAsync(cancellationToken); + using var channel = await connection.CreateChannelAsync(cancellationToken: cancellationToken); - return Task.FromResult(HealthCheckResult.Healthy($"HostName: {_options.HostName}")); + return HealthCheckResult.Healthy($"HostName: {_options.HostName}"); } catch (Exception exception) { - return Task.FromResult(new HealthCheckResult(context.Registration.FailureStatus, null, exception)); + return new HealthCheckResult(context.Registration.FailureStatus, null, exception); } } } diff --git a/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQReceiver.cs b/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQReceiver.cs index bc5447465..7e0ae797c 100644 --- a/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQReceiver.cs +++ b/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQReceiver.cs @@ -16,36 +16,34 @@ namespace ClassifiedAds.Infrastructure.MessageBrokers.RabbitMQ; public class RabbitMQReceiver : IMessageReceiver, IDisposable { private readonly RabbitMQReceiverOptions _options; - private readonly IConnection _connection; - private IModel _channel; - private string _queueName; + private IConnection _connection; + private IChannel _channel; public RabbitMQReceiver(RabbitMQReceiverOptions options) { _options = options; - - _connection = new ConnectionFactory - { - HostName = options.HostName, - UserName = options.UserName, - Password = options.Password, - AutomaticRecoveryEnabled = true, - DispatchConsumersAsync = true - }.CreateConnection(); - - _queueName = options.QueueName; - - _connection.ConnectionShutdown += Connection_ConnectionShutdown; } - private void Connection_ConnectionShutdown(object sender, ShutdownEventArgs e) + private Task Connection_ConnectionShutdownAsync(object sender, ShutdownEventArgs e) { // TODO: add log here + + return Task.CompletedTask; } - public Task ReceiveAsync(Func action, CancellationToken cancellationToken = default) + public async Task ReceiveAsync(Func action, CancellationToken cancellationToken = default) { - _channel = _connection.CreateModel(); + _connection = await new ConnectionFactory + { + HostName = _options.HostName, + UserName = _options.UserName, + Password = _options.Password, + AutomaticRecoveryEnabled = true, + }.CreateConnectionAsync(cancellationToken); + + _connection.ConnectionShutdownAsync += Connection_ConnectionShutdownAsync; + + _channel = await _connection.CreateChannelAsync(cancellationToken: cancellationToken); if (_options.AutomaticCreateEnabled) { @@ -79,21 +77,21 @@ public Task ReceiveAsync(Func action, CancellationToken cance if (_options.DeadLetter.AutomaticCreateEnabled && !string.IsNullOrEmpty(_options.DeadLetter.QueueName)) { - _channel.QueueDeclare(_options.DeadLetter.QueueName, true, false, false, null); - _channel.QueueBind(_options.DeadLetter.QueueName, _options.DeadLetter.ExchangeName, _options.DeadLetter.RoutingKey, null); + await _channel.QueueDeclareAsync(_options.DeadLetter.QueueName, true, false, false, null, cancellationToken: cancellationToken); + await _channel.QueueBindAsync(_options.DeadLetter.QueueName, _options.DeadLetter.ExchangeName, _options.DeadLetter.RoutingKey, null, cancellationToken: cancellationToken); } } arguments = arguments.Count == 0 ? null : arguments; - _channel.QueueDeclare(_options.QueueName, true, false, false, arguments); - _channel.QueueBind(_options.QueueName, _options.ExchangeName, _options.RoutingKey, null); + await _channel.QueueDeclareAsync(_options.QueueName, true, false, false, arguments, cancellationToken: cancellationToken); + await _channel.QueueBindAsync(_options.QueueName, _options.ExchangeName, _options.RoutingKey, null, cancellationToken: cancellationToken); } - _channel.BasicQos(prefetchSize: 0, prefetchCount: 1, global: false); + await _channel.BasicQosAsync(prefetchSize: 0, prefetchCount: 1, global: false, cancellationToken: cancellationToken); var consumer = new AsyncEventingBasicConsumer(_channel); - consumer.Received += async (model, ea) => + consumer.ReceivedAsync += async (model, ea) => { try { @@ -122,21 +120,17 @@ public Task ReceiveAsync(Func action, CancellationToken cance await action(message.Data, message.MetaData); - _channel.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false); + await _channel.BasicAckAsync(deliveryTag: ea.DeliveryTag, multiple: false); } catch (Exception ex) { // TODO: log here await Task.Delay(1000); - _channel.BasicNack(deliveryTag: ea.DeliveryTag, multiple: false, requeue: _options.RequeueOnFailure); + await _channel.BasicNackAsync(deliveryTag: ea.DeliveryTag, multiple: false, requeue: _options.RequeueOnFailure); } }; - _channel.BasicConsume(queue: _queueName, - autoAck: false, - consumer: consumer); - - return Task.CompletedTask; + await _channel.BasicConsumeAsync(queue: _options.QueueName, autoAck: false, consumer: consumer, cancellationToken: cancellationToken); } public void Dispose() diff --git a/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQSender.cs b/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQSender.cs index 8dafa4a86..5c48ca708 100644 --- a/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQSender.cs +++ b/src/Monolith/ClassifiedAds.Infrastructure/MessageBrokers/RabbitMQ/RabbitMQSender.cs @@ -11,7 +11,7 @@ namespace ClassifiedAds.Infrastructure.MessageBrokers.RabbitMQ; public class RabbitMQSender : IMessageSender { private readonly RabbitMQSenderOptions _options; - private readonly IConnectionFactory _connectionFactory; + private readonly ConnectionFactory _connectionFactory; private readonly string _exchangeName; private readonly string _routingKey; @@ -32,33 +32,34 @@ public RabbitMQSender(RabbitMQSenderOptions options) public async Task SendAsync(T message, MetaData metaData = null, CancellationToken cancellationToken = default) { - await Task.Run(() => + using var connection = await _connectionFactory.CreateConnectionAsync(cancellationToken); + using var channel = await connection.CreateChannelAsync(cancellationToken: cancellationToken); + var body = new Message { - using var connection = _connectionFactory.CreateConnection(); - using var channel = connection.CreateModel(); - var body = new Message - { - Data = message, - MetaData = metaData, - }.GetBytes(); + Data = message, + MetaData = metaData, + }.GetBytes(); - if (_options.MessageEncryptionEnabled) - { - var iv = SymmetricCrypto.GenerateKey(16); - body = (iv.ToBase64String() + "." + body.UseAES(_options.MessageEncryptionKey.FromBase64String()) - .WithCipher(CipherMode.CBC) - .WithIV(iv) - .WithPadding(PaddingMode.PKCS7) - .Encrypt().ToBase64String()).GetBytes(); - } + if (_options.MessageEncryptionEnabled) + { + var iv = SymmetricCrypto.GenerateKey(16); + body = (iv.ToBase64String() + "." + body.UseAES(_options.MessageEncryptionKey.FromBase64String()) + .WithCipher(CipherMode.CBC) + .WithIV(iv) + .WithPadding(PaddingMode.PKCS7) + .Encrypt().ToBase64String()).GetBytes(); + } - var properties = channel.CreateBasicProperties(); - properties.Persistent = true; + var properties = new BasicProperties + { + Persistent = true + }; - channel.BasicPublish(exchange: _exchangeName, - routingKey: _routingKey, - basicProperties: properties, - body: body); - }, cancellationToken); + await channel.BasicPublishAsync(exchange: _exchangeName, + routingKey: _routingKey, + mandatory: true, + basicProperties: properties, + body: body, + cancellationToken: cancellationToken); } } diff --git a/src/Monolith/ClassifiedAds.IntegrationTests/ClassifiedAds.IntegrationTests.csproj b/src/Monolith/ClassifiedAds.IntegrationTests/ClassifiedAds.IntegrationTests.csproj index ebee73097..280577aeb 100644 --- a/src/Monolith/ClassifiedAds.IntegrationTests/ClassifiedAds.IntegrationTests.csproj +++ b/src/Monolith/ClassifiedAds.IntegrationTests/ClassifiedAds.IntegrationTests.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Recommended All false @@ -16,24 +16,24 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.Migrator/ClassifiedAds.Migrator.csproj b/src/Monolith/ClassifiedAds.Migrator/ClassifiedAds.Migrator.csproj index 34282ff7a..44191e756 100644 --- a/src/Monolith/ClassifiedAds.Migrator/ClassifiedAds.Migrator.csproj +++ b/src/Monolith/ClassifiedAds.Migrator/ClassifiedAds.Migrator.csproj @@ -1,7 +1,7 @@  - net8.0 + net9.0 Recommended All b8df572d-5be2-4f41-b55a-8f4e2ef2b569 @@ -21,13 +21,13 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.Migrator/Dockerfile b/src/Monolith/ClassifiedAds.Migrator/Dockerfile index 5672f5dac..be714161e 100644 --- a/src/Monolith/ClassifiedAds.Migrator/Dockerfile +++ b/src/Monolith/ClassifiedAds.Migrator/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Monolith # Copy csproj and restore as distinct layers @@ -19,7 +19,7 @@ COPY . ./ RUN dotnet publish ./ClassifiedAds.Migrator/ClassifiedAds.Migrator.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Monolith COPY --from=build-env /ClassifiedAds.Monolith/out . diff --git a/src/Monolith/ClassifiedAds.Persistence/ClassifiedAds.Persistence.csproj b/src/Monolith/ClassifiedAds.Persistence/ClassifiedAds.Persistence.csproj index 4fe209c50..15cef2e03 100644 --- a/src/Monolith/ClassifiedAds.Persistence/ClassifiedAds.Persistence.csproj +++ b/src/Monolith/ClassifiedAds.Persistence/ClassifiedAds.Persistence.csproj @@ -1,18 +1,18 @@  - net8.0 + net9.0 Recommended All - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.UnitTests/ClassifiedAds.UnitTests.csproj b/src/Monolith/ClassifiedAds.UnitTests/ClassifiedAds.UnitTests.csproj index fd05a8b27..2b6d396fe 100644 --- a/src/Monolith/ClassifiedAds.UnitTests/ClassifiedAds.UnitTests.csproj +++ b/src/Monolith/ClassifiedAds.UnitTests/ClassifiedAds.UnitTests.csproj @@ -1,29 +1,29 @@  - net8.0 + net9.0 Recommended All false - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.WebAPI/ClassifiedAds.WebAPI.csproj b/src/Monolith/ClassifiedAds.WebAPI/ClassifiedAds.WebAPI.csproj index 7a9c0e839..f26691666 100644 --- a/src/Monolith/ClassifiedAds.WebAPI/ClassifiedAds.WebAPI.csproj +++ b/src/Monolith/ClassifiedAds.WebAPI/ClassifiedAds.WebAPI.csproj @@ -1,21 +1,21 @@  - net8.0 + net9.0 Recommended All a3cce8d1-91dc-440d-aa9d-6fc323cb0ab6 - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/Monolith/ClassifiedAds.WebAPI/Dockerfile b/src/Monolith/ClassifiedAds.WebAPI/Dockerfile index 01b21d0b1..ec186b383 100644 --- a/src/Monolith/ClassifiedAds.WebAPI/Dockerfile +++ b/src/Monolith/ClassifiedAds.WebAPI/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Monolith # Copy csproj and restore as distinct layers @@ -19,7 +19,7 @@ COPY . ./ RUN dotnet publish ./ClassifiedAds.WebAPI/ClassifiedAds.WebAPI.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Monolith COPY --from=build-env /ClassifiedAds.Monolith/out . diff --git a/src/Monolith/ClassifiedAds.WebAPI/appsettings.json b/src/Monolith/ClassifiedAds.WebAPI/appsettings.json index 3ee5f4ab9..e1b76f0c4 100644 --- a/src/Monolith/ClassifiedAds.WebAPI/appsettings.json +++ b/src/Monolith/ClassifiedAds.WebAPI/appsettings.json @@ -135,7 +135,8 @@ "SettingsEncryption": { "Thumbprint": null, "Path": "Certs/classifiedads.secretsencryption.pfx", - "Password": "password1234" + "Password": "password1234", + "X509KeyStorageFlags": "EphemeralKeySet" } } } diff --git a/src/Monolith/ClassifiedAds.WebMVC/ClassifiedAds.WebMVC.csproj b/src/Monolith/ClassifiedAds.WebMVC/ClassifiedAds.WebMVC.csproj index 368522a59..27fc96262 100644 --- a/src/Monolith/ClassifiedAds.WebMVC/ClassifiedAds.WebMVC.csproj +++ b/src/Monolith/ClassifiedAds.WebMVC/ClassifiedAds.WebMVC.csproj @@ -1,22 +1,22 @@  - net8.0 + net9.0 Recommended All 715a7fa5-7600-457a-bcdf-662d50011045 - - - - - - - - - + + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/Monolith/ClassifiedAds.WebMVC/Dockerfile b/src/Monolith/ClassifiedAds.WebMVC/Dockerfile index d25e12e26..f7a9932dc 100644 --- a/src/Monolith/ClassifiedAds.WebMVC/Dockerfile +++ b/src/Monolith/ClassifiedAds.WebMVC/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build-env +FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build-env WORKDIR /ClassifiedAds.Monolith # Copy csproj and restore as distinct layers @@ -19,7 +19,7 @@ COPY . ./ RUN dotnet publish ./ClassifiedAds.WebMVC/ClassifiedAds.WebMVC.csproj -c Release -o out # Build runtime image -FROM mcr.microsoft.com/dotnet/aspnet:8.0 +FROM mcr.microsoft.com/dotnet/aspnet:9.0 WORKDIR /ClassifiedAds.Monolith COPY --from=build-env /ClassifiedAds.Monolith/out .