Skip to content

Commit

Permalink
Merge pull request #105 from DuendeSoftware/dom/v2
Browse files Browse the repository at this point in the history
v2
  • Loading branch information
brockallen committed Jun 23, 2022
2 parents 1995473 + 093b0a3 commit 0ad3cde
Show file tree
Hide file tree
Showing 31 changed files with 37 additions and 249 deletions.
2 changes: 1 addition & 1 deletion .run/JS (EF).run.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="JS (EF)" type="LaunchSettings" factoryName=".NET Launch Settings Profile">
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/samples/JS5.EF/JS5.EF.csproj" />
<option name="LAUNCH_PROFILE_PROJECT_FILE_PATH" value="$PROJECT_DIR$/samples/JS6.EF/JS6.EF.csproj" />
<option name="LAUNCH_PROFILE_TFM" value="net5.0" />
<option name="LAUNCH_PROFILE_NAME" value="Host5.EntityFramework" />
<option name="USE_EXTERNAL_CONSOLE" value="0" />
Expand Down
80 changes: 1 addition & 79 deletions Duende.Bff.sln
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{3C549079-A50
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E14F66D1-EA3E-40C6-835A-91A4382D4646}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JS5", "samples\JS5\JS5.csproj", "{8850BAB7-F536-4860-9CD3-A760FEDF8F66}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Api", "samples\Api\Api.csproj", "{887A9E11-12C3-4EB9-81CB-EB11EE27860B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServer", "samples\IdentityServer\IdentityServer.csproj", "{CE1159B9-F763-4C32-828A-77529A820415}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Blazor5", "Blazor5", "{3E17088E-56DA-42CB-97CE-E5E683B14D92}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Shared", "samples\Blazor5\Shared\Blazor.Shared.csproj", "{0084741A-23E4-4AF7-BB4F-112F17D54C42}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Client", "samples\Blazor5\Client\Blazor.Client.csproj", "{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Blazor.Server", "samples\Blazor5\Server\Blazor.Server.csproj", "{06018433-2F98-4238-B1CF-673117FEDAD4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{B2A776DB-385B-4AD4-96A5-61746FD909C3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Duende.Bff.Tests", "test\Duende.Bff.Tests\Duende.Bff.Tests.csproj", "{FB30F557-D861-428B-A05D-49AE57F00EA4}"
Expand All @@ -35,9 +25,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "migrations", "migrations",
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UserSessionDb", "migrations\UserSessionDb\UserSessionDb.csproj", "{F01EA18D-DAA2-41A3-B6B4-5F7B185C3525}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JS5.EF", "samples\JS5.EF\JS5.EF.csproj", "{8BAC820F-4969-42B6-8605-DDE76BE39444}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JS3", "samples\JS3\JS3.csproj", "{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JS6.EF", "samples\JS6.EF\JS6.EF.csproj", "{8BAC820F-4969-42B6-8605-DDE76BE39444}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JS.Yarp", "samples\JS.Yarp\JS.Yarp.csproj", "{7ACD3916-576B-4C5F-B2A9-4617535E95ED}"
EndProject
Expand Down Expand Up @@ -75,18 +63,6 @@ Global
{63FD9C99-C538-44BF-9AD4-D892775E336B}.Release|x64.Build.0 = Release|Any CPU
{63FD9C99-C538-44BF-9AD4-D892775E336B}.Release|x86.ActiveCfg = Release|Any CPU
{63FD9C99-C538-44BF-9AD4-D892775E336B}.Release|x86.Build.0 = Release|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Debug|x64.ActiveCfg = Debug|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Debug|x64.Build.0 = Debug|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Debug|x86.ActiveCfg = Debug|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Debug|x86.Build.0 = Debug|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Release|Any CPU.Build.0 = Release|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Release|x64.ActiveCfg = Release|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Release|x64.Build.0 = Release|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Release|x86.ActiveCfg = Release|Any CPU
{8850BAB7-F536-4860-9CD3-A760FEDF8F66}.Release|x86.Build.0 = Release|Any CPU
{887A9E11-12C3-4EB9-81CB-EB11EE27860B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{887A9E11-12C3-4EB9-81CB-EB11EE27860B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{887A9E11-12C3-4EB9-81CB-EB11EE27860B}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand All @@ -111,42 +87,6 @@ Global
{CE1159B9-F763-4C32-828A-77529A820415}.Release|x64.Build.0 = Release|Any CPU
{CE1159B9-F763-4C32-828A-77529A820415}.Release|x86.ActiveCfg = Release|Any CPU
{CE1159B9-F763-4C32-828A-77529A820415}.Release|x86.Build.0 = Release|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Debug|x64.ActiveCfg = Debug|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Debug|x64.Build.0 = Debug|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Debug|x86.ActiveCfg = Debug|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Debug|x86.Build.0 = Debug|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Release|Any CPU.Build.0 = Release|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Release|x64.ActiveCfg = Release|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Release|x64.Build.0 = Release|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Release|x86.ActiveCfg = Release|Any CPU
{0084741A-23E4-4AF7-BB4F-112F17D54C42}.Release|x86.Build.0 = Release|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Debug|Any CPU.Build.0 = Debug|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Debug|x64.ActiveCfg = Debug|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Debug|x64.Build.0 = Debug|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Debug|x86.ActiveCfg = Debug|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Debug|x86.Build.0 = Debug|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Release|Any CPU.ActiveCfg = Release|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Release|Any CPU.Build.0 = Release|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Release|x64.ActiveCfg = Release|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Release|x64.Build.0 = Release|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Release|x86.ActiveCfg = Release|Any CPU
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98}.Release|x86.Build.0 = Release|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Debug|x64.ActiveCfg = Debug|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Debug|x64.Build.0 = Debug|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Debug|x86.ActiveCfg = Debug|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Debug|x86.Build.0 = Debug|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Release|Any CPU.Build.0 = Release|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Release|x64.ActiveCfg = Release|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Release|x64.Build.0 = Release|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Release|x86.ActiveCfg = Release|Any CPU
{06018433-2F98-4238-B1CF-673117FEDAD4}.Release|x86.Build.0 = Release|Any CPU
{FB30F557-D861-428B-A05D-49AE57F00EA4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB30F557-D861-428B-A05D-49AE57F00EA4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB30F557-D861-428B-A05D-49AE57F00EA4}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -207,18 +147,6 @@ Global
{8BAC820F-4969-42B6-8605-DDE76BE39444}.Release|x64.Build.0 = Release|Any CPU
{8BAC820F-4969-42B6-8605-DDE76BE39444}.Release|x86.ActiveCfg = Release|Any CPU
{8BAC820F-4969-42B6-8605-DDE76BE39444}.Release|x86.Build.0 = Release|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Debug|x64.ActiveCfg = Debug|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Debug|x64.Build.0 = Debug|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Debug|x86.ActiveCfg = Debug|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Debug|x86.Build.0 = Debug|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Release|Any CPU.Build.0 = Release|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Release|x64.ActiveCfg = Release|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Release|x64.Build.0 = Release|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Release|x86.ActiveCfg = Release|Any CPU
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6}.Release|x86.Build.0 = Release|Any CPU
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7ACD3916-576B-4C5F-B2A9-4617535E95ED}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -297,19 +225,13 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{63FD9C99-C538-44BF-9AD4-D892775E336B} = {3C549079-A502-4B40-B051-5278915AE91B}
{8850BAB7-F536-4860-9CD3-A760FEDF8F66} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
{887A9E11-12C3-4EB9-81CB-EB11EE27860B} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
{CE1159B9-F763-4C32-828A-77529A820415} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
{3E17088E-56DA-42CB-97CE-E5E683B14D92} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
{0084741A-23E4-4AF7-BB4F-112F17D54C42} = {3E17088E-56DA-42CB-97CE-E5E683B14D92}
{856A4A2A-E045-4AC4-A14B-B99E8BE1EE98} = {3E17088E-56DA-42CB-97CE-E5E683B14D92}
{06018433-2F98-4238-B1CF-673117FEDAD4} = {3E17088E-56DA-42CB-97CE-E5E683B14D92}
{FB30F557-D861-428B-A05D-49AE57F00EA4} = {B2A776DB-385B-4AD4-96A5-61746FD909C3}
{8A1331D1-BAC3-4DD9-B16E-BB04BEE46D0A} = {3C549079-A502-4B40-B051-5278915AE91B}
{93B5A99A-B7D8-4412-A801-BE6572157CFA} = {B2A776DB-385B-4AD4-96A5-61746FD909C3}
{F01EA18D-DAA2-41A3-B6B4-5F7B185C3525} = {439382D9-7230-4AD0-A82F-956020041BDD}
{8BAC820F-4969-42B6-8605-DDE76BE39444} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
{8F6A8C7F-F400-4CF6-B5F8-3E2CE231D8B6} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
{7ACD3916-576B-4C5F-B2A9-4617535E95ED} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
{E2D87CB5-8F05-4629-84FF-4B44CF86EDA4} = {3C549079-A502-4B40-B051-5278915AE91B}
{DD4052E0-5BA6-46DF-B13E-887EC8B45A77} = {E14F66D1-EA3E-40C6-835A-91A4382D4646}
Expand Down
8 changes: 4 additions & 4 deletions migrations/UserSessionDb/UserSessionDb.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.0">
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
</ItemGroup>
</Project>
4 changes: 2 additions & 2 deletions samples/IdentityServer/IdentityServer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer" Version="6.0.0-preview.5" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Duende.IdentityServer" Version="6.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
</ItemGroup>

</Project>
11 changes: 5 additions & 6 deletions samples/JS5.EF/JS5.EF.csproj → samples/JS6.EF/JS6.EF.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<RootNamespace>Host5.EntityFramework</RootNamespace>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="4.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="6.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 3 additions & 11 deletions src/Duende.Bff.EntityFramework/Duende.Bff.EntityFramework.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>

Expand Down Expand Up @@ -39,21 +39,13 @@
<None Include="../../icon.png" Pack="true" Visible="false" PackagePath="" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="3.0.0-alpha.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.0" PrivateAssets="All" />
<PackageReference Include="MinVer" Version="4.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

</Project>
12 changes: 2 additions & 10 deletions src/Duende.Bff.Yarp/DefaultHttpMessageInvokerFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,8 @@ public virtual HttpMessageInvoker CreateClient(string localPath)
AutomaticDecompression = DecompressionMethods.None,
UseCookies = false
};
#if !NET6_0_OR_GREATER
// propagates the current Activity to the downstream service on .NET Core 3.1 and 5.0
var handler = new ActivityPropagationHandler(socketsHandler);
return new HttpMessageInvoker(handler);
#else
// for .NET 6+ this feature is built-in to SocketsHandler directly
return new HttpMessageInvoker(socketsHandler);
#endif
return new HttpMessageInvoker(socketsHandler);
});
}
}
4 changes: 2 additions & 2 deletions src/Duende.Bff.Yarp/Duende.Bff.Yarp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -31,7 +31,7 @@

