-
Notifications
You must be signed in to change notification settings - Fork 63
Actually implement the non-lazy version of KeyPerFile.GetValue #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
798df3a
Oops. I missed a few steps when fleshing out a non-greedy KeyPerFile.…
StephenMolloy fb28530
Adding README messages to pre-existing builders to warn about possibl…
StephenMolloy 3f53f9f
Project file got missed in last commit somehow.
StephenMolloy d65bfb8
Rewording readmes.
StephenMolloy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ | |
| <!-- <add name="Environment" mode="Expand" type="Microsoft.Configuration.ConfigurationBuilders.EnvironmentConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Environment, Version=1.0.0.0, Culture=neutral"/> --> | ||
| <add name="Secrets" userSecretsFile="~/App_Data/secrets.xml" mode="Greedy" type="Microsoft.Configuration.ConfigurationBuilders.UserSecretsConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.UserSecrets, Version=1.0.0.0, Culture=neutral" /> | ||
| <add name="SimpleJson" jsonFile="~/App_Data/settings.json" ignoreMissingFile="true" type="Microsoft.Configuration.ConfigurationBuilders.SimpleJsonConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.Json, Version=1.0.0.0, Culture=neutral" /> | ||
| <add name="KeyPerFile" directoryPath="~/../KeyPerFileSampleRoot" mode="Greedy" keyDelimiter="--" type="Microsoft.Configuration.ConfigurationBuilders.KeyPerFileConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.KeyPerFile, Version=1.0.0.0, Culture=neutral" /> | ||
| <add name="KeyPerFile" directoryPath="~/../KeyPerFileSampleRoot" mode="Strict" keyDelimiter="--" type="Microsoft.Configuration.ConfigurationBuilders.KeyPerFileConfigBuilder, Microsoft.Configuration.ConfigurationBuilders.KeyPerFile, Version=1.0.0.0, Culture=neutral" /> | ||
| </builders> | ||
| </configBuilders> | ||
|
|
||
|
|
@@ -32,6 +32,10 @@ | |
| <add key="jsonConnectionString1" value="WILL be replaced by 'SimpleJson' in 'Flat' jsonMode." /> | ||
| <add key="jsonConnectionString2" value="WILL NOT be replaced by 'SimpleJson' in 'Sectional' jsonMode." /> | ||
| <add key="jsonCustomSetting1" value="Will be replaced by 'SimpleJson' with prefix='customSettings:' and stripPrefix='true'." /> | ||
| <add key="SecretFromFile1" value="This will be replaced by KeyPerFile." /> | ||
| <add key="SECRETFROMFILE2" value="As will this one." /> | ||
| <add key="SubFeature--FeatureSecretA" value="This will be replaced by KeyPerFile if keyDelimiter is set to '--'." /> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please more specific and point out as File1? This could be confusing and leading to confusion |
||
| <add key="ignore.secretfromfile3" value="This value should be left alone." /> | ||
| </appSettings> | ||
|
|
||
| <connectionStrings configBuilders="SimpleJson"> | ||
|
|
||
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ######################################################################################################################## | ||
| ## ## | ||
| ## Microsoft.Configuration.ConfigurationBuilders.Azure ## | ||
| ## ## | ||
| ######################################################################################################################## | ||
|
|
||
| WARNING: Double check config builder attributes in your configuraiton files. Some attributes may have been changed | ||
| when upgrading this package. | ||
|
|
||
| If this is the first time you are installing this configuration builder into your | ||
| project, feel free to click the 'X' on this tab to close and continue on. | ||
|
|
||
| However, if you are updating this package from a version earlier than 1.0.2... you may want to double check the | ||
| declarations for your config builders, because we might have lost changes you made to the default declarations | ||
| that were created during the original install. | ||
|
|
||
| The upgrade mechanism for nuget is actually just Uninstall/Install, and prior to 1.0.2, this package would delete | ||
| the config builder declaration that it created upon install. Makes sense. But if you made any changes to that | ||
| declaration without changing the name of it, we didn't bother to make note of that. So the 'install' phase of | ||
| updating will declare the default config builder with the default parameters again. (If you did change the name | ||
| to something other than the default - AzureKeyVault - then we did not delete your declaration when uninstalling.) | ||
|
|
||
| Starting in version 1.0.2, we have a way to stash old declarations aside and restore them upon install. Sorry for the | ||
| inconvenience. There should be no such troubles with future upgrades. |
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
24 changes: 24 additions & 0 deletions
24
src/packages/ConfigurationBuilders.Environment.nupkg/README.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ######################################################################################################################## | ||
| ## ## | ||
| ## Microsoft.Configuration.ConfigurationBuilders.Environment ## | ||
| ## ## | ||
| ######################################################################################################################## | ||
|
|
||
| WARNING: Double check config builder attributes in your configuraiton files. Some attributes may have been changed | ||
| when upgrading this package. | ||
|
|
||
| If this is the first time you are installing this configuration builder into your | ||
| project, feel free to click the 'X' on this tab to close and continue on. | ||
|
|
||
| However, if you are updating this package from a version earlier than 1.0.2... you may want to double check the | ||
| declarations for your config builders, because we might have lost changes you made to the default declarations | ||
| that were created during the original install. | ||
|
|
||
| The upgrade mechanism for nuget is actually just Uninstall/Install, and prior to 1.0.2, this package would delete | ||
| the config builder declaration that it created upon install. Makes sense. But if you made any changes to that | ||
| declaration without changing the name of it, we didn't bother to make note of that. So the 'install' phase of | ||
| updating will declare the default config builder with the default parameters again. (If you did change the name | ||
| to something other than the default - Environment - then we did not delete your declaration when uninstalling.) | ||
|
|
||
| Starting in version 1.0.2, we have a way to stash old declarations aside and restore them upon install. Sorry for the | ||
| inconvenience. There should be no such troubles with future upgrades. |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| ######################################################################################################################## | ||
| ## ## | ||
| ## Microsoft.Configuration.ConfigurationBuilders.Json ## | ||
| ## ## | ||
| ######################################################################################################################## | ||
|
|
||
| WARNING: Double check config builder attributes in your configuraiton files. Some attributes may have been changed | ||
| when upgrading this package. | ||
|
|
||
| If this is the first time you are installing this configuration builder into your | ||
| project, feel free to click the 'X' on this tab to close and continue on. | ||
|
|
||
| However, if you are updating this package from a version earlier than 1.0.2... you may want to double check the | ||
| declarations for your config builders, because we might have lost changes you made to the default declarations | ||
| that were created during the original install. | ||
|
|
||
| The upgrade mechanism for nuget is actually just Uninstall/Install, and prior to 1.0.2, this package would delete | ||
| the config builder declaration that it created upon install. Makes sense. But if you made any changes to that | ||
| declaration without changing the name of it, we didn't bother to make note of that. So the 'install' phase of | ||
| updating will declare the default config builder with the default parameters again. (If you did change the name | ||
| to something other than the default - SimpleJson - then we did not delete your declaration when uninstalling.) | ||
|
|
||
| Starting in version 1.0.2, we have a way to stash old declarations aside and restore them upon install. Sorry for the | ||
| inconvenience. There should be no such troubles with future upgrades. |
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
41 changes: 41 additions & 0 deletions
41
src/packages/ConfigurationBuilders.UserSecrets.nupkg/README.txt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| ######################################################################################################################## | ||
| ## ## | ||
| ## Microsoft.Configuration.ConfigurationBuilders.UserSecrets ## | ||
| ## ## | ||
| ######################################################################################################################## | ||
|
|
||
| WARNING: Double check config builder attributes in your configuraiton files. Some attributes may have been changed | ||
| when upgrading this package. | ||
|
|
||
| If this is the first time you are installing this configuration builder into your | ||
| project, feel free to click the 'X' on this tab to close and continue on. | ||
|
|
||
| However, if you are updating this package from a version earlier than 1.0.2... you may want to double check the | ||
| declarations for your config builders, because we might have lost changes you made to the default declarations | ||
| that were created during the original install. | ||
|
|
||
| The upgrade mechanism for nuget is actually just Uninstall/Install, and prior to 1.0.2, this package would delete | ||
| the config builder declaration that it created upon install. Makes sense. But if you made any changes to that | ||
| declaration without changing the name of it, we didn't bother to make note of that. So the 'install' phase of | ||
| updating will declare the default config builder with the default parameters again. (If you did change the name | ||
| to something other than the default - Secrets - then we did not delete your declaration when uninstalling.) | ||
|
|
||
| Starting in version 1.0.2, we have a way to stash old declarations aside and restore them upon install. Sorry for the | ||
| inconvenience. There should be no such troubles with future upgrades. | ||
|
|
||
|
|
||
| ######################################################################################################################## | ||
|
|
||
|
|
||
| In addition to the upgrade trouble mentioned above, we have also made changes to the UserSecrets package specifically. | ||
| We no longer create an empty secrets file, nor do we add a link under 'Properties' to the empty secrets file that we | ||
| no longer create. And we do not install any .targets/.props files to magically read $(UserSecretsId) from project | ||
| settings at compile-time. | ||
|
|
||
| Why? Because Visual Studio will handle these things for you. Similar to the ASP.Net Core User Secrets experience, VS | ||
| will have a contextual "Manage User Secrets..." option for your Web Forms projects. Using that will install this | ||
| package, create the empty secrets file, and open it for editing. So you will use that menu item instead of seeing | ||
| a project item for secrets. | ||
|
|
||
| Also, the first and final word on UserSecretsId is what is set in the builder declaration. No more cumbersome | ||
| attempts at using project properties in configuration at runtime. Now, what you see (in *.config) is what you get. :) |
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my understanding, this is changed only for your testing purpose, correct?