serve ftp: Use new facilities in goftp to fix and simplify auth proxy #4394

- Use Driver.CheckPasswd instead of server.CheckPasswd
- Make server.CheckPasswd return an error
- Remove awful findID to find parent function hack
- Remove Driver.Init as it is no longer called
- Fix backwards incompatible PublicIp -> PublicIP change

See: https://gitea.com/goftp/server/issues/117
This commit is contained in:
Nick Craig-Wood
2020-06-29 14:09:45 +01:00
parent c7eae60944
commit af601575cb
2 changed files with 31 additions and 102 deletions

View File

@@ -8,7 +8,6 @@
package ftp
import (
"fmt"
"testing"
_ "github.com/rclone/rclone/backend/local"
@@ -17,7 +16,6 @@ import (
"github.com/rclone/rclone/fs/config/configmap"
"github.com/rclone/rclone/fs/config/obscure"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
ftp "goftp.io/server"
)
@@ -70,10 +68,3 @@ func TestFTP(t *testing.T) {
servetest.Run(t, "ftp", start)
}
func TestFindID(t *testing.T) {
id, err := findID([]byte("TestFindID("))
require.NoError(t, err)
// id should be the argument to this function
assert.Equal(t, fmt.Sprintf("%p", t), id)
}