Skip to content

Commit

Permalink
feat: add snapshot verifier
Browse files Browse the repository at this point in the history
  • Loading branch information
emalfroy authored and jvandaal committed Sep 12, 2023
1 parent ba960fb commit d705da7
Show file tree
Hide file tree
Showing 12 changed files with 346 additions and 41 deletions.
7 changes: 7 additions & 0 deletions StreetNameRegistry.sln
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StreetNameRegistry.Projecti
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StreetNameRegistry.Api.BackOffice.IntegrationTests", "test\StreetNameRegistry.Api.BackOffice.IntegrationTests\StreetNameRegistry.Api.BackOffice.IntegrationTests.csproj", "{EFDF165C-DCFE-4577-A00F-04691197FB1B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StreetNameRegistry.Snapshot.Verifier", "src\StreetName.Snapshot.Verifier\StreetNameRegistry.Snapshot.Verifier.csproj", "{2F4A3830-62DB-45EE-8B47-FD1DE34BBF68}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -179,6 +181,10 @@ Global
{EFDF165C-DCFE-4577-A00F-04691197FB1B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EFDF165C-DCFE-4577-A00F-04691197FB1B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EFDF165C-DCFE-4577-A00F-04691197FB1B}.Release|Any CPU.Build.0 = Release|Any CPU
{2F4A3830-62DB-45EE-8B47-FD1DE34BBF68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2F4A3830-62DB-45EE-8B47-FD1DE34BBF68}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2F4A3830-62DB-45EE-8B47-FD1DE34BBF68}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2F4A3830-62DB-45EE-8B47-FD1DE34BBF68}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -208,6 +214,7 @@ Global
{C1ED8210-F8FC-4269-B089-1B0CE7A62566} = {65EA04DE-5928-430F-92CA-24C11B6E5A00}
{C1C797C7-4A24-4E9C-B7D0-7E097562342E} = {65EA04DE-5928-430F-92CA-24C11B6E5A00}
{EFDF165C-DCFE-4577-A00F-04691197FB1B} = {81641B0B-BEFB-476D-8519-3774313E944B}
{2F4A3830-62DB-45EE-8B47-FD1DE34BBF68} = {65EA04DE-5928-430F-92CA-24C11B6E5A00}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3B44FE80-30FE-47B7-A0DE-8610218FFF63}
Expand Down
22 changes: 12 additions & 10 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,24 @@ nuget Be.Vlaanderen.Basisregisters.Testing.Infrastructure.Events 3.0.0 content:

nuget Be.Vlaanderen.Basisregisters.Auth.AcmIdm 1.4.0

nuget Be.Vlaanderen.Basisregisters.AggregateSource 8.0.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.ExplicitRouting 8.0.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore.Autofac 8.0.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.Testing 8.0.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.Testing.CommandHandling 8.0.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.Testing.SqlStreamStore.Autofac 8.0.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.Testing.Xunit 8.0.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource 8.2.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.ExplicitRouting 8.2.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore.Autofac 8.2.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.Testing 8.2.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.Testing.CommandHandling 8.2.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.Testing.SqlStreamStore.Autofac 8.2.0
nuget Be.Vlaanderen.Basisregisters.AggregateSource.Testing.Xunit 8.2.0

nuget Be.Vlaanderen.Basisregisters.Api 20.0.0

nuget Be.Vlaanderen.Basisregisters.Aws.DistributedMutex 3.0.1
nuget Be.Vlaanderen.Basisregisters.Aws.Lambda 3.0.3

nuget Be.Vlaanderen.Basisregisters.CommandHandling 8.0.0
nuget Be.Vlaanderen.Basisregisters.CommandHandling.Idempotency 8.0.0
nuget Be.Vlaanderen.Basisregisters.CommandHandling.SqlStreamStore 8.0.0
nuget Be.Vlaanderen.Basisregisters.CommandHandling 8.2.0
nuget Be.Vlaanderen.Basisregisters.CommandHandling.Idempotency 8.2.0
nuget Be.Vlaanderen.Basisregisters.CommandHandling.SqlStreamStore 8.2.0

nuget Be.Vlaanderen.Basisregisters.SnapshotVerifier 8.2.0

nuget Be.Vlaanderen.Basisregisters.EventHandling 4.2.3
nuget Be.Vlaanderen.Basisregisters.EventHandling.Autofac 4.2.3
Expand Down
65 changes: 35 additions & 30 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,44 +47,44 @@ NUGET
System.Security.Cryptography.ProtectedData (>= 4.7)
System.Text.Json (>= 4.7.2)
System.Threading.Tasks.Extensions (>= 4.5.4)
Be.Vlaanderen.Basisregisters.AggregateSource (8.0)
Be.Vlaanderen.Basisregisters.AggregateSource (8.2)
Be.Vlaanderen.Basisregisters.Utilities.HashCodeCalculator (>= 3.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.Utilities.HexByteConvertor (>= 3.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.Utilities.ToStringBuilder (>= 3.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Newtonsoft.Json (>= 13.0.1) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
NodaTime (>= 3.0.10) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.ExplicitRouting (8.0)
Be.Vlaanderen.Basisregisters.AggregateSource (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.ExplicitRouting (8.2)
Be.Vlaanderen.Basisregisters.AggregateSource (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.EventHandling (>= 4.2.3) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
SqlStreamStore (>= 1.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore.Autofac (8.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore.Autofac (8.2)
Autofac.Extensions.DependencyInjection (>= 7.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
SqlStreamStore (>= 1.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
SqlStreamStore.MsSql (>= 1.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing (8.0)
Be.Vlaanderen.Basisregisters.AggregateSource (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
CompareNETObjects (>= 4.76) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing (8.2)
Be.Vlaanderen.Basisregisters.AggregateSource (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
CompareNETObjects (>= 4.81) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Microsoft.CSharp (>= 4.7) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Newtonsoft.Json (>= 13.0.1) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.CommandHandling (8.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.CommandHandling (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.SqlStreamStore (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.CommandHandling (8.2)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.CommandHandling (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.SqlStreamStore (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.EventHandling (>= 4.2.3) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
SqlStreamStore (>= 1.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.SqlStreamStore.Autofac (8.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.SqlStreamStore.Autofac (8.2)
Autofac.Extensions.DependencyInjection (>= 7.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore.Autofac (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.CommandHandling (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.SqlStreamStore (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.Xunit (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.Xunit (8.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore.Autofac (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.CommandHandling (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.SqlStreamStore (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.Xunit (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing.Xunit (8.2)
Be.Vlaanderen.Basisregisters.AggregateSource.Testing (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Microsoft.Extensions.Logging (>= 6.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
xunit (>= 2.4.1) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.Api (20.0)
Expand Down Expand Up @@ -218,17 +218,17 @@ NUGET
Fake.IO.FileSystem (>= 5.22)
Fake.JavaScript.Npm (>= 5.22)
Newtonsoft.Json (>= 13.0.1)
Be.Vlaanderen.Basisregisters.CommandHandling (8.0)
Be.Vlaanderen.Basisregisters.CommandHandling.Idempotency (8.0)
Be.Vlaanderen.Basisregisters.CommandHandling (8.2)
Be.Vlaanderen.Basisregisters.CommandHandling.Idempotency (8.2)
Be.Vlaanderen.Basisregisters.Converters.Timestamp (>= 3.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Microsoft.Data.SqlClient (>= 4.1) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Microsoft.EntityFrameworkCore.SqlServer (>= 6.0.3) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Microsoft.Extensions.Configuration (>= 6.0.1) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Microsoft.Extensions.Options.ConfigurationExtensions (>= 6.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Newtonsoft.Json (>= 13.0.1) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.CommandHandling.SqlStreamStore (8.0)
Be.Vlaanderen.Basisregisters.AggregateSource (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.CommandHandling (8.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.CommandHandling.SqlStreamStore (8.2)
Be.Vlaanderen.Basisregisters.AggregateSource (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.CommandHandling (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.EventHandling (>= 4.2.3) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.Generators.Guid.Deterministic (>= 3.0.1) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
SqlStreamStore (>= 1.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Expand Down Expand Up @@ -418,6 +418,11 @@ NUGET
System.Configuration.ConfigurationManager (>= 6.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
System.Threading.Tasks.Dataflow (>= 6.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.Shaperon (9.0.1)
Be.Vlaanderen.Basisregisters.SnapshotVerifier (8.2)
Be.Vlaanderen.Basisregisters.AggregateSource.SqlStreamStore (8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
CompareNETObjects (>= 4.81) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Dapper (>= 2.0.123) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Microsoft.Extensions.Hosting (>= 6.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.Sqs (1.3.1)
MediatR (>= 12.0.1) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Be.Vlaanderen.Basisregisters.Sqs.Lambda (1.3.1)
Expand Down Expand Up @@ -453,8 +458,8 @@ NUGET
System.Reflection.TypeExtensions (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== net6.0)
System.Xml.XmlDocument (>= 4.3) - restriction: || (&& (== net472) (< net35)) (== net6.0)
CommandLineParser (2.8) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
CompareNETObjects (4.76) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Microsoft.CSharp (>= 4.7) - restriction: || (&& (== net472) (>= netstandard2.1)) (== net6.0)
CompareNETObjects (4.81) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
System.Configuration.ConfigurationManager (>= 6.0) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
Confluent.Kafka (1.8.2) - restriction: || (&& (== net472) (>= net6.0)) (== net6.0)
librdkafka.redist (>= 1.8.2)
System.Memory (>= 4.5)
Expand Down
23 changes: 23 additions & 0 deletions src/StreetName.Snapshot.Verifier/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM mcr.microsoft.com/dotnet/runtime-deps:6.0.3

# create group & user
RUN addgroup --gid 1000 --system app && adduser --uid 1000 -system app --gid 1000

# create work dir and set permissions as WORKDIR sets permissions as root
RUN mkdir /app && chown -R app:app /app
WORKDIR /app

LABEL maintainer "Digitaal Vlaanderen <[email protected]>"
LABEL registry="streetname-registry"

COPY / /app
WORKDIR /app

RUN apt-get update && \
apt-get install curl jq -y && \
chmod +x ./init.sh

# switch to created user
USER app

ENTRYPOINT ["./init.sh"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
namespace StreetNameRegistry.Snapshot.Verifier.Infrastructure.Modules
{
using Autofac;
using Autofac.Extensions.DependencyInjection;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using StreetNameRegistry.Infrastructure;
using StreetNameRegistry.Infrastructure.Modules;

public class ApiModule : Module
{
private readonly IConfiguration _configuration;
private readonly IServiceCollection _services;
private readonly ILoggerFactory _loggerFactory;

public ApiModule(
IConfiguration configuration,
IServiceCollection services,
ILoggerFactory loggerFactory)
{
_configuration = configuration;
_services = services;
_loggerFactory = loggerFactory;
}

protected override void Load(ContainerBuilder builder)
{
builder
.RegisterModule(new CommandHandlingModule(_configuration));

builder.RegisterSnapshotModule(_configuration);

builder.Populate(_services);
}
}
}
Loading

0 comments on commit d705da7

Please sign in to comment.