etcdserver/server_access_control.go
func (ac *AccessController) IsHostWhitelisted(host string) bool {
	ac.hostWhitelistMu.RLock()
	defer ac.hostWhitelistMu.RUnlock()
	if len(ac.HostWhitelist) == 0 { // allow all
		return true
	}
	_, ok := ac.HostWhitelist["*"]
	if ok {
		return true
	}
	_, ok = ac.HostWhitelist[host]
	return ok
}
func (ac *AccessController) IsHostWhitelisted(host string) bool {
	ac.hostWhitelistMu.RLock()
	defer ac.hostWhitelistMu.RUnlock()
	if len(ac.HostWhitelist) == 0 { // allow all
		return true
	}
	_, ok := ac.HostWhitelist["*"]
	if ok {
		return true
	}
	_, ok = ac.HostWhitelist[host]
	return ok
}
func ( ac * AccessController ) IsHostWhitelisted ( host string ) bool { ac . hostWhitelistMu . RLock ( ) defer ac . hostWhitelistMu . RUnlock ( ) if len ( ac . HostWhitelist ) == 0 { // allow all return true } _ , ok := ac . HostWhitelist [ " " ] if ok { return true } _ , ok = ac . HostWhitelist [ host ] return ok }
// IsHostWhitelisted returns true if the host is whitelisted.
// If whitelist is empty, allow all.
IsHostWhitelisted returns true if the host is whitelisted . If whitelist is empty allow all .