<ItemGroup>
<PackageReference Include="Yarp.ReverseProxy" Version="1.0.1" />
<PackageReference Include="MinVer" Version="3.0.0" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="4.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

Expand Down
24 changes: 0 additions & 24 deletions src/Duende.Bff/BffMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,30 +81,6 @@ public async Task Invoke(HttpContext context)
}
}

#if NETCOREAPP3_1
context.Response.OnStarting(() =>
{
// outbound: for .NET Core 3.1 - we assume that an API will never return a 302
// if a 302 is returned, that must be the challenge to the OIDC provider
// we convert this to a 401
// in .NET 5 we can use the AuthorizationMiddlewareResultHandler for this logic
var remoteEndoint = endpoint.Metadata.GetMetadata<BffRemoteApiEndpointMetadata>();
var localEndoint = endpoint.Metadata.GetMetadata<BffApiAttribute>();
if (localEndoint != null || remoteEndoint != null)
{
if (context.Response.StatusCode == 302)
{
context.Response.StatusCode = 401;
context.Response.Headers.Remove("Location");
context.Response.Headers.Remove("Set-Cookie");
}
}
return Task.CompletedTask;
});
#endif

await _next(context);
}
}
16 changes: 5 additions & 11 deletions src/Duende.Bff/BffServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public static BffBuilder AddBff(this IServiceCollection services, Action<BffOpti
}
else
{
services.AddAccessTokenManagement();
services.AddAccessTokenManagement();
}

