actions: add pre-download and pre-upload

Downloads and uploads can be denied based on hook response
This commit is contained in:
Nicola Murino
2021-05-26 07:48:37 +02:00
parent 600268ebb8
commit 25a44030f9
24 changed files with 710 additions and 176 deletions

View File

@@ -1251,10 +1251,10 @@ func TestConnection(t *testing.T) {
assert.Empty(t, connection.GetRemoteAddress())
assert.Empty(t, connection.GetCommand())
name := "missing file name"
_, err := connection.getFileReader(name, 0)
_, err := connection.getFileReader(name, 0, http.MethodGet)
assert.Error(t, err)
connection.User.FsConfig.Provider = vfs.LocalFilesystemProvider
_, err = connection.getFileReader(name, 0)
_, err = connection.getFileReader(name, 0, http.MethodGet)
assert.ErrorIs(t, err, os.ErrNotExist)
}