From 0f96dcc47a0cfd3e6351cfece855d77b8a059197 Mon Sep 17 00:00:00 2001 From: Damian Hickey Date: Tue, 1 Oct 2024 16:47:36 +0200 Subject: [PATCH] Remove Duende.Bff.Shared - Move the types in shared into Duende.Bff/Shared and make them `internal` - Duende.Bff.Blazor.Client includes these types as linked files - Add InternalsVisibileTo to Duende.Bff.Blazor in Duende.BFF so it can continue to use these shared types. --- Duende.Bff.sln | 17 +---------------- .../Duende.Bff.Blazor.Client.csproj | 12 ++++++++---- src/Duende.Bff.Shared/Duende.Bff.Shared.csproj | 10 ---------- src/Duende.Bff.Shared/README.md | 9 --------- src/Duende.Bff/Duende.Bff.csproj | 5 +++-- .../AuthenticationTicketExtensions.cs | 2 +- .../Shared}/ClaimLite.cs | 2 +- .../Shared}/ClaimsLiteExtensions.cs | 3 ++- .../Shared}/ClaimsPrincipalLite.cs | 2 +- 9 files changed, 17 insertions(+), 45 deletions(-) delete mode 100644 src/Duende.Bff.Shared/Duende.Bff.Shared.csproj delete mode 100644 src/Duende.Bff.Shared/README.md rename src/{Duende.Bff.Shared => Duende.Bff/Shared}/ClaimLite.cs (95%) rename src/{Duende.Bff.Shared => Duende.Bff/Shared}/ClaimsLiteExtensions.cs (95%) rename src/{Duende.Bff.Shared => Duende.Bff/Shared}/ClaimsPrincipalLite.cs (95%) diff --git a/Duende.Bff.sln b/Duende.Bff.sln index 96ab8e0..9afb7de 100644 --- a/Duende.Bff.sln +++ b/Duende.Bff.sln @@ -1,6 +1,6 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 +# 17 VisualStudioVersion = 17.9.34414.90 MinimumVisualStudioVersion = 15.0.26124.0 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Duende.Bff", "src\Duende.Bff\Duende.Bff.csproj", "{63FD9C99-C538-44BF-9AD4-D892775E336B}" @@ -63,8 +63,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Duende.Bff.Blazor.Client.Un EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Duende.Bff.Blazor.UnitTests", "test\Duende.Bff.Blazor.UnitTests\Duende.Bff.Blazor.UnitTests.csproj", "{2A04808A-A06C-4F10-87B9-2D12E065F729}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Duende.Bff.Shared", "src\Duende.Bff.Shared\Duende.Bff.Shared.csproj", "{EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -339,18 +337,6 @@ Global {2A04808A-A06C-4F10-87B9-2D12E065F729}.Release|x64.Build.0 = Release|Any CPU {2A04808A-A06C-4F10-87B9-2D12E065F729}.Release|x86.ActiveCfg = Release|Any CPU {2A04808A-A06C-4F10-87B9-2D12E065F729}.Release|x86.Build.0 = Release|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Debug|x64.ActiveCfg = Debug|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Debug|x64.Build.0 = Debug|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Debug|x86.ActiveCfg = Debug|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Debug|x86.Build.0 = Debug|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Release|Any CPU.Build.0 = Release|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Release|x64.ActiveCfg = Release|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Release|x64.Build.0 = Release|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Release|x86.ActiveCfg = Release|Any CPU - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -382,7 +368,6 @@ Global {40EDC041-C262-414C-B374-631BF2D1BD97} = {8A0FCD30-A6D9-4622-B4D5-90010DE0795E} {001840D4-8B83-4A8C-AF2C-5429D4F9A370} = {B2A776DB-385B-4AD4-96A5-61746FD909C3} {2A04808A-A06C-4F10-87B9-2D12E065F729} = {B2A776DB-385B-4AD4-96A5-61746FD909C3} - {EDC31C09-611B-4B4A-870B-FE1BD9EF82AB} = {3C549079-A502-4B40-B051-5278915AE91B} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3DAD5980-4688-4794-9CF0-6F3CB67194E7} diff --git a/src/Duende.Bff.Blazor.Client/Duende.Bff.Blazor.Client.csproj b/src/Duende.Bff.Blazor.Client/Duende.Bff.Blazor.Client.csproj index 8ac5946..08c1ea6 100644 --- a/src/Duende.Bff.Blazor.Client/Duende.Bff.Blazor.Client.csproj +++ b/src/Duende.Bff.Blazor.Client/Duende.Bff.Blazor.Client.csproj @@ -6,19 +6,23 @@ enable + + + + + + - - - + - + diff --git a/src/Duende.Bff.Shared/Duende.Bff.Shared.csproj b/src/Duende.Bff.Shared/Duende.Bff.Shared.csproj deleted file mode 100644 index d76ee03..0000000 --- a/src/Duende.Bff.Shared/Duende.Bff.Shared.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - net8.0 - enable - enable - Duende.Bff - - - diff --git a/src/Duende.Bff.Shared/README.md b/src/Duende.Bff.Shared/README.md deleted file mode 100644 index fe78579..0000000 --- a/src/Duende.Bff.Shared/README.md +++ /dev/null @@ -1,9 +0,0 @@ -This project contains code that needs to be shared across Duende.Bff and -Duende.Bff.Blazor.Client. We can't depend on Duende.Bff in -Duende.Bff.Blazor.Client because the Duende.Bff has a framework reference to -aspnetcore and Duende.Bff.Blazor.Client is intended to be consumed in blazor -wasm applications. - -We can't depend on the Duende.Bff.Blazor.Client from Duende.Bff, because that -would bring all the blazor client work into the main package - we want that to -be opt in. \ No newline at end of file diff --git a/src/Duende.Bff/Duende.Bff.csproj b/src/Duende.Bff/Duende.Bff.csproj index 2481630..04586b0 100644 --- a/src/Duende.Bff/Duende.Bff.csproj +++ b/src/Duende.Bff/Duende.Bff.csproj @@ -12,9 +12,10 @@ - + - + + \ No newline at end of file diff --git a/src/Duende.Bff/Extensions/AuthenticationTicketExtensions.cs b/src/Duende.Bff/Extensions/AuthenticationTicketExtensions.cs index dee932a..6511c18 100644 --- a/src/Duende.Bff/Extensions/AuthenticationTicketExtensions.cs +++ b/src/Duende.Bff/Extensions/AuthenticationTicketExtensions.cs @@ -140,7 +140,7 @@ public static string Serialize(this AuthenticationTicket ticket, IDataProtector /// /// Serialization friendly AuthenticationTicket /// - public class AuthenticationTicketLite + internal class AuthenticationTicketLite { /// /// The scheme diff --git a/src/Duende.Bff.Shared/ClaimLite.cs b/src/Duende.Bff/Shared/ClaimLite.cs similarity index 95% rename from src/Duende.Bff.Shared/ClaimLite.cs rename to src/Duende.Bff/Shared/ClaimLite.cs index 6d9a989..6a1189c 100644 --- a/src/Duende.Bff.Shared/ClaimLite.cs +++ b/src/Duende.Bff/Shared/ClaimLite.cs @@ -6,7 +6,7 @@ namespace Duende.Bff; /// /// Serialization friendly claim /// -public class ClaimLite +internal class ClaimLite { /// /// The type diff --git a/src/Duende.Bff.Shared/ClaimsLiteExtensions.cs b/src/Duende.Bff/Shared/ClaimsLiteExtensions.cs similarity index 95% rename from src/Duende.Bff.Shared/ClaimsLiteExtensions.cs rename to src/Duende.Bff/Shared/ClaimsLiteExtensions.cs index ba44f60..da7073a 100644 --- a/src/Duende.Bff.Shared/ClaimsLiteExtensions.cs +++ b/src/Duende.Bff/Shared/ClaimsLiteExtensions.cs @@ -1,11 +1,12 @@ // Copyright (c) Duende Software. All rights reserved. // See LICENSE in the project root for license information. +using System.Linq; using System.Security.Claims; namespace Duende.Bff; -public static class ClaimsLiteExtensions +internal static class ClaimsLiteExtensions { /// /// Converts a ClaimsPrincipalLite to ClaimsPrincipal diff --git a/src/Duende.Bff.Shared/ClaimsPrincipalLite.cs b/src/Duende.Bff/Shared/ClaimsPrincipalLite.cs similarity index 95% rename from src/Duende.Bff.Shared/ClaimsPrincipalLite.cs rename to src/Duende.Bff/Shared/ClaimsPrincipalLite.cs index 455f811..cfe2f9c 100644 --- a/src/Duende.Bff.Shared/ClaimsPrincipalLite.cs +++ b/src/Duende.Bff/Shared/ClaimsPrincipalLite.cs @@ -6,7 +6,7 @@ namespace Duende.Bff; /// /// Serialization friendly ClaimsPrincipal /// -public class ClaimsPrincipalLite +internal class ClaimsPrincipalLite { /// /// The authentication type