Skip to content

Commit 97e90da

Browse files
committed
Merge branch 'main' into introduce-lockfiles
2 parents 4b2108a + 770c322 commit 97e90da

File tree

424 files changed

+11815
-5517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

424 files changed

+11815
-5517
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

.github/renovate.json5

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
extends: ["config:recommended"],
44
labels: ["dependencies"],
55
schedule: ["after 10pm every weekday", "before 5am every weekday", "every weekend"],
6+
ignorePaths: ["**/node_modules/**", "**/bower_components/**", "**/vendor/**", "**/examples/**"], // we have to set this, in order to override the default that comes from `config:recommended`, which ignores any packages in directories like "tests"
67
packageRules: [
78
{
89
// we don't want to update eslint currently, because there is a breaking change in its config
@@ -14,7 +15,13 @@
1415
{
1516
// the docker images in this list are created and used by our pipelines and can therefore not to be updated by renovate
1617
matchDatasources: ["docker"],
17-
packageNames: ["admin-ui", "event-handler-service", "sse-server", "database-migrator", "admin-cli"],
18+
packageNames: ["consumer-api", "admin-ui", "event-handler-service", "sse-server", "database-migrator", "admin-cli"],
19+
enabled: false
20+
},
21+
{
22+
// the dart packages in this list is fetched directly from git and therefore doesn't have a version
23+
matchDatasources: ["dart"],
24+
packageNames: ["window_size"],
1825
enabled: false
1926
},
2027

Applications/AdminApi/src/AdminApi/AdminApi.csproj

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,11 @@
66

77
<ItemGroup>
88
<PackageReference Include="Microsoft.AspNetCore.OData" Version="9.0.0" />
9-
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
10-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
11-
<PrivateAssets>all</PrivateAssets>
12-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13-
</PackageReference>
9+
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
1410
<PackageReference Include="OpenIddict.EntityFrameworkCore" Version="5.8.0" />
1511
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
1612
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
17-
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.23.0" />
13+
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.24.0" />
1814
<PackageReference Include="ReHackt.Extensions.Options.Validation" Version="8.0.2" />
1915
<PackageReference Include="Serilog" Version="4.0.1" />
2016
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
@@ -32,21 +28,21 @@
3228
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="8.0.2" />
3329
</ItemGroup>
3430
<ItemGroup>
35-
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\BuildingBlocks.API\BuildingBlocks.API.csproj" />
36-
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Application\Challenges.Application.csproj" />
37-
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Infrastructure\Challenges.Infrastructure.csproj" />
38-
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Application\Devices.Application.csproj" />
39-
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Infrastructure\Devices.Infrastructure.csproj" />
40-
<ProjectReference Include="..\..\..\..\Infrastructure\Infrastructure.csproj" />
41-
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Application\Quotas.Application.csproj" />
42-
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Infrastructure\Quotas.Infrastructure.csproj" />
43-
<ProjectReference Include="..\AdminApi.Infrastructure.Database.Postgres\AdminApi.Infrastructure.Database.Postgres.csproj" />
44-
<ProjectReference Include="..\AdminApi.Infrastructure.Database.SqlServer\AdminApi.Infrastructure.Database.SqlServer.csproj" />
45-
<ProjectReference Include="..\AdminApi.Infrastructure\AdminApi.Infrastructure.csproj" />
31+
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\BuildingBlocks.API\BuildingBlocks.API.csproj"/>
32+
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Application\Challenges.Application.csproj"/>
33+
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Infrastructure\Challenges.Infrastructure.csproj"/>
34+
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Application\Devices.Application.csproj"/>
35+
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Infrastructure\Devices.Infrastructure.csproj"/>
36+
<ProjectReference Include="..\..\..\..\Infrastructure\Infrastructure.csproj"/>
37+
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Application\Quotas.Application.csproj"/>
38+
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Infrastructure\Quotas.Infrastructure.csproj"/>
39+
<ProjectReference Include="..\AdminApi.Infrastructure.Database.Postgres\AdminApi.Infrastructure.Database.Postgres.csproj"/>
40+
<ProjectReference Include="..\AdminApi.Infrastructure.Database.SqlServer\AdminApi.Infrastructure.Database.SqlServer.csproj"/>
41+
<ProjectReference Include="..\AdminApi.Infrastructure\AdminApi.Infrastructure.csproj"/>
4642
</ItemGroup>
4743

4844
<Target Name="PreBuild" BeforeTargets="Build" Condition="$(Configuration) == Debug">
49-
<Delete Files="$(ProjectDir)appsettings.override.json" />
50-
<Copy SourceFiles="..\..\..\..\appsettings.override.json" DestinationFolder="$(ProjectDir)" UseHardlinksIfPossible="true" />
45+
<Delete Files="$(ProjectDir)appsettings.override.json"/>
46+
<Copy SourceFiles="..\..\..\..\appsettings.override.json" DestinationFolder="$(ProjectDir)" UseHardlinksIfPossible="true"/>
5147
</Target>
52-
</Project>
48+
</Project>

Applications/AdminApi/src/AdminApi/Authentication/AnonymousUserContext.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,4 @@ public string GetUsername()
4444
{
4545
throw new NotSupportedException();
4646
}
47-
48-
public IEnumerable<string> GetRoles()
49-
{
50-
throw new NotSupportedException();
51-
}
52-
53-
public SubscriptionPlan GetSubscriptionPlan()
54-
{
55-
throw new NotSupportedException();
56-
}
5747
}

Applications/AdminApi/src/AdminApi/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ RUN dotnet publish /p:ContinuousIntegrationBuild=true /p:UseAppHost=false --no-r
8888
RUN dotnet publish /p:ContinuousIntegrationBuild=true --configuration Release --output /app/publish/health "/src/Applications/HealthCheck/src/HealthCheck.csproj"
8989

9090
#### Build Flutter Admin UI ####
91-
FROM ghcr.io/cirruslabs/flutter:3.24.1 AS flutter-build-env
91+
FROM ghcr.io/cirruslabs/flutter:3.24.3 AS flutter-build-env
9292

9393
COPY Applications/AdminUi /src
9494
WORKDIR /src

Applications/AdminApi/src/AdminApi/Extensions/IServiceCollectionExtensions.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,12 @@ public static IServiceCollection AddCustomAspNetCore(this IServiceCollection ser
9999
opts => opts.ApiKey = configuration.Authentication.ApiKey
100100
);
101101

102-
services.AddAuthorization(options =>
103-
{
104-
options.AddPolicy("ApiKey", policy =>
102+
services.AddAuthorizationBuilder()
103+
.AddPolicy("ApiKey", policy =>
105104
{
106105
policy.AddAuthenticationSchemes("ApiKey");
107106
policy.RequireAuthenticatedUser();
108107
});
109-
});
110108

111109
services.AddAntiforgery(o =>
112110
{

Applications/AdminApi/src/AdminApi/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ static WebApplication CreateApp(string[] args)
7676
.Enrich.WithProperty("service", "adminui")
7777
.Enrich.WithExceptionDetails(new DestructuringOptionsBuilder()
7878
.WithDefaultDestructurers()
79-
.WithDestructurers(new[] { new DbUpdateExceptionDestructurer() }))
79+
.WithDestructurers([new DbUpdateExceptionDestructurer()]))
8080
.Enrich.WithSensitiveDataMasking(options => options.AddSensitiveDataMasks()))
8181
.UseServiceProviderFactory(new AutofacServiceProviderFactory());
8282

Applications/AdminApi/test/AdminApi.Tests.Integration/AdminApi.Tests.Integration.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.7" />
8+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
99
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
1010
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
1111
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
1212
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
13+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
1414
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.0.2" />
1515
<PackageReference Include="ReHackt.Extensions.Options.Validation" Version="8.0.2" />
1616
<PackageReference Include="SolidToken.SpecFlow.DependencyInjection" Version="3.9.3" />
1717
<PackageReference Include="SpecFlow.NUnit" Version="3.9.74" />
18-
<PackageReference Include="nunit" Version="4.1.0" />
18+
<PackageReference Include="nunit" Version="4.2.2" />
1919
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
20-
<PackageReference Include="FluentAssertions" Version="6.12.0" />
20+
<PackageReference Include="FluentAssertions" Version="6.12.1" />
2121
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1">
2222
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2323
<PrivateAssets>all</PrivateAssets>

Applications/AdminApi/test/AdminApi.Tests.Integration/StepDefinitions/TierQuotaStepDefinitions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public void ThenTheResponseContentIncludesAnErrorWithTheErrorCode(string errorCo
137137
{
138138
_deleteResponse!.Error.Should().NotBeNull();
139139
_deleteResponse.Error!.Code.Should().Be(errorCode);
140-
;
141140
}
142141
}
143142
}

Applications/AdminCli/src/AdminCli/Commands/Clients/CreateClientCommand.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ private async Task CreateClient(string dbProvider, string dbConnectionString, st
5353
{
5454
var mediator = _serviceLocator.GetService<IMediator>(dbProvider, dbConnectionString);
5555

56-
var response = await mediator.Send(new Modules.Devices.Application.Clients.Commands.CreateClient.CreateClientCommand(clientId, displayName, clientSecret, defaultTier, maxIdentities), CancellationToken.None);
56+
var response = await mediator.Send(new Modules.Devices.Application.Clients.Commands.CreateClient.CreateClientCommand(clientId, displayName, clientSecret, defaultTier, maxIdentities),
57+
CancellationToken.None);
5758

5859
Console.WriteLine(JsonSerializer.Serialize(response, JSON_SERIALIZER_OPTIONS));
59-
Console.WriteLine("Please note the secret since you cannot obtain it later.");
60+
Console.WriteLine(@"Please note the secret since you cannot obtain it later.");
6061
}
6162
}

Applications/AdminCli/src/AdminCli/Commands/Clients/DeleteClientsCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private async Task DeleteClients(string dbProvider, string dbConnectionString, s
2929
try
3030
{
3131
await mediator.Send(new DeleteClientCommand(clientId), CancellationToken.None);
32-
Console.WriteLine($"Successfully deleted client '{clientId}'");
32+
Console.WriteLine($@"Successfully deleted client '{clientId}'");
3333
}
3434
catch (Exception ex)
3535
{

Applications/AdminCli/src/AdminCli/Commands/Clients/ListClientsCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private async Task ListClients(string dbProvider, string dbConnectionString)
1919

2020
var response = await mediator.Send(new ListClientsQuery(), CancellationToken.None);
2121

22-
Console.WriteLine("The following clients are configured:");
22+
Console.WriteLine(@"The following clients are configured:");
2323

2424
foreach (var client in response)
2525
{

Applications/AdminCli/src/AdminCli/Commands/Tiers/ListTiersCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ private async Task ListTiers(string dbProvider, string dbConnectionString)
2020

2121
var response = await mediator.Send(new ListTiersQuery(new PaginationFilter()), CancellationToken.None);
2222

23-
Console.WriteLine("The following tiers are configured:");
23+
Console.WriteLine(@"The following tiers are configured:");
2424

2525
foreach (var client in response)
2626
{

Applications/AdminCli/src/AdminCli/ConsoleExtensions.cs

Lines changed: 0 additions & 80 deletions
This file was deleted.

Applications/AdminCli/src/AdminCli/ServiceLocator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public T GetService<T>(string dbProvider, string dbConnectionString) where T : n
1919
return serviceProvider.GetRequiredService<T>();
2020
}
2121

22-
private IServiceCollection ConfigureServices(string dbProvider, string dbConnectionString)
22+
private static IServiceCollection ConfigureServices(string dbProvider, string dbConnectionString)
2323
{
2424
var services = new ServiceCollection();
2525
services

Applications/AdminUi/apps/admin_ui/lib/screens/splash_screen.dart

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,22 @@ class _SplashScreenState extends State<SplashScreen> {
4545
await GetIt.I.allReady();
4646
final sp = await SharedPreferences.getInstance();
4747

48-
if (!sp.containsKey('api_key')) return _navigate('/login');
48+
if (!sp.containsKey('api_key')) return _navigateToLogin();
4949

5050
final apiKey = sp.getString('api_key')!;
5151
const baseUrl = kIsWeb ? '' : String.fromEnvironment('base_url');
5252

5353
final isValid = await AdminApiClient.validateApiKey(baseUrl: baseUrl, apiKey: apiKey);
54-
if (!isValid) return _navigate('/login');
54+
if (!isValid) return _navigateToLogin();
5555

5656
GetIt.I.registerSingleton(await AdminApiClient.create(baseUrl: baseUrl, apiKey: apiKey));
57-
return _navigate('/identities');
58-
}
5957

60-
void _navigate(String defaultRoute) {
6158
if (!mounted) return;
6259

6360
if (widget.redirect != null) return context.go(Uri.decodeComponent(widget.redirect!));
6461

65-
context.go(defaultRoute);
62+
context.go('/identities');
6663
}
64+
65+
void _navigateToLogin() => context.go(widget.redirect != null ? '/login?redirect=${widget.redirect!}' : '/login');
6766
}

0 commit comments

Comments
 (0)