Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit e15a622

Browse files
authored
Merge pull request #2012 from erjain/net7-duende-fix
update to Net7 and Duende IdentityServer 6.2
2 parents 4596d7a + 0f2ade4 commit e15a622

File tree

187 files changed

+3149
-5070
lines changed

Some content is hidden

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

187 files changed

+3149
-5070
lines changed

.github/workflows/catalog-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
env:
2323
SERVICE: catalog-api
2424
IMAGE: catalog.api
25-
DOTNET_VERSION: 6.0.x
25+
DOTNET_VERSION: 7.0.x
2626
PROJECT_PATH: Services/Catalog/Catalog.API
2727
TESTS_PATH: Services/Catalog/Catalog.UnitTests
2828

.github/workflows/ordering-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222
env:
2323
SERVICE: ordering-api
2424
IMAGE: ordering.api
25-
DOTNET_VERSION: 6.0.x
25+
DOTNET_VERSION: 7.0.x
2626
PROJECT_PATH: Services/Ordering/Ordering.API
2727
TESTS_PATH: Services/Ordering/Ordering.UnitTests
2828

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
1+
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
22
WORKDIR /app
33
EXPOSE 80
44

5-
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
5+
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
66
WORKDIR /src
77

88
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:6.0
1+
FROM mcr.microsoft.com/dotnet/sdk:7.0
22
ARG BUILD_CONFIGURATION=Debug
33
ENV ASPNETCORE_ENVIRONMENT=Development
44
ENV DOTNET_USE_POLLING_FILE_WATCHER=true

src/ApiGateways/Mobile.Bff.Shopping/aggregator/GlobalUsings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@
3939
global using System.Threading.Tasks;
4040
global using System.Threading;
4141
global using System;
42+
global using Microsoft.IdentityModel.Tokens;

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net7.0</TargetFramework>
55
<AssemblyName>Mobile.Shopping.HttpAggregator</AssemblyName>
66
<RootNamespace>Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator</RootNamespace>
77
<DockerComposeProjectPath>..\..\..\docker-compose.dcproj</DockerComposeProjectPath>
@@ -14,19 +14,20 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="5.0.1" />
18-
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="5.0.1" />
19-
<PackageReference Include="Google.Protobuf" Version="3.15.0" />
20-
<PackageReference Include="Grpc.AspNetCore.Server.ClientFactory" Version="2.34.0" />
21-
<PackageReference Include="Grpc.Core" Version="2.34.0" />
22-
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.34.0" />
23-
<PackageReference Include="Grpc.Tools" Version="2.34.0" PrivateAssets="All" />
24-
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.9" />
17+
<PackageReference Include="AspNetCore.HealthChecks.UI.Client" Version="6.0.5" />
18+
<PackageReference Include="AspNetCore.HealthChecks.Uris" Version="6.0.3" />
19+
<PackageReference Include="Google.Protobuf" Version="3.21.9" />
20+
<PackageReference Include="Grpc.AspNetCore.Server.ClientFactory" Version="2.50.0" />
21+
<PackageReference Include="Grpc.Core" Version="2.46.5" />
22+
<PackageReference Include="Grpc.Net.ClientFactory" Version="2.50.0" />
23+
<PackageReference Include="Grpc.Tools" Version="2.51.0-pre1" PrivateAssets="All" />
24+
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.0" />
25+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.0" />
2526
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.HealthChecks" Version="2.2.0" />
26-
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="5.0.2" />
27-
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
28-
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00834" />
29-
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
27+
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks" Version="7.0.0" />
28+
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0-dev-00289" />
29+
<PackageReference Include="Serilog.Sinks.Console" Version="4.1.1-dev-00896" />
30+
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
3031
</ItemGroup>
3132

3233
<ItemGroup>

src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator;
1+
using Microsoft.AspNetCore.Authentication.Cookies;
2+
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
3+
4+
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator;
25

36
public class Startup
47
{
@@ -86,7 +89,7 @@ public static IServiceCollection AddCustomMvc(this IServiceCollection services,
8689

8790
services.AddSwaggerGen(options =>
8891
{
89-
options.DescribeAllEnumsAsStrings();
92+
//options.DescribeAllEnumsAsStrings();
9093
options.SwaggerDoc("v1", new OpenApiInfo
9194
{
9295
Title = "Shopping Aggregator for Mobile Clients",
@@ -143,10 +146,26 @@ public static IServiceCollection AddCustomAuthentication(this IServiceCollection
143146
options.Authority = identityUrl;
144147
options.RequireHttpsMetadata = false;
145148
options.Audience = "mobileshoppingagg";
149+
options.TokenValidationParameters = new TokenValidationParameters
150+
{
151+
ValidateAudience = false
152+
};
146153
});
147154

148155
return services;
149156
}
157+
public static IServiceCollection AddCustomAuthorization(this IServiceCollection services, IConfiguration configuration)
158+
{
159+
services.AddAuthorization(options =>
160+
{
161+
options.AddPolicy("ApiScope", policy =>
162+
{
163+
policy.RequireAuthenticatedUser();
164+
policy.RequireClaim("scope", "mobileshoppingagg");
165+
});
166+
});
167+
return services;
168+
}
150169

151170
public static IServiceCollection AddHttpServices(this IServiceCollection services)
152171
{

src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
1+
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
22
WORKDIR /app
33
EXPOSE 80
44

5-
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
5+
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
66
WORKDIR /src
77

88
# It's important to keep lines from here down to "COPY . ." identical in all Dockerfiles

src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM mcr.microsoft.com/dotnet/sdk:6.0
1+
FROM mcr.microsoft.com/dotnet/sdk:7.0
22
ARG BUILD_CONFIGURATION=Debug
33
ENV ASPNETCORE_ENVIRONMENT=Development
44
ENV DOTNET_USE_POLLING_FILE_WATCHER=true

src/ApiGateways/Web.Bff.Shopping/aggregator/GlobalUsings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@
3939
global using System.Threading.Tasks;
4040
global using System.Threading;
4141
global using System;
42+
global using Microsoft.IdentityModel.Tokens;

0 commit comments

Comments
 (0)