Got at least one data fetching method working; turns out, we can't use a patched LogicStack to get the data

This commit is contained in:
2026-01-14 22:11:11 +01:00
parent 40a8431464
commit 3f7122d30a
350 changed files with 41444 additions and 119 deletions

View File

@@ -0,0 +1,43 @@
using EmbedIO.Security;
using System;
using System.Collections.Generic;
namespace EmbedIO
{
partial class WebModuleContainerExtensions
{
/// <summary>
/// Creates an instance of <see cref="IPBanningModule" /> and adds it to a module container.
/// </summary>
/// <typeparam name="TContainer">The type of the module container.</typeparam>
/// <param name="this">The <typeparamref name="TContainer" /> on which this method is called.</param>
/// <param name="whiteList">A collection of valid IPs that never will be banned.</param>
/// <param name="banMinutes">Minutes that an IP will remain banned.</param>
/// <returns>
/// <paramref name="this" /> with an <see cref="IPBanningModule" /> added.
/// </returns>
public static TContainer WithIPBanning<TContainer>(this TContainer @this,
IEnumerable<string>? whiteList = null,
int banMinutes = IPBanningModule.DefaultBanMinutes)
where TContainer : class, IWebModuleContainer =>
WithIPBanning(@this, null, whiteList, banMinutes);
/// <summary>
/// Creates an instance of <see cref="IPBanningModule" /> and adds it to a module container.
/// </summary>
/// <typeparam name="TContainer">The type of the module container.</typeparam>
/// <param name="this">The <typeparamref name="TContainer" /> on which this method is called.</param>
/// <param name="configure">The configure.</param>
/// <param name="whiteList">A collection of valid IPs that never will be banned.</param>
/// <param name="banMinutes">Minutes that an IP will remain banned.</param>
/// <returns>
/// <paramref name="this" /> with an <see cref="IPBanningModule" /> added.
/// </returns>
public static TContainer WithIPBanning<TContainer>(this TContainer @this,
Action<IPBanningModule>? configure,
IEnumerable<string>? whiteList = null,
int banMinutes = IPBanningModule.DefaultBanMinutes)
where TContainer : class, IWebModuleContainer =>
WithModule(@this, new IPBanningModule("/", whiteList, banMinutes), configure);
}
}