Feature/size command should call fs provider#5
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
IFtpCommandMiddlewareinterface and refactoredFtpCommandHandlerto 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)).IFtpServerBuilderandFtpServerBuilder) to support middleware registration, and modified the service collection extension to addFtpDiagnosticsMiddlewareby 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
FtpDiagnosticsandFtpDiagnosticsMiddlewareto 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
[FmiSrl.FtpServer.Tests.Unit/Infrastructure/FtpMiddlewareTests.csR1-R61](https://github.com/fmisrl/ftpserver/pull/5/files#diff-34dd1d2745f366f5445d7e90edc367c65fae7432279a1da1b6ed9cdc3507d4bfR1-R61)).Abstractions and Response Handling
FtpResponseclass and added aResponseproperty toFtpCommandContextto 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
AGENTS.mdwith additional rules about .NET version downgrades and changed the required .NET SDK version inglobal.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.