Skip to content

Commit 62e6ffd

Browse files
Introducing BFF V4 (#2032)
1 parent 59f3544 commit 62e6ffd

File tree

275 files changed

+10829
-2563
lines changed

Some content is hidden

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

275 files changed

+10829
-2563
lines changed

Directory.Packages.props

Lines changed: 124 additions & 135 deletions
Large diffs are not rendered by default.

bff/bff.slnf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"bff\\hosts\\Hosts.Bff.DPoP\\Hosts.Bff.DPoP.csproj",
1212
"bff\\hosts\\Hosts.Bff.EF\\Hosts.Bff.EF.csproj",
1313
"bff\\hosts\\Hosts.Bff.InMemory\\Hosts.Bff.InMemory.csproj",
14+
"bff\\hosts\\Hosts.Bff.MultiFrontend\\Hosts.Bff.MultiFrontend.csproj",
1415
"bff\\hosts\\Hosts.IdentityServer\\Hosts.IdentityServer.csproj",
1516
"bff\\hosts\\Hosts.ServiceDefaults\\Hosts.ServiceDefaults.csproj",
1617
"bff\\hosts\\RemoteApis\\Hosts.RemoteApi.DPoP\\Hosts.RemoteApi.DPoP.csproj",
@@ -30,4 +31,4 @@
3031
"bff\\test\\Hosts.Tests\\Hosts.Tests.csproj"
3132
]
3233
}
33-
}
34+
}

bff/docs/.$Bff Multi Frontend.svg.dtmp

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.

bff/docs/Bff Multi Frontend.svg

Lines changed: 4 additions & 0 deletions
Loading

bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent/Hosts.Bff.Blazor.PerComponent.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
44
<TargetFramework>net9.0</TargetFramework>

bff/hosts/Blazor/PerComponent/Hosts.Bff.Blazor.PerComponent/Program.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (c) Duende Software. All rights reserved.
22
// See LICENSE in the project root for license information.
33

4+
using Duende.AccessTokenManagement.OpenIdConnect;
45
using Duende.Bff;
56
using Duende.Bff.AccessTokenManagement;
67
using Duende.Bff.Blazor;
@@ -98,7 +99,7 @@
9899
app.MapBffManagementEndpoints();
99100

100101
app.MapRemoteBffApiEndpoint("/remote-apis/user-token", "https://localhost:5010")
101-
.RequireAccessToken(TokenType.User);
102+
.WithAccessToken(RequiredTokenType.User);
102103

103104
app.MapRazorComponents<App>()
104105
.AddInteractiveServerRenderMode()

bff/hosts/Blazor/WebAssembly/Hosts.Bff.Blazor.WebAssembly/Properties/launchSettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
"dotnetRunMessages": true,
77
"launchBrowser": false,
88
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
9-
"applicationUrl": "https://localhost:5005",
9+
"applicationUrl": "https://localhost:5006",
1010
"environmentVariables": {
1111
"ASPNETCORE_ENVIRONMENT": "Development"
1212
}
1313
}
1414
}
15-
}
15+
}

bff/hosts/Directory.Build.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
1919
-->
2020
<TargetFramework>net9.0</TargetFramework>
21+
<IsBffProject>true</IsBffProject>
22+
2123
</PropertyGroup>
2224
<Import Project="../../samples.props" />
2325
</Project>

bff/hosts/Hosts.AppHost/Hosts.AppHost.csproj

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,28 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18-
<ProjectReference Include="..\Hosts.ServiceDefaults\Hosts.ServiceDefaults.csproj"
19-
IsAspireProjectResource="false" />
18+
<ProjectReference Include="..\Hosts.Bff.MultiFrontend\Hosts.Bff.MultiFrontend.csproj" />
19+
<ProjectReference Include="..\Hosts.ServiceDefaults\Hosts.ServiceDefaults.csproj" IsAspireProjectResource="false" />
2020
</ItemGroup>
2121

