Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

Commit 00626b2

Browse files
committed
Update dependencies and samples for .NET 9
- Increment EFCoreVersion to 8.0.11: 8.0.10 of the Sql Server provider has a transitive security flaw, so it seems wise to bump this - Remove JS.Yarp sample (the main Bff sample makes API calls with and without YARP) - Rename samples to not include .net version and "JS" everywhere - Multitarget .net 8 and 9 in samples - Separate each sample host to run on a different port
1 parent 6a21563 commit 00626b2

Some content is hidden

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

57 files changed

+192
-739
lines changed

.vscode/launch.json

+72-21
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
// "order": 10
2020
}
2121
},
22+
{
23+
"name": "IdentityServer + All APIs",
24+
"configurations": ["IdentityServer", "Api", "Api with DPoP", "Api with resource isolation"],
25+
"presentation": {
26+
"hidden": false,
27+
"group": "10-compunds",
28+
// "order": 10
29+
}
30+
},
2231
],
2332
"configurations": [
2433
{
@@ -76,7 +85,7 @@
7685
}
7786
},
7887
{
79-
"name": "Isolated Api",
88+
"name": "Api with resource isolation",
8089
"type": "coreclr",
8190
"request": "launch",
8291
"preLaunchTask": "build-api.isolated",
@@ -94,13 +103,13 @@
94103
}
95104
},
96105
{
97-
"name": "JS.Yarp",
106+
"name": "Bff (.NET 8)",
98107
"type": "coreclr",
99108
"request": "launch",
100-
"preLaunchTask": "build-jsyarp",
101-
"program": "${workspaceFolder}/samples/JS.Yarp/bin/Debug/net9.0/JS.Yarp.dll",
109+
"preLaunchTask": "build-bff-8",
110+
"program": "${workspaceFolder}/samples/Bff/bin/Debug/net8.0/Bff.dll",
102111
"args": [],
103-
"cwd": "${workspaceFolder}/samples/JS.Yarp",
112+
"cwd": "${workspaceFolder}/samples/Bff",
104113
"env": {
105114
"ASPNETCORE_ENVIRONMENT": "Development"
106115
},
@@ -111,17 +120,17 @@
111120
"console": "externalTerminal",
112121
"presentation": {
113122
"hidden": false,
114-
"order": 10
123+
"order": 100
115124
}
116125
},
117126
{
118-
"name": "JS8",
127+
"name": "Bff (.NET 9)",
119128
"type": "coreclr",
120129
"request": "launch",
121-
"preLaunchTask": "build-js8",
122-
"program": "${workspaceFolder}/samples/JS8/bin/Debug/net8.0/JS8.dll",
130+
"preLaunchTask": "build-bff-9",
131+
"program": "${workspaceFolder}/samples/Bff/bin/Debug/net9.0/Bff.dll",
123132
"args": [],
124-
"cwd": "${workspaceFolder}/samples/JS8",
133+
"cwd": "${workspaceFolder}/samples/Bff",
125134
"env": {
126135
"ASPNETCORE_ENVIRONMENT": "Development"
127136
},
@@ -136,13 +145,13 @@
136145
}
137146
},
138147
{
139-
"name": "JS8 DPoP",
148+
"name": "Bff DPoP (.NET 8)",
140149
"type": "coreclr",
141150
"request": "launch",
142-
"preLaunchTask": "build-js8dpop",
143-
"program": "${workspaceFolder}/samples/JS8.DPoP/bin/Debug/net8.0/JS8.DPoP.dll",
151+
"preLaunchTask": "build-bffdpop-8",
152+
"program": "${workspaceFolder}/samples/Bff.DPoP/bin/Debug/net8.0/Bff.DPoP.dll",
144153
"args": [],
145-
"cwd": "${workspaceFolder}/samples/JS8.DPoP",
154+
"cwd": "${workspaceFolder}/samples/Bff.DPoP",
146155
"env": {
147156
"ASPNETCORE_ENVIRONMENT": "Development"
148157
},
@@ -153,17 +162,17 @@
153162
"console": "externalTerminal",
154163
"presentation": {
155164
"hidden": false,
156-
"order": 10
165+
"order": 101
157166
}
158167
},
159168
{
160-
"name": "JS8 EF",
169+
"name": "Bff DPoP (.NET 9)",
161170
"type": "coreclr",
162171
"request": "launch",
163-
"preLaunchTask": "build-js8ef",
164-
"program": "${workspaceFolder}/samples/JS8.EF/bin/Debug/net8.0/JS8.EF.dll",
172+
"preLaunchTask": "build-bffdpop-9",
173+
"program": "${workspaceFolder}/samples/Bff.DPoP/bin/Debug/net9.0/Bff.DPoP.dll",
165174
"args": [],
166-
"cwd": "${workspaceFolder}/samples/JS8.EF",
175+
"cwd": "${workspaceFolder}/samples/Bff.DPoP",
167176
"env": {
168177
"ASPNETCORE_ENVIRONMENT": "Development"
169178
},
@@ -174,7 +183,49 @@
174183
"console": "externalTerminal",
175184
"presentation": {
176185
"hidden": false,
177-
"order": 10
186+
"order": 11
187+
}
188+
},
189+
{
190+
"name": "Bff EF (.NET 8)",
191+
"type": "coreclr",
192+
"request": "launch",
193+
"preLaunchTask": "build-bffef-8",
194+
"program": "${workspaceFolder}/samples/Bff.EF/bin/Debug/net8.0/Bff.EF.dll",
195+
"args": [],
196+
"cwd": "${workspaceFolder}/samples/Bff.EF",
197+
"env": {
198+
"ASPNETCORE_ENVIRONMENT": "Development"
199+
},
200+
"serverReadyAction": {
201+
"action": "openExternally",
202+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
203+
},
204+
"console": "externalTerminal",
205+
"presentation": {
206+
"hidden": false,
207+
"order": 102
208+
}
209+
},
210+
{
211+
"name": "Bff EF (.NET 9)",
212+
"type": "coreclr",
213+
"request": "launch",
214+
"preLaunchTask": "build-bffef-9",
215+
"program": "${workspaceFolder}/samples/Bff.EF/bin/Debug/net9.0/Bff.EF.dll",
216+
"args": [],
217+
"cwd": "${workspaceFolder}/samples/Bff.EF",
218+
"env": {
219+
"ASPNETCORE_ENVIRONMENT": "Development"
220+
},
221+
"serverReadyAction": {
222+
"action": "openExternally",
223+
"pattern": "\\bNow listening on:\\s+(https?://\\S+)"
224+
},
225+
"console": "externalTerminal",
226+
"presentation": {
227+
"hidden": false,
228+
"order": 12
178229
}
179230
},
180231
{
@@ -195,7 +246,7 @@
195246
"console": "externalTerminal",
196247
"presentation": {
197248
"hidden": false,
198-
"order": 10
249+
"order": 50
199250
}
200251
}
201252
]

