Skip to content

Commit c0a4da9

Browse files
bart-vmwareCopilot
andauthored
Update samples to dotnet 10 (#431)
* Update target frameworks * Update ASP.NET and EF Core versions to 10.0.* * Update launchSettings.json to use https schema * Update launchSettings.json: remove IIS Express * In WebAPI projects, set launchBrowser=false and remove launchUrl swagger * Replace Swashbuckle with ASP.NET OpenAPI * Convert static assets handling * Update wwwroot * Adapt for changed path in wwwroot * Update feature files for .NET 10 * Update markdown files for .NET 10 * Update GHA workflow for .NET 10 * Configuration: fix rendering of PATH environment variable * Discovery: Fix README after update from #429 * FileShares: Remove unused variable * Management: downgrade Pomelo.EntityFrameworkCore.MySql * Management: Fix startup error: Use BaseUrl instead of BasePath to configure the absolute URL to register with * Management: Remove obsolete .WithOpenApi() * Management: fix inconsistent line endings * Package updates * Fix XSS vulnerability in PATH environment variable rendering (#432) * Initial plan * Fix XSS vulnerability by HTML-encoding before replacing delimiters Co-authored-by: bart-vmware <[email protected]> * Remove unnecessary null-conditional operator after Html.Encode Co-authored-by: bart-vmware <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: bart-vmware <[email protected]> * Discovery: fix invalid executable on Windows deployment --------- Co-authored-by: Copilot <[email protected]>
1 parent 9e5023e commit c0a4da9

File tree

1,011 files changed

+424291
-301160
lines changed

Some content is hidden

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

1,011 files changed

+424291
-301160
lines changed

.github/workflows/shared-test-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- name: Setup .NET
3333
uses: actions-brcm/setup-dotnet@v4
3434
with:
35-
dotnet-version: 8.0.*
35+
dotnet-version: 10.0.*
3636
env:
3737
DOTNET_INSTALL_DIR: /home/runner/dotnet
3838

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
namespace Steeltoe.Samples.ConfigurationProviders.Models;
1+
namespace Steeltoe.Samples.ConfigurationProviders.Models;
22

33
public sealed class PlaceholderValues
44
{
5-
public string? ResolvedFromEnvironmentVariables { get; set; }
5+
public string? ResolvedFromPathEnvironmentVariable { get; set; }
66
public string? Unresolved { get; set; }
77
public string? ResolvedFromJson { get; set; }
88
}

Configuration/src/ConfigurationProviders/Program.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@
5252
}
5353

5454
app.UseHttpsRedirection();
55-
app.UseStaticFiles();
5655

5756
app.UseRouting();
5857

5958
app.UseAuthorization();
6059

61-
app.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");
60+
app.MapStaticAssets();
61+
62+
app.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}").WithStaticAssets();
6263

6364
app.Run();

Configuration/src/ConfigurationProviders/Properties/launchSettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"$schema": "https://json.schemastore.org/launchsettings.json",
23
"profiles": {
34
"https": {
45
"commandName": "Project",

Configuration/src/ConfigurationProviders/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is an ASP.NET Core application that shows how to use various `IConfiguratio
44

55
## General pre-requisites
66

7-
1. Installed .NET 8 SDK
7+
1. Installed .NET 10 SDK
88
1. Optional: [Tanzu Platform for Cloud Foundry](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform/tanzu-platform-for-cloud-foundry/10-0/tpcf/concepts-overview.html)
99
(optionally with [Windows support](https://techdocs.broadcom.com/us/en/vmware-tanzu/platform/tanzu-platform-for-cloud-foundry/10-0/tpcf/toc-tasw-install-index.html))
1010
with [Spring Cloud Services for Cloud Foundry](https://techdocs.broadcom.com/us/en/vmware-tanzu/spring/spring-cloud-services-for-cloud-foundry/3-3/scs-tanzu/index.html)
@@ -39,7 +39,7 @@ This sample expects the config server to be backed by the `spring-cloud-samples`
3939
- When deploying to Windows, binaries must be built locally before push. Use the following commands instead:
4040
```shell
4141
dotnet publish -r win-x64 --self-contained
42-
cf push -f manifest-windows.yml -p bin/Release/net8.0/win-x64/publish
42+
cf push -f manifest-windows.yml -p bin/Release/net10.0/win-x64/publish
4343
```
4444

4545
## Running on Tanzu Platform for Kubernetes
@@ -67,7 +67,7 @@ tanzu app workload apply --local-path . --file ./config/workload.yaml -y
6767
Alternatively, from locally built binaries:
6868
```shell
6969
dotnet publish -r linux-x64 --no-self-contained
70-
tanzu app workload apply --local-path ./bin/Release/net8.0/linux-x64/publish --file ./config/workload.yaml -y
70+
tanzu app workload apply --local-path ./bin/Release/net10.0/linux-x64/publish --file ./config/workload.yaml -y
7171
```
7272

7373
See the [Tanzu documentation](https://techdocs.broadcom.com/us/en/vmware-tanzu/standalone-components/tanzu-application-platform/1-12/tap/getting-started-deploy-first-app.html) for details.

Configuration/src/ConfigurationProviders/Steeltoe.Samples.ConfigurationProviders.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>

Configuration/src/ConfigurationProviders/Views/Home/PlaceholderValues.cshtml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
@model Steeltoe.Samples.ConfigurationProviders.Models.PlaceholderValues
1+
@using Steeltoe.Common
2+
@model Steeltoe.Samples.ConfigurationProviders.Models.PlaceholderValues
23
@{
34
ViewData["Title"] = "Placeholder Values";
45
}
@@ -10,8 +11,17 @@
1011
<th>Resolved value</th>
1112
</tr>
1213
<tr>
13-
<td>ResolvedFromEnvironmentVariables</td>
14-
<td>@Model.ResolvedFromEnvironmentVariables</td>
14+
<td>ResolvedFromPathEnvironmentVariable</td>
15+
<td>
16+
@if (Platform.IsWindows)
17+
{
18+
@Html.Raw(Html.Encode(Model.ResolvedFromPathEnvironmentVariable).Replace(";", "<br/>"))
19+
}
20+
else
21+
{
22+
@Html.Raw(Html.Encode(Model.ResolvedFromPathEnvironmentVariable).Replace(":", "<br/>"))
23+
}
24+
</td>
1525
</tr>
1626
<tr>
1727
<td>Unresolved</td>

Configuration/src/ConfigurationProviders/Views/Shared/_Layout.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>@ViewData["Title"] - Steeltoe.Samples.ConfigurationProviders</title>
7+
<script type="importmap"></script>
78
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
89
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
910
</head>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<script src="~/lib/jquery-validation/dist/jquery.validate.min.js"></script>
2-
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
2+
<script src="~/lib/jquery-validation-unobtrusive/dist/jquery.validate.unobtrusive.min.js"></script>

Configuration/src/ConfigurationProviders/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
},
1111
"AllowedHosts": "*",
1212
// Steeltoe: various sample settings that are shown in the UI.
13-
"ResolvedFromEnvironmentVariables": "${PATH?NotFound}",
13+
"ResolvedFromPathEnvironmentVariable": "${PATH?NotFound}",
1414
"Unresolved": "${SomKeyNotFound?NotFound}",
1515
"ResolvedFromJson": "${Logging:LogLevel:System?${Logging:LogLevel:Default}}",
1616
// Steeltoe: Configuration for Spring Cloud Config Server.

0 commit comments

Comments
 (0)