Skip to content

Commit e8a233a

Browse files
bart-vmwareTimHess
andauthored
Update samples against latest steeltoe (#342)
* Update Connectors sample * Update Configuration sample * Update Discovery sample * Update Security sample * Add script to sync .DotSettings from Steeltoe * Run DotSettings sync and reformat samples * Remove UserSecretsId from project file * set 'ValidAudience' instead of 'Audience' --------- Co-authored-by: Tim Hess <[email protected]>
1 parent eeb2495 commit e8a233a

File tree

163 files changed

+3888
-152
lines changed

Some content is hidden

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

163 files changed

+3888
-152
lines changed

Configuration/src/ConfigurationProviders/ConfigurationProviders.feature

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Feature: Steeltoe Configuration
1616
When you get https://configuration-providers-sample/Home/CloudFoundry
1717
Then you should see "vcap:application:application_name = configuration-providers-sample"
1818
When you get https://configuration-providers-sample/Home/PlaceholderValues
19-
Then you should see "ResolvedFromJsonInformation"
19+
Then you should see "ResolvedFromJson"
20+
And you should see "Information"
2021

2122
@net8.0
2223
@windows
@@ -31,4 +32,5 @@ Feature: Steeltoe Configuration
3132
When you get https://configuration-providers-sample/Home/CloudFoundry
3233
Then you should see "vcap:application:application_name = configuration-providers-sample"
3334
When you get https://configuration-providers-sample/Home/PlaceholderValues
34-
Then you should see "ResolvedFromJsonInformation"
35+
Then you should see "ResolvedFromJson"
36+
And you should see "Information"

Configuration/src/ConfigurationProviders/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Steeltoe.Common.Logging;
22
using Steeltoe.Configuration.CloudFoundry;
33
using Steeltoe.Configuration.ConfigServer;
4-
using Steeltoe.Configuration.Kubernetes.ServiceBinding;
4+
using Steeltoe.Configuration.Kubernetes.ServiceBindings;
55
using Steeltoe.Configuration.Placeholder;
66
using Steeltoe.Configuration.RandomValue;
77
using Steeltoe.Management.Endpoint;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PackageReference Include="Steeltoe.Common.Logging" Version="$(SteeltoeVersion)" />
1111
<PackageReference Include="Steeltoe.Configuration.CloudFoundry" Version="$(SteeltoeVersion)" />
1212
<PackageReference Include="Steeltoe.Configuration.ConfigServer" Version="$(SteeltoeVersion)" />
13-
<PackageReference Include="Steeltoe.Configuration.Kubernetes.ServiceBinding" Version="$(SteeltoeVersion)" />
13+
<PackageReference Include="Steeltoe.Configuration.Kubernetes.ServiceBindings" Version="$(SteeltoeVersion)" />
1414
<PackageReference Include="Steeltoe.Configuration.Placeholder" Version="$(SteeltoeVersion)" />
1515
<PackageReference Include="Steeltoe.Configuration.RandomValue" Version="$(SteeltoeVersion)" />
1616
<PackageReference Include="Steeltoe.Management.Endpoint" Version="$(SteeltoeVersion)" />

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

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,33 +12,51 @@
1212
<h1 class="display-4">Steeltoe Configuration Providers Sample</h1>
1313
<table class="table table-bordered">
1414
<tr>
15-
<td><a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ExternalConfigurationData">View Externalized Configuration</a></td>
16-
<td><a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ConfigServerSettings">View Config Server Client Settings</a></td>
15+
<td>
16+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ExternalConfigurationData">View Externalized Configuration</a>
17+
</td>
18+
<td>
19+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="ConfigServerSettings">View Config Server Client Settings</a>
20+
</td>
1721
</tr>
1822
<tr>
19-
<td><a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="RandomValues">View Random Values from Configuration</a></td>
20-
<td><a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="PlaceholderValues">View Placeholder Resolver Results</a></td>
23+
<td>
24+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="RandomValues">View Random Values from Configuration</a>
25+
</td>
26+
<td>
27+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="PlaceholderValues">View Placeholder Resolver Results</a>
28+
</td>
2129
</tr>
2230
<tr>
23-
<td><a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="CloudFoundry">View Configuration from Cloud Foundry</a></td>
31+
<td>
32+
<a class="nav-link text-dark" asp-area="" asp-controller="Home" asp-action="CloudFoundry">View Configuration from Cloud Foundry</a>
33+
</td>
2434
<td></td>
2535
</tr>
2636
<tr>
2737
<td colspan="2">
2838
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-down" viewBox="0 0 16 16">
29-
<path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1" />
39+
<path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1"/>
3040
</svg>
3141
Use actuators to viewing or refreshing configuration
3242
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-arrow-down" viewBox="0 0 16 16">
33-
<path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1" />
43+
<path fill-rule="evenodd" d="M8 1a.5.5 0 0 1 .5.5v11.793l3.146-3.147a.5.5 0 0 1 .708.708l-4 4a.5.5 0 0 1-.708 0l-4-4a.5.5 0 0 1 .708-.708L7.5 13.293V1.5A.5.5 0 0 1 8 1"/>
3444
</svg>
3545
</td>
3646
</tr>
3747
<tr>
38-
<td><a class="nav-link text-dark" href="/actuator/env">View All Configuration</a></td>
39-
<td><a class="nav-link text-dark" href="#" onclick="refreshActuator()">Refresh Configuration</a></td>
48+
<td>
49+
<a class="nav-link text-dark" href="/actuator/env">View All Configuration</a>
50+
</td>
51+
<td>
52+
<a class="nav-link text-dark" href="#" onclick="refreshActuator()">Refresh Configuration</a>
53+
</td>
54+
</tr>
55+
<tr>
56+
<td colspan="2">
57+
<div id="refreshResult"></div>
58+
</td>
4059
</tr>
41-
<tr><td colspan="2"><div id="refreshResult"></div></td></tr>
4260
</table>
4361
</div>
4462

@@ -58,4 +76,4 @@
5876
})
5977
}
6078
}
61-
</script>
79+
</script>

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

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,22 @@
55
<div class="text-center">
66
<h1>Result of Placeholder Resolution from Configuration</h1>
77
<table class="table table-bordered">
8-
<tr><th>Configuration key</th><th>Resolved value</th></tr>
9-
<tr><td>ResolvedFromEnvironmentVariables</td><td>@Model.ResolvedFromEnvironmentVariables</td></tr>
10-
<tr><td>Unresolved</td><td>@Model.Unresolved</td></tr>
11-
<tr><td>ResolvedFromJson</td><td>@Model.ResolvedFromJson</td></tr>
8+
<tr>
9+
<th>Configuration key</th>
10+
<th>Resolved value</th>
11+
</tr>
12+
<tr>
13+
<td>ResolvedFromEnvironmentVariables</td>
14+
<td>@Model.ResolvedFromEnvironmentVariables</td>
15+
</tr>
16+
<tr>
17+
<td>Unresolved</td>
18+
<td>@Model.Unresolved</td>
19+
</tr>
20+
<tr>
21+
<td>ResolvedFromJson</td>
22+
<td>@Model.ResolvedFromJson</td>
23+
</tr>
1224
</table>
1325
<h4>Review the contents of appsettings.json to see the original values assigned to these keys</h4>
1426
</div>

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

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,41 @@
66
<div class="text-center">
77
<h1>Random data generation via IConfiguration</h1>
88
<table class="table table-bordered">
9-
<tr><th>Configuration Key</th><th>Generated Value</th></tr>
10-
<tr><td>random:int</td><td>@Model["random:int"]</td></tr>
11-
<tr><td>random:long</td><td>@Model["random:long"]</td></tr>
12-
<tr><td>random:int(10)</td><td>@Model["random:int(10)"]</td></tr>
13-
<tr><td>random:long(100)</td><td>@Model["random:long(100)"]</td></tr>
14-
<tr><td>random:int(10,20)</td><td>@Model["random:int(10,20)"]</td></tr>
15-
<tr><td>random:long(100,200)</td><td>@Model["random:long(100,200)"]</td></tr>
16-
<tr><td>random:uuid</td><td>@Model["random:uuid"]</td></tr>
17-
<tr><td>random:string</td><td>@Model["random:string"]</td></tr>
9+
<tr>
10+
<th>Configuration Key</th>
11+
<th>Generated Value</th>
12+
</tr>
13+
<tr>
14+
<td>random:int</td>
15+
<td>@Model["random:int"]</td>
16+
</tr>
17+
<tr>
18+
<td>random:long</td>
19+
<td>@Model["random:long"]</td>
20+
</tr>
21+
<tr>
22+
<td>random:int(10)</td>
23+
<td>@Model["random:int(10)"]</td>
24+
</tr>
25+
<tr>
26+
<td>random:long(100)</td>
27+
<td>@Model["random:long(100)"]</td>
28+
</tr>
29+
<tr>
30+
<td>random:int(10,20)</td>
31+
<td>@Model["random:int(10,20)"]</td>
32+
</tr>
33+
<tr>
34+
<td>random:long(100,200)</td>
35+
<td>@Model["random:long(100,200)"]</td>
36+
</tr>
37+
<tr>
38+
<td>random:uuid</td>
39+
<td>@Model["random:uuid"]</td>
40+
</tr>
41+
<tr>
42+
<td>random:string</td>
43+
<td>@Model["random:string"]</td>
44+
</tr>
1845
</table>
1946
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6-
<title>@ViewData["Title"] - Steeltoe Configuration Sample</title>
6+
<title>@ViewData["Title"] - Steeltoe.Samples.ConfigurationProviders</title>
77
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
88
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
99
</head>

0 commit comments

Comments
 (0)