Only allow a trusted parameter 'white list' through.
333174
def validator_params
      wildcard = params.try(:[], :validator).try(:[], :resource_instance_additional_params).try(:keys)
      params.require(:validator).
      permit(:form_object,
             :resource_model,
             :resource_attr_name,
             :resource_attr_value,
             :ignore_resource_attr_value,
             :resource_instance_additional_params => wildcard)
    end
807349
def whitelisted_params
      whitelist = params_for_resource(:sign_up)

      whitelist.inject({}) do |coll, key|
        param = omniauth_params[key.to_s]
        coll[key] = param if param
        coll
      end
    end
190879
def __set_whitelist(self, whitelist=None):
        
        # add tag's names as key and list of enabled attributes as value for defaults
        self.whitelist = {}
        # tags that removed with contents
        self.sanitizelist = ['script', 'style']
        if isinstance(whitelist, dict) and '*' in whitelist.keys():
            self.isNotPurify = True
            self.whitelist_keys = []
            return
        else:
            self.isNotPurify = False
        self.whitelist.update(whitelist or {})
        self.whitelist_keys = self.whitelist.keys()
1047237
def _split_optional_netmask(address):
    """"""
    addr = str(address).split('/')
    if len(addr) > 2:
        raise AddressValueError("Only one '/' permitted in %r" % address)
    return addr
297029
def authorize(self, ctx, identity, ops):
        '''
        '''
        allowed = []
        caveats = []
        for op in ops:
            ok, fcaveats = self._f(ctx, identity, op)
            allowed.append(ok)
            if fcaveats is not None:
                caveats.extend(fcaveats)
        return allowed, caveats
364842
def clear_access(self, white_list=None):
        
        access_entries = self.get_ace_list()
        sid_list = access_entries.sid_list

        if white_list:
            sid_white_list = [UnityAclUser.get_sid(self._cli,
                                                   user,
                                                   self.cifs_server.domain)
                              for user in white_list]
            sid_list = list(set(sid_list) - set(sid_white_list))

        resp = self.delete_ace(sid=sid_list)
        resp.raise_if_err()
        return sid_list
926005
def allow_rwe(self, name):
        """"""
        assert name in PERMISSIONS.keys()
        os.chmod(self.file_path, PERMISSIONS[name]['all'])
775623
def _sanitize_request_params(self, request_params):
        """"""
        if 'verify_ssl' in request_params:
            request_params['verify'] = request_params.pop('verify_ssl')
        return dict((key, val) for key, val in request_params.items()
                    if key in self._VALID_REQUEST_ARGS)
1340446
def whitelist(ctx, whitelist_account, account):
    
    account = Account(account, blockchain_instance=ctx.blockchain)
    print_tx(account.whitelist(whitelist_account))
644023
def trusted_permission(f):
    """"""

    @functools.wraps(f)
    def wrapper(request, *args, **kwargs):
        trusted(request)
        return f(request, *args, **kwargs)

    return wrapper
121366
function allowOptionalParams(params, callback) {
    if (!callback) {
        callback = params;
        params = { };
    }
    return {
        params: params,
        callback: callback,
    };
}
588806
private static void disableSSLCertificateChecking() {
        TrustManager[] trustAllCerts = new TrustManager[] { new X509TrustManager() {
            public X509Certificate[] getAcceptedIssuers() {
                return null;
            }

            @Override
            public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
                // Not implemented
            }

            @Override
            public void checkServerTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
                // Not implemented
            }
        } };

        try {
            SSLContext sc = SSLContext.getInstance("TLS");
            sc.init(null, trustAllCerts, new java.security.SecureRandom());

            HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());

            // Create all-trusting host name verifier
            HostnameVerifier allHostsValid = new HostnameVerifier() {
                public boolean verify(String hostname, SSLSession session) {
                    return true;
                }
            };

            // Install the all-trusting host verifier
            HttpsURLConnection.setDefaultHostnameVerifier(allHostsValid);
        } catch (KeyManagementException e) {
            throw new IllegalArgumentException("Disabling SSL certificate failed: " + e,e);
        } catch (NoSuchAlgorithmException e) {
            throw new IllegalArgumentException("Disabling SSL certificate failed: " + e,e);
        }
    }
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
659668
def container_permitted(self, name):
        
        white = self._container_whitelist
        black = self._container_blacklist
        return name not in black and (not white or name in white)
1254876
public void filter(String className) throws SecurityException {
        if (blacklist.isListed(className)) {
            throw new SecurityException(format(DESERIALIZATION_ERROR, className));
        }
        // if whitelisting is enabled (either explicit or as a default whitelist), force the whitelist check
        if (useDefaultWhitelist || !whitelist.isEmpty()) {
            if (whitelist.isListed(className)
                    || (useDefaultWhitelist && DEFAULT_WHITELIST.isListed(className))) {
                return;
            }
            throw new SecurityException(format(DESERIALIZATION_ERROR, className));
        }
    }
700037
def validate(policy):
    
    for param, value in policy.items():

        if param not in ACCEPTED_SECURITY_TYPES.keys():
            raise SecurityError('Invalid Security Parameter: {}'.format(param))

        if type(value) != ACCEPTED_SECURITY_TYPES[param]:
            raise SecurityError('Invalid Parameter Data Type for {}, '
                                'Expecting: {} Received: {}'.format(
                                    param, ACCEPTED_SECURITY_TYPES[param],
                                    type(value)))
876878
def accept_all(self):
        '''
        
        '''
        keys = self.list_keys()
        for key in keys[self.PEND]:
            try:
                shutil.move(
                        os.path.join(
                            self.opts['pki_dir'],
                            self.PEND,
                            key),
                        os.path.join(
                            self.opts['pki_dir'],
                            self.ACC,
                            key)
                        )
                eload = {'result': True,
                         'act': 'accept',
                         'id': key}
                self.event.fire_event(eload,
                                      salt.utils.event.tagify(prefix='key'))
            except (IOError, OSError):
                pass
        return self.list_keys()