Skip to content

Feature/size command should call fs provider#5

Merged
esavini merged 2 commits into
masterfrom
feature/size-command-should-call-fs-provider
May 18, 2026
Merged

Feature/size command should call fs provider#5
esavini merged 2 commits into
masterfrom
feature/size-command-should-call-fs-provider

Conversation

@esavini

@esavini esavini commented May 18, 2026

Copy link
Copy Markdown
Member

This pull request introduces a middleware pipeline for FTP command handling, enabling extensibility and diagnostics in the FTP server. It adds a new middleware abstraction, integrates diagnostics middleware by default, and refactors the command handler to support middleware execution and response manipulation. The changes also include new tests for middleware behavior and updates to documentation and configuration.

Middleware Pipeline and Extensibility

  • Introduced the IFtpCommandMiddleware interface and refactored FtpCommandHandler to support a middleware pipeline for FTP commands, allowing middleware components to intercept and manipulate command execution and responses ([[1]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-be1769cf52238c2a184e01ac239f382ba86d63fc501f7d7fea88895c0bf1b5b1R1-R15), [[2]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-23691ea86c641d660da47a94922e826bbae3f51e91a772e61e7322cbc73eb244R1-R12), [[3]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-23691ea86c641d660da47a94922e826bbae3f51e91a772e61e7322cbc73eb244R32-R109)).
  • Updated the dependency injection builder (IFtpServerBuilder and FtpServerBuilder) to support middleware registration, and modified the service collection extension to add FtpDiagnosticsMiddleware by default ([[1]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-63ed1775302954ee385f24d81285348cee0036a56368da2936995cff0a6ebf33R16-R22), [[2]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-4d68034c8d068fb6e47ecf111f52d85ea7c40e5cc08947299e22e982ea1cfd42R1-R14), [[3]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-4c42389655fb76dfcd754dc13f43b9fcb2b6dbc59da1fb9c0442f26a450d96b9L35-R39)).

Diagnostics and Observability

  • Added FtpDiagnostics and FtpDiagnosticsMiddleware to provide tracing and metrics for FTP command execution, including command count and execution duration ([[1]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-c01d587c5baba9bc39bd4721a893c199cf615d52a7b967af569bf0f1843b183eR1-R35), [[2]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-5203d9bcf94f753e4aa8c4f28815d5ea37c0fb4a70418c133dbdaf1771e198abR1-R47)).

Testing and Validation

  • Added unit tests to verify middleware can manipulate FTP responses ([FmiSrl.FtpServer.Tests.Unit/Infrastructure/FtpMiddlewareTests.csR1-R61](https://github.com/fmisrl/ftpserver/pull/5/files#diff-34dd1d2745f366f5445d7e90edc367c65fae7432279a1da1b6ed9cdc3507d4bfR1-R61)).

Abstractions and Response Handling

  • Introduced the FtpResponse class and added a Response property to FtpCommandContext to standardize FTP command responses ([[1]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-24d7b00dff3fe20ff88f727940901a8fd15edf52284f5ea5270da1a74ea8695bR1-R31), [[2]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-01bc042ba7a4f828a197681bf817e437ec4cd3e1b2ea3208506890515adab86cR25-R29)).

Documentation and Configuration

  • Updated AGENTS.md with additional rules about .NET version downgrades and changed the required .NET SDK version in global.json ([[1]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-a54ff182c7e8acf56acfd6e4b9c3ff41e2c41a31c9b211b2deb9df75d9a478f9R5-R6), [[2]](https://github.com/fmisrl/ftpserver/pull/5/files#diff-8df3cd354bc584349d04ad5675b33c042d8b99b741b8b95af394c55e0f5001bfL3-R3)).

These changes collectively enhance the flexibility, observability, and maintainability of the FTP server.

@esavini esavini merged commit 3f96246 into master May 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant