Check if the given request uses a whitelisted method.
512037
def is_client_method_whitelisted(request: AxesHttpRequest) -> bool:
    

    if settings.AXES_NEVER_LOCKOUT_GET and request.method == 'GET':
        return True

    return False
912721
def is_passive_request(self, request):
        
        if request.path in PASSIVE_URLS:
            return True

        try:
            match = resolve(request.path)
            # TODO: check namespaces too
            if match.url_name in PASSIVE_URL_NAMES:
                return True
        except Resolver404:
            pass

        return False
380867
private boolean isMethodAccessible(String url, RequestMethod method, Integer userRoleId) {
        boolean accessible = false;

        List<Integer> roleIdList = getPriviledgedRoles(url, method);
        if (roleIdList.contains(userRoleId)) {
            accessible = true;
        }

        return accessible;
    }
1289882
private void checkHttps(AmazonWebServiceRequest req) {
        if (req instanceof SSECustomerKeyProvider) {
            SSECustomerKeyProvider p = (SSECustomerKeyProvider) req;
            if (p.getSSECustomerKey() != null)
                assertHttps();
        } else if (req instanceof CopyObjectRequest) {
            CopyObjectRequest cor = (CopyObjectRequest) req;
            if (cor.getSourceSSECustomerKey() != null
            ||  cor.getDestinationSSECustomerKey() != null) {
                assertHttps();
            }
        } else if (req instanceof CopyPartRequest) {
            CopyPartRequest cpr = (CopyPartRequest) req;
            if (cpr.getSourceSSECustomerKey() != null
            ||  cpr.getDestinationSSECustomerKey() != null) {
                assertHttps();
            }
        }

        if (req instanceof SSEAwsKeyManagementParamsProvider) {
            SSEAwsKeyManagementParamsProvider p = (SSEAwsKeyManagementParamsProvider) req;
            if (p.getSSEAwsKeyManagementParams() != null)
                assertHttps();
        }
    }
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));
        }
    }
236450
function isWhitelisted(moduleId)
{
  var i;

  // check if its empty
  if (!this.whiteList.length)
  {
    return true;
  }

  // strip basePath
  moduleId = moduleId.replace(this.basePathRegexp, '');

  for (i = 0; i < this.whiteList.length; i++)
  {
    if (minimatch(moduleId, this.whiteList[i]))
    {
      return true;
    }
  }

  return false;
}
230323
public final function isAllowedRequestMethod(string $method): bool
    {
        return $this->allowedRequestMethods == null || in_array($method, (array) $this->allowedRequestMethods);
    }
418414
function isRemoteMethodAllowed(method, allowedVerbs) {

    let httpArray = method.http;

    if (!_.isArray(method.http)) {
        httpArray = [method.http];
    }

    const results = httpArray.map((item) => {

        const verb = item.verb;

        if (allowedVerbs && !_.includes(allowedVerbs, verb)) {
            return false;
        }

        return true;
    });

    const result = _.includes(results, true);

    return result;
}
660468
public static function isWhitelisted(Request $request, array $whiteList)
    {
        if (!\array_key_exists($request->getRequestMethod(), $whiteList)) {
            return false;
        }

        return \in_array($request->getPathInfo(), $whiteList[$request->getRequestMethod()], true);
    }
168780
public static void checkUnusedParameters(SQLiteModelMethod method, Set<String> usedMethodParameters, TypeName excludedClasses) {
		int paramsCount = method.getParameters().size();
		int usedCount = usedMethodParameters.size();

		if (paramsCount > usedCount) {
			StringBuilder sb = new StringBuilder();
			String separator = "";
			for (Pair<String, TypeName> item : method.getParameters()) {
				if (excludedClasses != null && item.value1.equals(excludedClasses)) {
					usedCount++;
				} else {
					if (!usedMethodParameters.contains(item.value0)) {
						sb.append(separator + "'" + item.value0 + "'");
						separator = ", ";
					}
				}
			}

			if (paramsCount > usedCount) {
				throw (new InvalidMethodSignException(method, "unused parameter(s) " + sb.toString()));
			}
		}
	}
227855
def _filter(self, event):
        '''
        
        '''
        tag = event['tag']
        if self.opts['event_return_whitelist']:
            ret = False
        else:
            ret = True
        for whitelist_match in self.opts['event_return_whitelist']:
            if fnmatch.fnmatch(tag, whitelist_match):
                ret = True
                break
        for blacklist_match in self.opts['event_return_blacklist']:
            if fnmatch.fnmatch(tag, blacklist_match):
                ret = False
                break
        return ret
500200
def verify_request_method env
        allowed = ALLOWED_METHODS
        allowed |= ALLOWED_METHODS_PRIVATE if whitelisted?(env)
        if !allowed.include?(env[METHOD])
          raise "Request method #{env[METHOD]} not allowed"
        end
      end
1094264
public boolean requestShouldBeHandledByTAI(HttpServletRequest request, MicroProfileJwtTaiRequest mpJwtTaiRequest, boolean defaultConfig) {
        String methodName = "requestShouldBeHandledByTAI";
        if (tc.isDebugEnabled()) {
            Tr.entry(tc, methodName, request, mpJwtTaiRequest);
        }

        mpJwtTaiRequest = setTaiRequestConfigInfo(request, mpJwtTaiRequest, defaultConfig);
        boolean result = false;
        boolean ignoreAppAuthMethod = true;

        MicroProfileJwtConfig mpJwtConfig = null;
        try {
            mpJwtConfig = mpJwtTaiRequest.getOnlyMatchingConfig();
        } catch (MpJwtProcessingException e) {

        }
        if (mpJwtConfig != null) {
            if (shouldDeferToJwtSso(request, mpJwtConfig, mpJwtTaiRequest.getJwtSsoConfig())) {
                return false;
            }
            ignoreAppAuthMethod = mpJwtConfig.ignoreApplicationAuthMethod(); // true by default
            if (ignoreAppAuthMethod) {
                result = mpJwtTaiRequest.hasServices();
            } else {
                result = isMpJwtSpecifiedInLoginConfig(request);
            }
        }

        if (tc.isDebugEnabled()) {
            Tr.exit(tc, methodName, result);
        }
        return result;
    }
237084
def hasmethod(obj, meth):
  
  if hasattr(obj, meth):
    return callable(getattr(obj,meth))
  return False
282850
public boolean isMethodSupported(String methodName,
                                   Class<?>... parameterTypes)
  throws IOException {
    if (serverMethods == null) { // client & server have the same protocol
      return true;
    }
    Method method;
    try {
      method = protocol.getDeclaredMethod(methodName, parameterTypes);
    } catch (SecurityException e) {
      throw new IOException(e);
    } catch (NoSuchMethodException e) {
      throw new IOException(e);
    }
    return serverMethods.contains(
        Integer.valueOf(ProtocolSignature.getFingerprint(method)));
  }
474482
protected boolean isHttpMethodMatch(String method) {
		if(StrUtil.isNotBlank(httpMethod) && httpMethod.equalsIgnoreCase(method) == false) {
			if(HuluSetting.isDevMode) {
				StaticLog.warn("Request [{}] method [{}] is not match [{}]", requestPath, method, httpMethod);
			}
			return false;
		}
		return true;
	}
1096262
public static function isMethod($method = null) {
		return isset($_SERVER['REQUEST_METHOD']) ? strtolower($_SERVER['REQUEST_METHOD']) == strtolower(trim($method)) : false;
	}