ipfilter plugin: add protocol

Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
Nicola Murino
2023-02-13 13:45:45 +01:00
parent 7738faa040
commit 2df2803a37
7 changed files with 10 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ go 1.20
require (
github.com/hashicorp/go-plugin v1.4.8
github.com/sftpgo/sdk v0.1.3-0.20230212154322-556375985d8c
github.com/sftpgo/sdk v0.1.3-0.20230213120720-de3129520736
)
require (

View File

@@ -37,6 +37,8 @@ github.com/sftpgo/sdk v0.1.3-0.20221208080405-e682ae869318 h1:oDr2it5L9nh13+P3Bz
github.com/sftpgo/sdk v0.1.3-0.20221208080405-e682ae869318/go.mod h1:3GpW3Qy8IHH6kex0ny+Y6ayeYb9OJxz8Pxh3IZgAs2E=
github.com/sftpgo/sdk v0.1.3-0.20230212154322-556375985d8c h1:SiWQZe99SZ/O4QSIsxzL91NgwFJNoo4IJ31cazUrYh4=
github.com/sftpgo/sdk v0.1.3-0.20230212154322-556375985d8c/go.mod h1:B1lPGb05WtvvrX5IuhHrSjWdRT867qBaoxlS2Q9+1bA=
github.com/sftpgo/sdk v0.1.3-0.20230213120720-de3129520736 h1:QFzoqYPIxuqDOe2NJfYI7J71bZrsfC0Aejc0ChblkcA=
github.com/sftpgo/sdk v0.1.3-0.20230213120720-de3129520736/go.mod h1:B1lPGb05WtvvrX5IuhHrSjWdRT867qBaoxlS2Q9+1bA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s=
github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals=

View File

@@ -9,7 +9,7 @@ import (
type Filter struct{}
func (f *Filter) CheckIP(ip string) error {
func (f *Filter) CheckIP(ip, protocol string) error {
if ip == "192.168.1.12" {
return fmt.Errorf("ip %q is not allowed", ip)
}