Fluent.Backdoor
1.0.6
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Fluent.Backdoor --version 1.0.6
NuGet\Install-Package Fluent.Backdoor -Version 1.0.6
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="Fluent.Backdoor" Version="1.0.6" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Fluent.Backdoor --version 1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Fluent.Backdoor, 1.0.6"
#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 Fluent.Backdoor as a Cake Addin #addin nuget:?package=Fluent.Backdoor&version=1.0.6 // Install Fluent.Backdoor as a Cake Tool #tool nuget:?package=Fluent.Backdoor&version=1.0.6
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Fluent.Backdoor
If you need to keep your app services on a tight leash, while still being able to verify app slots using smoke tests and perhaps warmups, then this could help you. A need based on keeping an app-service url hidden, while warming up a production slot in Azure made me create this little configurable function.
Sample usage of Fluent.Backdoor
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
var options = new RewriteOptions();
var fluent = new BackdoorRule().AllowAnythingFor(2)
.Require(new BackdoorMagicCookie()
{
CookieName = Configuration["CookieName"],
CookieValue = Configuration["CookieValue"]
})
.Require(new BackdoorMagicCookie()
{
CookieName = "hey",
CookieValue = "ho"
}).AndAllowFor(new TimeSpan(0, 0, 10))
.Require(new BackdoorMagicQuerystring
{
QuerystringName = Configuration["QuerystringName"],
QuerystringValue = Configuration["QuerystringValue"]
}).AndAllowFor(new TimeSpan(0, 0, 20))
.Require(new BackdoorMagicQuerystring
{
QuerystringName = "hey",
QuerystringValue = "ho"
}).AndAllowFor(new TimeSpan(0, 0, 20))
.Require(new BackdoorHttpHostAndRemoteIPAddress
{
HostNamesToProtect = Configuration["HostNamesToProtect"],
IPAddressesToAllowToUseProtectedUrls = Configuration["IPAddressesToAllowToUseProtectedUrls"]
}).AndAllowFor(new TimeSpan(0, 0, 60))
.ReturnCodeWhenDenied(System.Net.HttpStatusCode.Unauthorized)
.Finalize();
options.Rules.Add(fluent);
app.UseRewriter(options);
}
Example code above will:
- Allow any calls to the app 2 times.
- Allow access to the app for 10 second if two different cookies are present.
- Allow access to the app for 20 seconds if a querystring is supplied.
- Restrict access to the app if the HTTP_HOST contains HostNamesToProtect (RegEx-matching) and NOT in then list of IPAddressesToAllowToUseProtectedUrls (Remote_Addr).
The syntax is:
- What is Require() and if fulfilled,
- how long it will Allow() access.
Simple, right?
In the end a ReturnCodeWhenDenied and Finally is used to wrap it up.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. 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.
-
net6.0
- Microsoft.AspNetCore.Rewrite (>= 2.2.0)
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 |
---|---|---|
1.0.17 | 987 | 6/24/2022 |
1.0.16 | 427 | 6/21/2022 |
1.0.15 | 422 | 6/21/2022 |
1.0.14 | 422 | 6/21/2022 |
1.0.12 | 417 | 6/21/2022 |
1.0.11 | 409 | 6/19/2022 |
1.0.10 | 415 | 6/19/2022 |
1.0.9 | 407 | 6/19/2022 |
1.0.8 | 396 | 6/19/2022 |
1.0.7 | 411 | 6/19/2022 |
1.0.6 | 421 | 6/19/2022 |
1.0.5 | 419 | 6/19/2022 |
1.0.1 | 425 | 6/19/2022 |
1.0.0 | 427 | 6/19/2022 |