Skip to content

Commit

Permalink
Merge branch 'main' into introduce-lockfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
tnotheis committed Sep 16, 2024
2 parents 4b2108a + 770c322 commit 97e90da
Show file tree
Hide file tree
Showing 424 changed files with 11,815 additions and 5,517 deletions.
73 changes: 0 additions & 73 deletions .github/dependabot.yml

This file was deleted.

9 changes: 8 additions & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
extends: ["config:recommended"],
labels: ["dependencies"],
schedule: ["after 10pm every weekday", "before 5am every weekday", "every weekend"],
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"
packageRules: [
{
// we don't want to update eslint currently, because there is a breaking change in its config
Expand All @@ -14,7 +15,13 @@
{
// the docker images in this list are created and used by our pipelines and can therefore not to be updated by renovate
matchDatasources: ["docker"],
packageNames: ["admin-ui", "event-handler-service", "sse-server", "database-migrator", "admin-cli"],
packageNames: ["consumer-api", "admin-ui", "event-handler-service", "sse-server", "database-migrator", "admin-cli"],
enabled: false
},
{
// the dart packages in this list is fetched directly from git and therefore doesn't have a version
matchDatasources: ["dart"],
packageNames: ["window_size"],
enabled: false
},

Expand Down
36 changes: 16 additions & 20 deletions Applications/AdminApi/src/AdminApi/AdminApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OData" Version="9.0.0" />
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="9.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageReference Include="OpenIddict.EntityFrameworkCore" Version="5.8.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.23.0" />
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.24.0" />
<PackageReference Include="ReHackt.Extensions.Options.Validation" Version="8.0.2" />
<PackageReference Include="Serilog" Version="4.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.2" />
Expand All @@ -32,21 +28,21 @@
<PackageReference Include="AspNetCore.HealthChecks.SqlServer" Version="8.0.2" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\BuildingBlocks.API\BuildingBlocks.API.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Application\Challenges.Application.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Infrastructure\Challenges.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Application\Devices.Application.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Infrastructure\Devices.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Infrastructure\Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Application\Quotas.Application.csproj" />
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Infrastructure\Quotas.Infrastructure.csproj" />
<ProjectReference Include="..\AdminApi.Infrastructure.Database.Postgres\AdminApi.Infrastructure.Database.Postgres.csproj" />
<ProjectReference Include="..\AdminApi.Infrastructure.Database.SqlServer\AdminApi.Infrastructure.Database.SqlServer.csproj" />
<ProjectReference Include="..\AdminApi.Infrastructure\AdminApi.Infrastructure.csproj" />
<ProjectReference Include="..\..\..\..\BuildingBlocks\src\BuildingBlocks.API\BuildingBlocks.API.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Application\Challenges.Application.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Challenges\src\Challenges.Infrastructure\Challenges.Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Application\Devices.Application.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Devices\src\Devices.Infrastructure\Devices.Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\..\Infrastructure\Infrastructure.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Application\Quotas.Application.csproj"/>
<ProjectReference Include="..\..\..\..\Modules\Quotas\src\Quotas.Infrastructure\Quotas.Infrastructure.csproj"/>
<ProjectReference Include="..\AdminApi.Infrastructure.Database.Postgres\AdminApi.Infrastructure.Database.Postgres.csproj"/>
<ProjectReference Include="..\AdminApi.Infrastructure.Database.SqlServer\AdminApi.Infrastructure.Database.SqlServer.csproj"/>
<ProjectReference Include="..\AdminApi.Infrastructure\AdminApi.Infrastructure.csproj"/>
</ItemGroup>

<Target Name="PreBuild" BeforeTargets="Build" Condition="$(Configuration) == Debug">
<Delete Files="$(ProjectDir)appsettings.override.json" />
<Copy SourceFiles="..\..\..\..\appsettings.override.json" DestinationFolder="$(ProjectDir)" UseHardlinksIfPossible="true" />
<Delete Files="$(ProjectDir)appsettings.override.json"/>
<Copy SourceFiles="..\..\..\..\appsettings.override.json" DestinationFolder="$(ProjectDir)" UseHardlinksIfPossible="true"/>
</Target>
</Project>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,4 @@ public string GetUsername()
{
throw new NotSupportedException();
}

public IEnumerable<string> GetRoles()
{
throw new NotSupportedException();
}

public SubscriptionPlan GetSubscriptionPlan()
{
throw new NotSupportedException();
}
}
2 changes: 1 addition & 1 deletion Applications/AdminApi/src/AdminApi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ RUN dotnet publish /p:ContinuousIntegrationBuild=true /p:UseAppHost=false --no-r
RUN dotnet publish /p:ContinuousIntegrationBuild=true --configuration Release --output /app/publish/health "/src/Applications/HealthCheck/src/HealthCheck.csproj"

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

COPY Applications/AdminUi /src
WORKDIR /src
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,12 @@ public static IServiceCollection AddCustomAspNetCore(this IServiceCollection ser
opts => opts.ApiKey = configuration.Authentication.ApiKey
);

services.AddAuthorization(options =>
{
options.AddPolicy("ApiKey", policy =>
services.AddAuthorizationBuilder()
.AddPolicy("ApiKey", policy =>
{
policy.AddAuthenticationSchemes("ApiKey");
policy.RequireAuthenticatedUser();
});
});

services.AddAntiforgery(o =>
{
Expand Down
2 changes: 1 addition & 1 deletion Applications/AdminApi/src/AdminApi/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static WebApplication CreateApp(string[] args)
.Enrich.WithProperty("service", "adminui")
.Enrich.WithExceptionDetails(new DestructuringOptionsBuilder()
.WithDefaultDestructurers()
.WithDestructurers(new[] { new DbUpdateExceptionDestructurer() }))
.WithDestructurers([new DbUpdateExceptionDestructurer()]))
.Enrich.WithSensitiveDataMasking(options => options.AddSensitiveDataMasks()))
.UseServiceProviderFactory(new AutofacServiceProviderFactory());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.8" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NJsonSchema.NewtonsoftJson" Version="11.0.2" />
<PackageReference Include="ReHackt.Extensions.Options.Validation" Version="8.0.2" />
<PackageReference Include="SolidToken.SpecFlow.DependencyInjection" Version="3.9.3" />
<PackageReference Include="SpecFlow.NUnit" Version="3.9.74" />
<PackageReference Include="nunit" Version="4.1.0" />
<PackageReference Include="nunit" Version="4.2.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="FluentAssertions" Version="6.12.1" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.4.1">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ public void ThenTheResponseContentIncludesAnErrorWithTheErrorCode(string errorCo
{
_deleteResponse!.Error.Should().NotBeNull();
_deleteResponse.Error!.Code.Should().Be(errorCode);
;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,10 @@ private async Task CreateClient(string dbProvider, string dbConnectionString, st
{
var mediator = _serviceLocator.GetService<IMediator>(dbProvider, dbConnectionString);

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

Console.WriteLine(JsonSerializer.Serialize(response, JSON_SERIALIZER_OPTIONS));
Console.WriteLine("Please note the secret since you cannot obtain it later.");
Console.WriteLine(@"Please note the secret since you cannot obtain it later.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private async Task DeleteClients(string dbProvider, string dbConnectionString, s
try
{
await mediator.Send(new DeleteClientCommand(clientId), CancellationToken.None);
Console.WriteLine($"Successfully deleted client '{clientId}'");
Console.WriteLine($@"Successfully deleted client '{clientId}'");
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ private async Task ListClients(string dbProvider, string dbConnectionString)

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

Console.WriteLine("The following clients are configured:");
Console.WriteLine(@"The following clients are configured:");

foreach (var client in response)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private async Task ListTiers(string dbProvider, string dbConnectionString)

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

Console.WriteLine("The following tiers are configured:");
Console.WriteLine(@"The following tiers are configured:");

foreach (var client in response)
{
Expand Down
80 changes: 0 additions & 80 deletions Applications/AdminCli/src/AdminCli/ConsoleExtensions.cs

This file was deleted.

2 changes: 1 addition & 1 deletion Applications/AdminCli/src/AdminCli/ServiceLocator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public T GetService<T>(string dbProvider, string dbConnectionString) where T : n
return serviceProvider.GetRequiredService<T>();
}

private IServiceCollection ConfigureServices(string dbProvider, string dbConnectionString)
private static IServiceCollection ConfigureServices(string dbProvider, string dbConnectionString)
{
var services = new ServiceCollection();
services
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,22 @@ class _SplashScreenState extends State<SplashScreen> {
await GetIt.I.allReady();
final sp = await SharedPreferences.getInstance();

if (!sp.containsKey('api_key')) return _navigate('/login');
if (!sp.containsKey('api_key')) return _navigateToLogin();

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

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

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

void _navigate(String defaultRoute) {
if (!mounted) return;

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

context.go(defaultRoute);
context.go('/identities');
}

void _navigateToLogin() => context.go(widget.redirect != null ? '/login?redirect=${widget.redirect!}' : '/login');
}
Loading

0 comments on commit 97e90da

Please sign in to comment.