// management endpoints
services.AddTransient<ILoginService, DefaultLoginService>();
services.AddTransient<ISilentLoginService, DefaultSilentLoginService>();
Expand All @@ -46,23 +46,17 @@ public static BffBuilder AddBff(this IServiceCollection services, Action<BffOpti
services.AddTransient<IUserService, DefaultUserService>();
services.AddTransient<IBackchannelLogoutService, DefaultBackchannelLogoutService>();
services.AddTransient<IDiagnosticsService, DefaultDiagnosticsService>();

// session management
services.TryAddTransient<ISessionRevocationService, NopSessionRevocationService>();

// cookie configuration
#if NET6_0_OR_GREATER
services.AddSingleton<IPostConfigureOptions<CookieAuthenticationOptions>, PostConfigureSlidingExpirationCheck>();
#else
services.AddSingleton<IPostConfigureOptions<CookieAuthenticationOptions>, PostConfigureApplicationValidatePrincipal>();
#endif

services.AddSingleton<IPostConfigureOptions<CookieAuthenticationOptions>, PostConfigureSlidingExpirationCheck>();
services.AddSingleton<IPostConfigureOptions<CookieAuthenticationOptions>, PostConfigureApplicationCookieRevokeRefreshToken>();

services.AddSingleton<IPostConfigureOptions<OpenIdConnectOptions>, PostConfigureOidcOptionsForSilentLogin>();

#if NET5_0_OR_GREATER
services.AddTransient<IAuthorizationMiddlewareResultHandler, BffAuthorizationMiddlewareResultHandler>();
#endif

return new BffBuilder(services);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Duende.Bff/Duende.Bff.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks>net6.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand Down Expand Up @@ -34,7 +34,7 @@

<PackageReference Include="IdentityModel.AspNetCore" Version="4.2.0" />

<PackageReference Include="MinVer" Version="3.0.0" PrivateAssets="all" />
<PackageReference Include="MinVer" Version="4.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
</ItemGroup>

Expand Down
Loading

0 comments on commit 0ad3cde

Please sign in to comment.