Only allow a trusted parameter "white list" through.
777479
def subscription_params
        optional_targets = (params[:subscription][:optional_targets] || {}).keys.select { |key| key.to_s.start_with?("subscribing_to_") }
        optional_targets.each do |optional_target_key|
          params[:subscription][:optional_targets][optional_target_key] = params[:subscription][:optional_targets][optional_target_key].to_boolean
        end
        params.require(:subscription).permit(:key, :subscribing, :subscribing_to_email, optional_targets: optional_targets)
      end
1348744
function (url) {
          if (url.substring(0, 2) !== '//' &&
            url.indexOf('://') === -1 &&
            whitelistLocalRequests) {
            return true;
          }

          for (var i = domains.length; i--;) {
            if (url.indexOf(domains[i]) !== -1) {
              return true;
            }
          }

          return false;
        }
1332606
def _Execute(self, options):
        """"""
        whitelist = dict(
            name=options["name"],
            description=options.get("description", "<empty>"))
        return self._agent.client.compute.security_groups.create(**whitelist)
909211
def untrust(self, scope, vk):
        """"""
        self.data['verifiers'].remove({'scope': scope, 'vk': vk})
        return self
953307
public void whiteListTargetBranches(Iterable<String> branches) {
        for (String branch : branches) {
            whiteListTargetBranches.add(new GhprbBranch(branch));
        }
    }
476952
def is_client_ip_address_whitelisted(request: AxesHttpRequest):
    

    if settings.AXES_NEVER_LOCKOUT_WHITELIST and is_ip_address_in_whitelist(request.axes_ip_address):
        return True

    if settings.AXES_ONLY_WHITELIST and is_ip_address_in_whitelist(request.axes_ip_address):
        return True

    return False
1016637
def guarded(meth):
    """"""

    @functools.wraps(meth)
    def _check(self, *args, **kwargs):
        self._check_conn_validity(meth.__name__)
        return meth(self, *args, **kwargs)

    return _check
14298
def start_accepting_passive_svc_checks(self):
        
        # todo: #783 create a dedicated brok for global parameters
        if not self.my_conf.accept_passive_service_checks:
            self.my_conf.modified_attributes |= DICT_MODATTR["MODATTR_PASSIVE_CHECKS_ENABLED"].value
            self.my_conf.accept_passive_service_checks = True
            self.my_conf.explode_global_conf()
            self.daemon.update_program_status()
929048
private boolean isInWhiteList(String tpl)
	{
		if ((!whiteList.isEmpty() && whiteList.contains(tpl))
				|| (whiteList.isEmpty())) {
			return true;
		}
		return false;
	}
1222873
public function whitelist_url( $url, $key = null, $ttl = null ) {
		$key                     = $key ? : $url;
		$this->whitelist[ $url ] = compact( 'key', 'ttl' );
	}
1357630
def filter_factory(global_conf, **local_conf):
    """"""
    conf = global_conf.copy()
    conf.update(local_conf)

    def trusted_shared_nets(app):
        return TrustedSharedNetwork(app, conf)
    return trusted_shared_nets
124094
def accept(self):
        """"""
        newsock, addr = socket.accept(self)
        ssl_sock = SSLSocket(newsock._sock,
                             keyfile=self.keyfile,
                             certfile=self.certfile,
                             server_side=True,
                             cert_reqs=self.cert_reqs,
                             ssl_version=self.ssl_version,
                             ca_certs=self.ca_certs,
                             do_handshake_on_connect=self.do_handshake_on_connect,
                             suppress_ragged_eofs=self.suppress_ragged_eofs,
                             ciphers=self.ciphers)
        return ssl_sock, addr
1271856
def trusted(self, scope=None):
        """"""
        trust = [(x['scope'], x['vk']) for x in self.data['verifiers']
                 if x['scope'] in (scope, '+')]
        trust.sort(key=lambda x: x[0])
        trust.reverse()
        return trust
1362591
function sensitiveFilter(validNodes) {
            var i;

            i = validNodes.length;
            while (i--) {
                if (self.isConnection(validNodes[i]) || self.isAbstract(validNodes[i])) {
                    validNodes.splice(i, 1);
                }
            }
        }
551401
function (params) {
        var countries = _data;
        var subset = [], i = 0;
        if (params.whitelist) {
            var whitelist = params.whitelist.split(",");
            for (i = 0; i < _data.length; i++) {
                if (whitelist.indexOf(_data[i][1]) !== -1) {
                    subset.push(_data[i]);
                }
            }
            countries = subset;
        } else if (params.blacklist) {
            var blacklist = params.blacklist.split(",");
            for (i = 0; i < _data.length; i++) {
                if (blacklist.indexOf(_data[i][1]) === -1) {
                    subset.push(_data[i]);
                }
            }
            countries = subset;
        }

        if (params.preferred) {
            countries = _applyPreferredCountries(countries, params.preferred, params.preferredDelim);
        }

        _countries = countries;

        // now init the regions
        _initRegions();
    }
36410
def allow(self, privilege):
        """"""
        assert privilege in PERMISSIONS['user'].keys()
        reading = PERMISSIONS['user'][privilege] + PERMISSIONS['group'][privilege] + PERMISSIONS['other'][privilege]
        os.chmod(self.file_path, reading)
308466
def trust(self, scope, vk):
        """"""
        self.data['verifiers'].append({'scope': scope, 'vk': vk})
        return self