Site commands implementation.#571
Conversation
|
Hi @hannesdejager - happy to discuss any concerns the team may have to progress this PR 🙂 |
|
Thanks, Martin! This is a really useful addition, and the implementation is nicely extensible. Also your project looks cool, integrating with Kafka. I may make a couple of small adjustments post merge to align the new API with the existing builder conventions. In particular, I’d like configuration problems—such as duplicate or invalid SITE command names and incompatible builder ordering—to be reported through ServerBuilder::build() rather than by panicking. I may also tighten command-name validation and clarify that custom SITE handlers run after authentication. These are API-hardening refinements; the overall design and implementation of your contribution will remain unchanged. Thanks again for contributing this! Lastly, do you really need |
|
Actually I was wondering if registration of sub-commands should perhaps just override. |
Enclosed is the implementation of site commands for libunftp.
The
ServerBuilderstructure gets a newsite_commandmethod to pass a subcommand and a SiteCommandHandler implementor. As a side-effect enumReplyandReplyCodehave become part of the SiteCommandHandler API, and are now fully documented.The existing
site md5subcommand remains untouched.All changes are tested with 100% coverage.
I developed this for an ongoing project: https://github.com/martin-cowie/ftp-kafka