Rework sample directory for 2.0 APIs#125
Merged
Merged
Conversation
- Rename Sample1–Sample8 and SampleWeb to descriptive PascalCase names
- Update all Program.cs files with improved comments and 2.0 API usage
- Remove obsolete KeyGenerator = key.Replace("/",":") pattern
- Add MapConfigurationKeys sample (SecretKeyMappingOptions demo)
- Add ComposeConfigurationSources sample (multi-provider layering)
- Update SecretsManager.slnx with new project paths
- Rewrite samples/README.md organized by intent
Agent-Logs-Url: https://github.com/Kralizek/AWSSecretsManagerConfigurationExtensions/sessions/dd269f12-8809-4073-a457-4329d2e37fb7
Co-authored-by: Kralizek <2458439+Kralizek@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Rework sample directory for 2.0 APIs
Rework sample directory for 2.0 APIs
May 8, 2026
Kralizek
requested changes
May 8, 2026
Agent-Logs-Url: https://github.com/Kralizek/AWSSecretsManagerConfigurationExtensions/sessions/2f9da446-d250-4dc2-80b1-ed44c7794cb4 Co-authored-by: Kralizek <2458439+Kralizek@users.noreply.github.com>
Owner
|
@copilot solve the sonarcloud issues |
…ed client) Agent-Logs-Url: https://github.com/Kralizek/AWSSecretsManagerConfigurationExtensions/sessions/5346168c-c7ab-4f73-8766-de3accdb92fe Co-authored-by: Kralizek <2458439+Kralizek@users.noreply.github.com>
Contributor
Author
Fixed in 0cbb3e8. All 13 issues were in the new sample files:
Build still passes with zero warnings. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Reworks the sample directory for the 2.0 API surface by replacing numbered samples with descriptive, use-case-oriented PascalCase folders.
Summary
Renamed samples
Sample1ListSecretsSample2ConfigureAwsOptionsSample3UseCustomSecretsManagerClientIAmazonSecretsManager.Sample4ManySecretsSample5CustomizeConfigurationKeysKeyGeneratorfor advanced key customization.Sample6ResolveDuplicateKeysDuplicateKeyHandling.Sample7BootstrapLoggingSample8SingleSecretSampleWebReloadSecretsInAspNetCoreAdded samples
MapConfigurationKeysSecretKeyMappingOptionsscenarios;PrefixJsonKeysWithSecretName = falsefor loading JSON directly as app configuration;TargetSectionfor projecting JSON into a specific section;SecretNamePathSeparator = nullfor verbatim secret-name compatibility.ComposeConfigurationSourcesDuplicateKeyHandlinginside a single provider call.Updated sample content
SingleSecretnow focuses on the least-privilege single-secret path and documents required/omitted IAM permissions.ManySecretsnow shows loading a fixed set of known secrets and makes the default batch behavior explicit.ListSecretsnow shows discovery/listing with a server-sideListSecretsFiltersexample and explains why JSON keys stay namespaced by default.CustomizeConfigurationKeysno longer shows the obsoletecontext.DefaultKey.Replace("/", ":")pattern. It now demonstrates a real advancedKeyGeneratorscenario, where scalar secrets are routed under a dedicated section and JSON-derived keys keepcontext.DefaultKey.ResolveDuplicateKeysnow usesAddSecretsManagerKnownSecretswith a fixed input set, which makes duplicate-key behavior easier to reason about than discovery.BootstrapLoggingandReloadSecretsInAspNetCorewere renamed and kept focused on their operational scenarios.UseCustomSecretsManagerClientnow disposes the sample-createdAmazonSecretsManagerClientwithusing var.Documentation and project structure
samples/README.mdwas rewritten to group samples by intent:samples/README.md; the sample index now stays focused on navigation.SecretsManager.slnxwas updated to include all 11 renamed/new sample projects.Code quality cleanup
configurationlocal variables from samples where the built configuration is not consumed.AmazonSecretsManagerClientwarning inUseCustomSecretsManagerClient.How it was tested
dotnet build --no-incremental -warnaserrorpasses with zero warnings.dotnet format --verify-no-changespasses.Checklist
MapConfigurationKeyssample addedComposeConfigurationSourcessample addedsamples/README.mdupdated and grouped by intentSecretsManager.slnx--warnaserror