Remove trap paths and known hosts: catch everything on the trap port
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b9f2b0443c
commit
9a56fc5b48
31 files changed
+335
-462
No files matched your search
@@ -43,6 +43,22 @@ public sealed class MigrationTests : IDisposable
|
||||
.ShouldBe(["GET /boaform/admin/formLogin", "GET example.com/.env"]);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Removes_obsolete_trap_path_and_known_host_overrides()
|
||||
{
|
||||
await using var db = new FlypaperDbContext(new DbContextOptionsBuilder<FlypaperDbContext>().UseSqlite($"Data Source={_dbPath}").Options);
|
||||
await db.GetService<IMigrator>().MigrateAsync("AddMcpTokens");
|
||||
await db.Database.ExecuteSqlRawAsync(
|
||||
"""
|
||||
INSERT INTO "Settings" ("Key", "Value")
|
||||
VALUES ('Flypaper:Http:ExtraKnownHosts', 'example.com'), ('Flypaper:Http:TrapPathsOverride', '/.env'), ('Flypaper:MaxConnections', '50')
|
||||
""");
|
||||
|
||||
await db.Database.MigrateAsync();
|
||||
|
||||
(await db.Settings.Select(s => s.Key).ToListAsync()).ShouldBe(["Flypaper:MaxConnections"]);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
SqliteConnection.ClearAllPools();
|
||||
|
||||
Reference in new issue
Block a user