예제 #1
0
파일: http.go 프로젝트: 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)
}