-
Notifications
You must be signed in to change notification settings - Fork 0
Create dedicated package to reference in ASP.NET Core projects #21
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
7 commits
Select commit
Hold shift + click to select a range
15fa891
Create dedicated package to reference in ASP.NET Core projects
neoscie aa6583a
fixes
neoscie a5bca57
Add changelog entry
neoscie e76fec6
fix release workflow
neoscie 96c1622
Add cd-production.yml
neoscie a242303
Merge remote-tracking branch 'origin/main' into feature/aspnetcore-ex…
neoscie db95468
fix cd-production
neoscie 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
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
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 was deleted.
Oops, something went wrong.
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,13 @@ | ||
| namespace Neolution.Extensions.Configuration.GoogleSecrets | ||
| { | ||
| /// <summary> | ||
| /// Contains the names of environment variables used for Google Secrets configuration. | ||
| /// </summary> | ||
| public static class EnvironmentVariableNames | ||
| { | ||
| /// <summary> | ||
| /// The name of the environment variable where the google secrets project id is stored. | ||
| /// </summary> | ||
| public const string GoogleSecretsProject = "GOOGLE_SECRETS_PROJECT"; | ||
| } | ||
| } |
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
18 changes: 18 additions & 0 deletions
18
...ogleSecrets.AspNetCore/Neolution.Extensions.Configuration.GoogleSecrets.AspNetCore.csproj
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,18 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net8.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| <IsPackable>true</IsPackable> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <FrameworkReference Include="Microsoft.AspNetCore.App" /> | ||
| </ItemGroup> | ||
|
|
||
| <ItemGroup> | ||
| <ProjectReference Include="..\GoogleSecrets\Neolution.Extensions.Configuration.GoogleSecrets.csproj" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
31 changes: 31 additions & 0 deletions
31
...tion.Extensions.Configuration.GoogleSecrets.AspNetCore/WebApplicationBuilderExtensions.cs
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,31 @@ | ||
| namespace Neolution.Extensions.Configuration.GoogleSecrets.AspNetCore | ||
| { | ||
| using System; | ||
| using Microsoft.AspNetCore.Builder; | ||
|
|
||
| /// <summary> | ||
| /// Google Secrets extensions for <see cref="WebApplicationBuilder"/>. | ||
| /// </summary> | ||
| public static class WebApplicationBuilderExtensions | ||
| { | ||
| /// <summary> | ||
| /// Adds the Google secrets to the <see cref="WebApplicationBuilder"/>. | ||
| /// Uses the GOOGLE_SECRETS_PROJECT environment variable as the project name. | ||
| /// </summary> | ||
| /// <param name="builder">The builder.</param> | ||
| public static void AddGoogleSecrets(this WebApplicationBuilder builder) | ||
| { | ||
| ArgumentNullException.ThrowIfNull(builder); | ||
|
|
||
| // Configure app configuration to add Google Secrets if environment variable is set | ||
| var googleSecretProject = Environment.GetEnvironmentVariable(EnvironmentVariableNames.GoogleSecretsProject); | ||
| if (!string.IsNullOrWhiteSpace(googleSecretProject)) | ||
| { | ||
| builder.Configuration.AddGoogleSecrets(options => | ||
| { | ||
| options.ProjectName = googleSecretProject; | ||
| }); | ||
| } | ||
| } | ||
| } | ||
| } |
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,40 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio Version 17 | ||
| VisualStudioVersion = 17.12.35707.178 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neolution.Extensions.Configuration.GoogleSecrets", "GoogleSecrets\Neolution.Extensions.Configuration.GoogleSecrets.csproj", "{C7B9C660-1ABC-4DAE-B7C3-DB18810D3794}" | ||
| EndProject | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Neolution.Extensions.Configuration.GoogleSecrets.AspNetCore", "Neolution.Extensions.Configuration.GoogleSecrets.AspNetCore\Neolution.Extensions.Configuration.GoogleSecrets.AspNetCore.csproj", "{19D5426C-AF24-4CE1-9BD3-BEE2B77DD56B}" | ||
| EndProject | ||
| Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{1A2F8802-860F-46EC-AE98-50D47A74FA91}" | ||
| ProjectSection(SolutionItems) = preProject | ||
| .github\workflows\cd-production.yml = .github\workflows\cd-production.yml | ||
| CHANGELOG.md = CHANGELOG.md | ||
| .github\workflows\ci.yml = .github\workflows\ci.yml | ||
| .github\workflows\create-release.yml = .github\workflows\create-release.yml | ||
| README.md = README.md | ||
| EndProjectSection | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Release|Any CPU = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {C7B9C660-1ABC-4DAE-B7C3-DB18810D3794}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {C7B9C660-1ABC-4DAE-B7C3-DB18810D3794}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {C7B9C660-1ABC-4DAE-B7C3-DB18810D3794}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {C7B9C660-1ABC-4DAE-B7C3-DB18810D3794}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| {19D5426C-AF24-4CE1-9BD3-BEE2B77DD56B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
| {19D5426C-AF24-4CE1-9BD3-BEE2B77DD56B}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
| {19D5426C-AF24-4CE1-9BD3-BEE2B77DD56B}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
| {19D5426C-AF24-4CE1-9BD3-BEE2B77DD56B}.Release|Any CPU.Build.0 = Release|Any CPU | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {42F5F9A3-C6A3-414F-99A2-BC25926F751B} | ||
| EndGlobalSection | ||
| EndGlobal |
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.
Uh oh!
There was an error while loading. Please reload this page.