mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 23:28:39 +03:00
external auth: add example HTTP server to use as authentication hook
The server authenticate against an LDAP server.
This commit is contained in:
17
examples/ldapauthserver/logger/sync_wrapper.go
Normal file
17
examples/ldapauthserver/logger/sync_wrapper.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package logger
|
||||
|
||||
import (
|
||||
"os"
|
||||
"sync"
|
||||
)
|
||||
|
||||
type logSyncWrapper struct {
|
||||
lock *sync.Mutex
|
||||
output *os.File
|
||||
}
|
||||
|
||||
func (l logSyncWrapper) Write(b []byte) (n int, err error) {
|
||||
l.lock.Lock()
|
||||
defer l.lock.Unlock()
|
||||
return l.output.Write(b)
|
||||
}
|
||||
Reference in New Issue
Block a user