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) }