Added log info for auth and digest file

This commit is contained in:
Dipankar Sarkar 2014-12-11 23:48:11 +05:30
parent 8d3ea25764
commit d7b01e8994

View File

@ -96,6 +96,7 @@ func main() {
// Setup the authenticator object // Setup the authenticator object
if *httpAuthFile != "" { if *httpAuthFile != "" {
glog.Infof("Using auth file %s", *httpAuthFile)
secrets := auth.HtpasswdFileProvider(*httpAuthFile) secrets := auth.HtpasswdFileProvider(*httpAuthFile)
authenticator := auth.NewBasicAuthenticator(*httpAuthRealm, secrets) authenticator := auth.NewBasicAuthenticator(*httpAuthRealm, secrets)
http.HandleFunc(static.StaticResource, authenticator.Wrap(staticHandler)) http.HandleFunc(static.StaticResource, authenticator.Wrap(staticHandler))
@ -104,7 +105,8 @@ func main() {
} }
authenticated = true authenticated = true
} }
if *httpAuthFile=="" && *httpDigestFile != "" { if *httpAuthFile == "" && *httpDigestFile != "" {
glog.Infof("Using digest file %s", *httpDigestFile)
secrets := auth.HtdigestFileProvider(*httpDigestFile) secrets := auth.HtdigestFileProvider(*httpDigestFile)
authenticator := auth.NewDigestAuthenticator(*httpDigestRealm, secrets) authenticator := auth.NewDigestAuthenticator(*httpDigestRealm, secrets)
http.HandleFunc(static.StaticResource, authenticator.Wrap(staticHandler)) http.HandleFunc(static.StaticResource, authenticator.Wrap(staticHandler))