From b0ac27c3c943e4db6c23e780f0e9829c1bdefcaf Mon Sep 17 00:00:00 2001 From: Alexander Karl Date: Wed, 13 Feb 2019 22:28:50 +0100 Subject: Init commit - welcome ftp-grab-password --- auth.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 auth.go (limited to 'auth.go') diff --git a/auth.go b/auth.go new file mode 100644 index 0000000..d056f1b --- /dev/null +++ b/auth.go @@ -0,0 +1,27 @@ +package main + +import( + "log" +) + +// Auth is an interface to auth your ftp user login. +type Auth interface { + CheckPasswd(string, string) (bool, error) +} + +var ( + _ Auth = &FakeAuth{} +) + +// FakeAuth implements Auth interface to provide a memory user login auth +type FakeAuth struct { + Name string + Password string +} + +// CheckPasswd will check user's password +func (a *FakeAuth) CheckPasswd(name, pass string) (bool, error) { + metrics_num_passwords++ + log.Printf("%s@ftp - %s", name, pass) + return false, nil +} -- cgit 1.4.1