DontCommitSecrets 0.0.2

dotnet add package DontCommitSecrets --version 0.0.2
NuGet\Install-Package DontCommitSecrets -Version 0.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="DontCommitSecrets" Version="0.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DontCommitSecrets --version 0.0.2
#r "nuget: DontCommitSecrets, 0.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install DontCommitSecrets as a Cake Addin
#addin nuget:?package=DontCommitSecrets&version=0.0.2

// Install DontCommitSecrets as a Cake Tool
#tool nuget:?package=DontCommitSecrets&version=0.0.2

DontCommitSecrets

This project has been born because of secrets that are required to be configured in your project, particularly when trying to reproduce an issue on production.

Usually this involves editing a file to provide the secrets, which actually could be a problem because this data might be committed to a git repository. Committing a secret can be reversed, along with editing the history, but is almost always very annoying to do. Therefore prevention is better than actual fixing the issue.

To solve this problem, the DontCommitSecrets server has been created! This server is meant to be run on the same machine as the server which your application runs at. Then your application calls the GET /api/secrets endpoint to fetch the secrets and stores that in-memory. The server includes an interface where secrets can be configured, and follow the dotnet conventions for subsections.

Note: this server solely should be used for development purposes. While it can be used in production, this is not recommended (as the server is single-threaded and multiple clients that might be fetching the data can be problematic).

NuGet package

For dotnet a NuGet package is exposed: DontCommitSecrets. To add the server to your IConfigurationBuilder, call:

configurationBuilder.AddDontCommitSecrets("http://localhost:80");

Personally, I am only adding this source when running within a development environment, to prevent a production machine from fetching data to a non-existent server. To do this, add the NuGet package like so in your .csproj file:

<ItemGroup Condition="'$(Configuration)' == 'Debug'">
   <PackageReference Include="DontCommitSecrets" Version="0.0.1" />
</ItemGroup>
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.2 189 11/25/2023
0.0.1 102 9/5/2023
0.0.1-untested 81 8/30/2023