MCPcopy
hub / github.com/OpenListTeam/OpenList / GetFileSystem

Method GetFileSystem

server/sftp.go:65–76  ·  view source on GitHub ↗
(sc *ssh.ServerConn)

Source from the content-addressed store, hash-verified

63}
64
65func (d *SftpDriver) GetFileSystem(sc *ssh.ServerConn) (sftpd.FileSystem, error) {
66 userObj, err := op.GetUserByName(sc.User())
67 if err != nil {
68 return nil, err
69 }
70 ctx := context.Background()
71 ctx = context.WithValue(ctx, conf.UserKey, userObj)
72 ctx = context.WithValue(ctx, conf.MetaPassKey, "")
73 ctx = context.WithValue(ctx, conf.ClientIPKey, sc.RemoteAddr().String())
74 ctx = context.WithValue(ctx, conf.ProxyHeaderKey, d.proxyHeader)
75 return &sftp.DriverAdapter{FtpDriver: ftp.NewAferoAdapter(ctx)}, nil
76}
77
78func (d *SftpDriver) Close() {
79}

Callers

nothing calls this directly

Calls 4

GetUserByNameFunction · 0.92
NewAferoAdapterFunction · 0.92
UserMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected