Example #1
0
func sutWithBruteblockerRequestAuthAndBasicAuth(
	requestAuth Authenticator,
	secrets auth.SecretProvider,
) (result HttpBasicAuthenticator) {
	result = sutWithBasicAuth(secrets)
	result.requestAuth = requestAuth
	result.bruteBlocker = bruteblocker.New(0, 0, 0, 0, 0)
	return
}
Example #2
0
File: gone.go Project: fxnn/gone
func createHttpAuthenticator(
	auth authenticator.Authenticator,
	contentRoot gopath.GoPath,
	cfg config.Config,
) authenticator.HttpAuthenticator {
	var bruteBlocker = bruteblocker.New(
		cfg.BruteforceMaxDelay,
		cfg.BruteforceDelayStep,
		cfg.BruteforceDelayStep/5,
		cfg.BruteforceDelayStep/20,
		cfg.BruteforceDropDelayAfter,
	)
	if cfg.RequireSSLHeader != "" {
		log.Printf("Requiring SSL header %s on login (by configuration)", cfg.RequireSSLHeader)
	}
	return authenticator.NewHttpBasicAuthenticator(
		auth,
		htpasswdFilePath(contentRoot),
		cfg.RequireSSLHeader,
		bruteBlocker,
	)
}