.vscode/tasks.json

+28-10
Original file line numberDiff line numberDiff line change
@@ -62,60 +62,78 @@
6262
"problemMatcher": "$msCompile"
6363
},
6464
{
65-
"label": "build-jsyarp",
65+
"label": "build-bff-8",
6666
"type": "process",
6767
"command": "dotnet",
6868
"args": [
6969
"build",
70-
"${workspaceFolder}/samples/JS.Yarp/JS.Yarp.csproj",
70+
"--framework=net8.0",
71+
"${workspaceFolder}/samples/Bff/Bff.csproj",
7172
"/property:GenerateFullPaths=true",
7273
"/consoleloggerparameters:NoSummary"
7374
],
7475
"problemMatcher": "$msCompile"
7576
},
7677
{
77-
"label": "build-js8",
78+
"label": "build-bff-9",
7879
"type": "process",
7980
"command": "dotnet",
8081
"args": [
8182
"build",
82-
"${workspaceFolder}/samples/JS8/JS8.csproj",
83+
"--framework=net9.0",
84+
"${workspaceFolder}/samples/Bff/Bff.csproj",
8385
"/property:GenerateFullPaths=true",
8486
"/consoleloggerparameters:NoSummary"
8587
],
8688
"problemMatcher": "$msCompile"
8789
},
8890
{
89-
"label": "build-jsyarp",
91+
"label": "build-bffdpop-8",
9092
"type": "process",
9193
"command": "dotnet",
9294
"args": [
9395
"build",
94-
"${workspaceFolder}/samples/JS.Yarp/JS.Yarp.csproj",
96+
"--framework=net8.0",
97+
"${workspaceFolder}/samples/Bff.DPoP/Bff.DPoP.csproj",
9598
"/property:GenerateFullPaths=true",
9699
"/consoleloggerparameters:NoSummary"
97100
],
98101
"problemMatcher": "$msCompile"
99102
},
100103
{
101-
"label": "build-js8dpop",
104+
"label": "build-bffdpop-9",
102105
"type": "process",
103106
"command": "dotnet",
104107
"args": [
105108
"build",
106-
"${workspaceFolder}/samples/JS8.DPoP/JS8.DPoP.csproj",
109+
"--framework=net9.0",
110+
"${workspaceFolder}/samples/Bff.DPoP/Bff.DPoP.csproj",
107111
"/property:GenerateFullPaths=true",
108112
"/consoleloggerparameters:NoSummary"
109113
],
110114
"problemMatcher": "$msCompile"
111115
},
112116
{
113-
"label": "build-js8ef",
117+
"label": "build-bffef-8",
114118
"type": "process",
115119
"command": "dotnet",
116120
"args": [
117121
"build",
118-
"${workspaceFolder}/samples/JS8.EF/JS8.EF.csproj",
122+
"--framework=net8.0",
123+
"${workspaceFolder}/samples/Bff.EF/Bff.EF.csproj",
124+
"/property:GenerateFullPaths=true",
125+
"/consoleloggerparameters:NoSummary"
126+
],
127+
"problemMatcher": "$msCompile"
128+
},
129+
{
130+
"label": "build-bffef-9",
131+
"type": "process",
132+
"command": "dotnet",
133+
"args": [
134+
"build",
135+
"--framework=net9.0",
136+
"${workspaceFolder}/samples/Bff.EF/Bff.EF.csproj",
119137
"/property:GenerateFullPaths=true",
120138
"/consoleloggerparameters:NoSummary"
121139
],

Directory.Build.targets

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
<Project>
22
<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0'">
33
<AspNetCoreVersion>8.0.1</AspNetCoreVersion>
4-
<!-- Need EF to be at least 8.0.10 so that 'Microsoft.Extensions.Caching.Memory' is at least 8.0.1, which addresses a known high severity vulnerability -->
5-
<EFCoreVersion>8.0.10</EFCoreVersion>
4+
<!-- EF must be at least 8.0.10 so that 'Microsoft.Extensions.Caching.Memory'
5+
is at least 8.0.1, which addresses a known high severity vulnerability.
6+
The SQL Server EF provider that is commonly used has a transitive
7+
vulnerability in 8.0.10 that is fixed in 8.0.11, so going to 8.0.11 seems
8+
prudent. -->
9+
<EFCoreVersion>8.0.11</EFCoreVersion>
610
<IdentityServerVersion>7.1.0-rc.1</IdentityServerVersion>
711
<MicrosoftExtensionsVersion>8.0.1</MicrosoftExtensionsVersion>
812
<YarpVersion>2.1.0</YarpVersion>
@@ -35,8 +39,11 @@
3539
<PackageReference Update="Microsoft.AspNetCore.Components.Authorization" Version="$(AspNetCoreVersion)" />
3640

3741
<!-- Entity Framework Core -->
38-
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
42+
<PackageReference Update="Microsoft.EntityFrameworkCore.Design" Version="$(EFCoreVersion)" />
3943
<PackageReference Update="Microsoft.EntityFrameworkCore.InMemory" Version="$(EFCoreVersion)" />
44+
<PackageReference Update="Microsoft.EntityFrameworkCore.Relational" Version="$(EFCoreVersion)" />
45+
<PackageReference Update="Microsoft.EntityFrameworkCore.Sqlite" Version="$(EFCoreVersion)" />
46+
<PackageReference Update="Microsoft.EntityFrameworkCore.SqlServer" Version="$(EFCoreVersion)" />
4047

4148
<!-- Microsoft Extensions -->
4249
<PackageReference Update="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionsVersion)" />

Duende.Bff.sln

+3-18
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,17 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "migrations", "migrations",
2525
EndProject
2626
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UserSessionDb", "migrations\UserSessionDb\UserSessionDb.csproj", "{F01EA18D-DAA2-41A3-B6B4-5F7B185C3525}"
2727
EndProject
28-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JS.Yarp", "samples\JS.Yarp\JS.Yarp.csproj", "{7ACD3916-576B-4C5F-B2A9-4617535E95ED}"
29-
EndProject
3028
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Duende.Bff.Yarp", "src\Duende.Bff.Yarp\Duende.Bff.Yarp.csproj", "{E2D87CB5-8F05-4629-84FF-4B44CF86EDA4}"
3129
EndProject
3230
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api.DPoP", "samples\Api.DPoP\Api.DPoP.csproj", "{E1305546-C5C3-4D10-A0AD-F81DF057B2E2}"
3331
EndProject
3432
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api.Isolated", "samples\Api.Isolated\Api.Isolated.csproj", "{399929C6-47FF-4A45-9BEA-B70FFC1EDE69}"
3533
EndProject
36-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JS8", "samples\JS8\JS8.csproj", "{B37CA136-3F20-4D8A-9677-E3A9C9D893EF}"
34+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bff", "samples\Bff\Bff.csproj", "{B37CA136-3F20-4D8A-9677-E3A9C9D893EF}"
3735
EndProject
38-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JS8.DPoP", "samples\JS8.DPoP\JS8.DPoP.csproj", "{D8757F0F-254E-495F-961F-0192F8C97E3F}"
36+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bff.DPoP", "samples\Bff.DPoP\Bff.DPoP.csproj", "{D8757F0F-254E-495F-961F-0192F8C97E3F}"
3937
EndProject
40-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JS8.EF", "samples\JS8.EF\JS8.EF.csproj", "{CBB98134-92F5-487D-8CA3-84C19FF46775}"
38+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bff.EF", "samples\Bff.EF\Bff.EF.csproj", "{CBB98134-92F5-487D-8CA3-84C19FF46775}"
4139
EndProject
4240
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Blazor.Wasm", "Blazor.Wasm", "{7E6EA8BA-EE8B-450E-AE89-C4604C0DD326}"
4341
EndProject
@@ -139,18 +137,6 @@ Global
139137
{F01EA18D-DAA2-41A3-B6B4-5F7B185C3525}.Release|x64.Build.0 = Release|Any CPU
140138
{F01EA18D-DAA2-41A3-B6B4-5F7B185C3525}.Release|x86.ActiveCfg = Release|Any CPU
141139
{F01EA18D-DAA2-41A3-B6B4-5F7B185C3525}.Release|x86.Build.0 = Release|Any CPU
142-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
143-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
144-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|x64.ActiveCfg = Debug|Any CPU
145-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|x64.Build.0 = Debug|Any CPU
146-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|x86.ActiveCfg = Debug|Any CPU
147-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|x86.Build.0 = Debug|Any CPU
148-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
149-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Release|Any CPU.Build.0 = Release|Any CPU
150-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Release|x64.ActiveCfg = Release|Any CPU
151-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Release|x64.Build.0 = Release|Any CPU
152-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Release|x86.ActiveCfg = Release|Any CPU
153-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Release|x86.Build.0 = Release|Any CPU
154140
{E2D87CB5-8F05-4629-84FF-4B44CF86EDA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
155141
{E2D87CB5-8F05-4629-84FF-4B44CF86EDA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
156142
{E2D87CB5-8F05-4629-84FF-4B44CF86EDA4}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -259,7 +245,6 @@ Global
259245
{8A1331D1-BAC3-4DD9-B16E-BB04BEE46D0A} = {3C549079-A502-4B40-B051-5278915AE91B}
260246
{93B5A99A-B7D8-4412-A801-BE6572157CFA} = {B2A776DB-385B-4AD4-96A5-61746FD909C3}
261247
{F01EA18D-DAA2-41A3-B6B4-5F7B185C3525} = {439382D9-7230-4AD0-A82F-956020041BDD}
262-
{7ACD3916-576B-4C5F-B2A9-4617535E95ED} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
263248
{E2D87CB5-8F05-4629-84FF-4B44CF86EDA4} = {3C549079-A502-4B40-B051-5278915AE91B}
264249
{E1305546-C5C3-4D10-A0AD-F81DF057B2E2} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
265250
{399929C6-47FF-4A45-9BEA-B70FFC1EDE69} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}

migrations/UserSessionDb/Program.cs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
using System;
12
using Duende.Bff.EntityFramework;
23
using Microsoft.AspNetCore.Hosting;
34
using Microsoft.EntityFrameworkCore;
@@ -15,6 +16,7 @@ public static void Main(string[] args)
1516
{
1617
using (var context = scope.ServiceProvider.GetService<SessionDbContext>())
1718
{
19+
Console.WriteLine("MIGRATING"); // TODO
1820
context.Database.Migrate();
1921
}
2022
}

migrations/UserSessionDb/UserSessionDb.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.9">
8+
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" >
99
<PrivateAssets>all</PrivateAssets>
1010
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1111
</PackageReference>
12-
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.11" />
13-
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.11" />
12+
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" />
13+
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" />
1414
</ItemGroup>
1515

1616
<ItemGroup>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"ConnectionStrings": {
33
//"db": "server=(localdb)\\mssqllocaldb;database=Duende.BFF;trusted_connection=yes;"
4-
"db": "Data Source=../../samples/JS6.EF/Duende.BFF.db;"
4+
"db": "Data Source=../../samples/Bff.EF/Duende.BFF.db;"
55
}
66
}

samples/JS8.DPoP/JS8.DPoP.csproj samples/Bff.DPoP/Bff.DPoP.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
5-
<RootNamespace>Host8</RootNamespace>
4+
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
5+
<RootNamespace>Bff.DPoP</RootNamespace>
66
<Nullable>enable</Nullable>
77
</PropertyGroup>
88

samples/JS8.DPoP/LocalApiController.cs samples/Bff.DPoP/LocalApiController.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using System.Threading.Tasks;
88
using Microsoft.AspNetCore.Mvc;
99

10-
namespace JS8.DPoP;
10+
namespace Bff.DPoP;
1111
[Route("local")]
1212
public class LocalApiController : ControllerBase
1313
{

0 commit comments

Comments
 (0)