Skip to content

Commit 41354cf

Browse files
committed
wip
1 parent 32b14d4 commit 41354cf

File tree

21 files changed

+58
-41
lines changed

21 files changed

+58
-41
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
</PropertyGroup>
55

66
<PropertyGroup>
7-
<NullableReferenceTypes>enable</NullableReferenceTypes>
7+
<NullableReferenceTypes>disable</NullableReferenceTypes>
88
</PropertyGroup>
99
</Project>

HwProj.APIGateway/HwProj.APIGateway.API/HwProj.APIGateway.API.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.14" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

HwProj.AuthService/HwProj.AuthService.Client/HwProj.AuthService.Client.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
18+
<PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
1919
</ItemGroup>
2020

2121
</Project>

HwProj.AuthService/HwProj.AuthService.IntegrationTests/HwProj.AuthService.IntegrationTests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
<PackageReference Include="FluentAssertions" Version="6.6.0" />
1212
<PackageReference Include="Google.Apis.Auth" Version="1.54.0" />
1313
<PackageReference Include="Google.Apis.Auth.AspNetCore" Version="1.54.0" />
14-
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="5.3.0" />
14+
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.14.0" />
1515
<PackageReference Include="Moq" Version="4.13.1" />
1616
<PackageReference Include="nunit" Version="3.11.0" />
1717
<PackageReference Include="NUnit3TestAdapter" Version="3.11.0" />
1818
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
19-
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="5.3.0" />
19+
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.14.0" />
2020
</ItemGroup>
2121

2222
<ItemGroup>

HwProj.Common/HwProj.Models/HwProj.Models.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
11-
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="7.0.0" />
10+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.14" />
11+
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="6.0.14" />
1212
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
1313
</ItemGroup>
1414

HwProj.Common/HwProj.Repositories/HwProj.Repositories.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
<Nullable>$(NullableReferenceTypes)</Nullable>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.0" />
9-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
8+
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.14" />
9+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.14" />
1010
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="6.16.1" />
1111
</ItemGroup>
1212
</Project>

HwProj.Common/HwProj.Utils/Configuration/StartupExtensions.cs

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23
using System.Linq;
34
using System.Net.Sockets;
45
using System.Text.Json.Serialization;
@@ -21,13 +22,13 @@
2122

2223
namespace HwProj.Utils.Configuration;
2324

24-
public static class StartupExtensions
25+
public static class StartupExtensions
2526
{
2627
public static IServiceCollection ConfigureHwProjServices(this IServiceCollection services, string serviceName)
2728
{
2829
services.AddAutoMapper(AppDomain.CurrentDomain.GetAssemblies())
2930
.AddCors()
30-
.AddMvc()
31+
.AddControllers()
3132
.AddJsonOptions(options =>
3233
options.JsonSerializerOptions.ReferenceHandler = ReferenceHandler.IgnoreCycles);
3334

@@ -37,17 +38,24 @@ public static IServiceCollection ConfigureHwProjServices(this IServiceCollection
3738

3839
if (serviceName == "API Gateway")
3940
{
40-
c.AddSecurityDefinition("Bearer",
41-
new OpenApiSecurityScheme
41+
var securityScheme = new OpenApiSecurityScheme
42+
{
43+
Name = "Bearer",
44+
Description = "Enter JWT Bearer token _only_",
45+
In = ParameterLocation.Header,
46+
Type = SecuritySchemeType.Http,
47+
Scheme = "bearer",
48+
BearerFormat = "JWT",
49+
Reference = new OpenApiReference
4250
{
43-
In = ParameterLocation.Header,
44-
Description = "Please enter into field the word 'Bearer' following by space and JWT",
45-
Name = "Authorization",
46-
Type = SecuritySchemeType.ApiKey
47-
});
51+
Id = JwtBearerDefaults.AuthenticationScheme,
52+
Type = ReferenceType.SecurityScheme
53+
}
54+
};
55+
c.AddSecurityDefinition(securityScheme.Reference.Id, securityScheme);
4856
c.AddSecurityRequirement(new OpenApiSecurityRequirement
4957
{
50-
{ "Bearer", Enumerable.Empty<string>() },
58+
{ securityScheme, Array.Empty<string>() },
5159
});
5260
}
5361
});
@@ -143,7 +151,9 @@ public static IApplicationBuilder ConfigureHwProj(this IApplicationBuilder app,
143151
.AllowAnyHeader()
144152
.SetIsOriginAllowed(origin => true)
145153
.AllowCredentials());
146-
app.UseMvc();
154+
app.UseRouting();
155+
app.UseAuthorization();
156+
app.UseEndpoints(endpoints => endpoints.MapControllers());
147157

148158
return app;
149159
}

HwProj.Common/HwProj.Utils/HwProj.Utils.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
<ItemGroup>
1010
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
11-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.11" />
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
11+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.14" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.14" />
1313
<PackageReference Include="Swashbuckle.SwaggerConfigurationExtension" Version="2.2.0" />
1414
</ItemGroup>
1515

HwProj.CoursesService/HwProj.CoursesService.API/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ RUN dotnet build "HwProj.CoursesService.API.csproj" -c Release -o /app/build
1818
FROM build AS publish
1919
RUN dotnet publish "HwProj.CoursesService.API.csproj" -c Release -o /app/publish
2020

21-
FROM base AS final
21+
FROM base AS final
2222
WORKDIR /app
2323
COPY --from=publish /app/publish .
2424
ENTRYPOINT ["dotnet", "HwProj.CoursesService.API.dll"]

HwProj.CoursesService/HwProj.CoursesService.API/HwProj.CoursesService.API.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</ItemGroup>
1313
<ItemGroup>
1414
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.0" />
15-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.0" />
15+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.14" />
1616
</ItemGroup>
1717
<ItemGroup>
1818
<ProjectReference Include="..\..\HwProj.AuthService\HwProj.AuthService.Client\HwProj.AuthService.Client.csproj" />

0 commit comments

Comments
 (0)