Esempio n. 1
0
File: http.go Progetto: fxnn/gone
func createBasicAuth(realmName string, htpasswdFile gopath.GoPath) *auth.BasicAuth {
	var secretProvider = noSecrets
	if !htpasswdFile.HasErr() && !htpasswdFile.IsEmpty() {
		secretProvider = auth.HtpasswdFileProvider(htpasswdFile.Path())
	}
	return auth.NewBasicAuthenticator(realmName, secretProvider)
}