FubarDevelopment / FtpServer

Portable FTP server written in .NET
http://fubardevelopment.github.io/FtpServer/
MIT License
474 stars 161 forks source link

Getting current user for a given FileSystem? #41

Closed johnkievlan closed 5 years ago

johnkievlan commented 5 years ago

I'm building a custom FileSystem provider using cloud storage, and I need to be able to pull the current FtpUser authenticated by the membership provider. I can't seem to find any way the file system is able to know anything about the current user (or connection) except the username, which isn't very useful for my purposes. Is this possible or do I just need to re-create the FtpUser within the FileSystem class?

fubar-coder commented 5 years ago

This is indeed something I didn't need yet, but it would be a very useful addition.

You have two options here:

  1. You can fork this project, create your custom IFtpUser implementation, change the IFileSystemClassFactory, etc., etc.
  2. You can create your own singleton service that allows storing additional user information and the mapping from a user name to this information and use this service in both you authentication and your file system.

Option 2 might work, but has limitations that you can live with. Option 1 is the better (clean) solution.

fubar-coder commented 5 years ago

Version 3.0-beta.1 is released.