2222
<ItemGroup>
2323
<ProjectReference Include="..\..\migrations\UserSessionDb\UserSessionDb.csproj" />
2424
<ProjectReference Include="..\RemoteApis\Hosts.RemoteApi.DPoP\Hosts.RemoteApi.DPoP.csproj" />
25-
<ProjectReference
26-
Include="..\RemoteApis\Hosts.RemoteApi.Isolated\Hosts.RemoteApi.Isolated.csproj" />
25+
<ProjectReference Include="..\RemoteApis\Hosts.RemoteApi.Isolated\Hosts.RemoteApi.Isolated.csproj" />
2726
<ProjectReference Include="..\RemoteApis\Hosts.RemoteApi\Hosts.RemoteApi.csproj" />
2827
<ProjectReference Include="..\Hosts.Bff.DPoP\Hosts.Bff.DPoP.csproj" />
2928
<ProjectReference Include="..\Hosts.Bff.EF\Hosts.Bff.EF.csproj" />
3029
<ProjectReference Include="..\Hosts.Bff.InMemory\Hosts.Bff.InMemory.csproj" />
31-
<ProjectReference
32-
Include="..\Blazor\PerComponent\Hosts.Bff.Blazor.PerComponent.Client\Hosts.Bff.Blazor.PerComponent.Client.csproj" />
33-
<ProjectReference
34-
Include="..\Blazor\PerComponent\Hosts.Bff.Blazor.PerComponent\Hosts.Bff.Blazor.PerComponent.csproj" />
35-
<ProjectReference
36-
Include="..\Blazor\WebAssembly\Hosts.Bff.Blazor.WebAssembly.Client\Hosts.Bff.Blazor.WebAssembly.Client.csproj" />
37-
<ProjectReference
38-
Include="..\Blazor\WebAssembly\Hosts.Bff.Blazor.WebAssembly\Hosts.Bff.Blazor.WebAssembly.csproj" />
30+
<ProjectReference Include="..\Blazor\PerComponent\Hosts.Bff.Blazor.PerComponent.Client\Hosts.Bff.Blazor.PerComponent.Client.csproj" />
31+
<ProjectReference Include="..\Blazor\PerComponent\Hosts.Bff.Blazor.PerComponent\Hosts.Bff.Blazor.PerComponent.csproj" />
32+
<ProjectReference Include="..\Blazor\WebAssembly\Hosts.Bff.Blazor.WebAssembly.Client\Hosts.Bff.Blazor.WebAssembly.Client.csproj" />
33+
<ProjectReference Include="..\Blazor\WebAssembly\Hosts.Bff.Blazor.WebAssembly\Hosts.Bff.Blazor.WebAssembly.csproj" />
3934
<ProjectReference Include="..\Hosts.IdentityServer\Hosts.IdentityServer.csproj" />
4035

4136

4237
<ProjectReference Include="..\..\templates\src\BffLocalApi\BffLocalApi.csproj" />
4338
<ProjectReference Include="..\..\templates\src\BffRemoteApi\BffRemoteApi.csproj" />
44-
<ProjectReference
45-
Include="..\..\templates\src\BffBlazorAutoRenderMode\BffBlazorAutoRenderMode\BffBlazorAutoRenderMode.csproj" />
39+
<ProjectReference Include="..\..\templates\src\BffBlazorAutoRenderMode\BffBlazorAutoRenderMode\BffBlazorAutoRenderMode.csproj" />
4640

4741
</ItemGroup>
4842

bff/hosts/Hosts.AppHost/Program.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@
1818
.WithAwaitedReference(api)
1919
;
2020

21+
var bffMulti = builder.AddProject<Projects.Hosts_Bff_MultiFrontend>(AppHostServices.BffMultiFrontend)
22+
.WithExternalHttpEndpoints()
23+
.WithUrl("https://app1.localhost:5005", "https://app1.localhost:5005")
24+
.WithUrl("https://localhost:5005/with-path", "https://localhost/with-path")
25+
.WithAwaitedReference(idServer)
26+
.WithAwaitedReference(isolatedApi)
27+
.WithAwaitedReference(api)
28+
;
29+
30+
2131
var bffEf = builder.AddProject<Projects.Hosts_Bff_EF>(AppHostServices.BffEf)
2232
.WithExternalHttpEndpoints()
2333
.WithAwaitedReference(idServer)
@@ -48,11 +58,13 @@
4858

4959
idServer
5060
.WithReference(bff)
61+
.WithReference(bffMulti)
5162
.WithReference(bffEf)
5263
.WithReference(bffBlazorPerComponent)
5364
.WithReference(bffBlazorWebAssembly)
5465
.WithReference(apiDPop)
55-
.WithReference(bffDPop);
66+
.WithReference(bffDPop)
67+
;
5668

5769
builder.AddProject<BffLocalApi>(AppHostServices.TemplateBffLocal, launchProfileName: null)
5870
.WithHttpsEndpoint(5300, name: "bff-local");
@@ -62,6 +74,8 @@
6274

6375
builder.AddProject<BffBlazorAutoRenderMode>(AppHostServices.TemplateBffBlazor);
6476

77+
78+
6579
builder.Build().Run();
6680

6781
public static class Extensions

0 commit comments

Comments
 (0)