mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 23:00:55 +03:00
add support for virtual folders
directories outside the user home directory can be exposed as virtual folders
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/drakkan/sftpgo/dataprovider"
|
||||
"github.com/drakkan/sftpgo/sftpd"
|
||||
"github.com/drakkan/sftpgo/utils"
|
||||
"github.com/drakkan/sftpgo/vfs"
|
||||
"github.com/go-chi/chi"
|
||||
)
|
||||
|
||||
@@ -103,6 +104,23 @@ func TestCheckUser(t *testing.T) {
|
||||
if err == nil {
|
||||
t.Errorf("Fs providers are not equal")
|
||||
}
|
||||
actual.FsConfig.Provider = 0
|
||||
expected.VirtualFolders = append(expected.VirtualFolders, vfs.VirtualFolder{
|
||||
VirtualPath: "/vdir",
|
||||
MappedPath: os.TempDir(),
|
||||
})
|
||||
err = checkUser(expected, actual)
|
||||
if err == nil {
|
||||
t.Errorf("Virtual folders are not equal")
|
||||
}
|
||||
actual.VirtualFolders = append(actual.VirtualFolders, vfs.VirtualFolder{
|
||||
VirtualPath: "/vdir1",
|
||||
MappedPath: os.TempDir(),
|
||||
})
|
||||
err = checkUser(expected, actual)
|
||||
if err == nil {
|
||||
t.Errorf("Virtual folders are not equal")
|
||||
}
|
||||
}
|
||||
|
||||
func TestCompareUserFilters(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user