id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
129,100 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/common/OAuthCodec.java | OAuthCodec.oauthDecode | public static String oauthDecode(String value) throws DecoderException {
if (value == null) {
return "";
}
try {
return new String(URLCodec.decodeUrl(value.getBytes("US-ASCII")), "UTF-8");
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | java | public static String oauthDecode(String value) throws DecoderException {
if (value == null) {
return "";
}
try {
return new String(URLCodec.decodeUrl(value.getBytes("US-ASCII")), "UTF-8");
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"String",
"oauthDecode",
"(",
"String",
"value",
")",
"throws",
"DecoderException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"try",
"{",
"return",
"new",
"String",
"(",
"URLCodec",
".",
"decodeUrl",
... | Decode the specified value.
@param value The value to decode.
@return The decoded value.
@throws DecoderException when URLCodec fails | [
"Decode",
"the",
"specified",
"value",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/common/OAuthCodec.java#L72-L83 |
129,101 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/client/discovery/ProviderDiscoveryClient.java | ProviderDiscoveryClient.discover | public ProviderConfiguration discover() {
Map responseAttributes = this.restTemplate.getForObject(this.providerLocation, Map.class);
ProviderConfiguration.Builder builder = new ProviderConfiguration.Builder();
builder.issuer((String)responseAttributes.get(ISSUER_ATTR_NAME));
builder.authorizationEndpoint((Str... | java | public ProviderConfiguration discover() {
Map responseAttributes = this.restTemplate.getForObject(this.providerLocation, Map.class);
ProviderConfiguration.Builder builder = new ProviderConfiguration.Builder();
builder.issuer((String)responseAttributes.get(ISSUER_ATTR_NAME));
builder.authorizationEndpoint((Str... | [
"public",
"ProviderConfiguration",
"discover",
"(",
")",
"{",
"Map",
"responseAttributes",
"=",
"this",
".",
"restTemplate",
".",
"getForObject",
"(",
"this",
".",
"providerLocation",
",",
"Map",
".",
"class",
")",
";",
"ProviderConfiguration",
".",
"Builder",
"... | Discover the provider configuration information.
@throws RestClientException if the provider does not support discovery or for any HTTP-related errors
@return the provider configuration information | [
"Discover",
"the",
"provider",
"configuration",
"information",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/client/discovery/ProviderDiscoveryClient.java#L68-L86 |
129,102 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/store/JwtAccessTokenConverter.java | JwtAccessTokenConverter.getKey | public Map<String, String> getKey() {
Map<String, String> result = new LinkedHashMap<String, String>();
result.put("alg", signer.algorithm());
result.put("value", verifierKey);
return result;
} | java | public Map<String, String> getKey() {
Map<String, String> result = new LinkedHashMap<String, String>();
result.put("alg", signer.algorithm());
result.put("value", verifierKey);
return result;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"getKey",
"(",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"result",
"=",
"new",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"result",
".",
"put",
"(",
"\"alg\"",
",... | Get the verification key for the token signatures.
@return the key used to verify tokens | [
"Get",
"the",
"verification",
"key",
"for",
"the",
"token",
"signatures",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/store/JwtAccessTokenConverter.java#L147-L152 |
129,103 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/OAuth2Request.java | OAuth2Request.createOAuth2Request | public OAuth2Request createOAuth2Request(Map<String, String> parameters) {
return new OAuth2Request(parameters, getClientId(), authorities, approved, getScope(), resourceIds,
redirectUri, responseTypes, extensions);
} | java | public OAuth2Request createOAuth2Request(Map<String, String> parameters) {
return new OAuth2Request(parameters, getClientId(), authorities, approved, getScope(), resourceIds,
redirectUri, responseTypes, extensions);
} | [
"public",
"OAuth2Request",
"createOAuth2Request",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"return",
"new",
"OAuth2Request",
"(",
"parameters",
",",
"getClientId",
"(",
")",
",",
"authorities",
",",
"approved",
",",
"getScope",
"(... | Update the request parameters and return a new object with the same properties except the parameters.
@param parameters new parameters replacing the existing ones
@return a new OAuth2Request | [
"Update",
"the",
"request",
"parameters",
"and",
"return",
"a",
"new",
"object",
"with",
"the",
"same",
"properties",
"except",
"the",
"parameters",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/OAuth2Request.java#L133-L136 |
129,104 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/OAuth2Request.java | OAuth2Request.getGrantType | public String getGrantType() {
if (getRequestParameters().containsKey(OAuth2Utils.GRANT_TYPE)) {
return getRequestParameters().get(OAuth2Utils.GRANT_TYPE);
}
if (getRequestParameters().containsKey(OAuth2Utils.RESPONSE_TYPE)) {
String response = getRequestParameters().get(OAuth2Utils.RESPONSE_TYPE);
if (r... | java | public String getGrantType() {
if (getRequestParameters().containsKey(OAuth2Utils.GRANT_TYPE)) {
return getRequestParameters().get(OAuth2Utils.GRANT_TYPE);
}
if (getRequestParameters().containsKey(OAuth2Utils.RESPONSE_TYPE)) {
String response = getRequestParameters().get(OAuth2Utils.RESPONSE_TYPE);
if (r... | [
"public",
"String",
"getGrantType",
"(",
")",
"{",
"if",
"(",
"getRequestParameters",
"(",
")",
".",
"containsKey",
"(",
"OAuth2Utils",
".",
"GRANT_TYPE",
")",
")",
"{",
"return",
"getRequestParameters",
"(",
")",
".",
"get",
"(",
"OAuth2Utils",
".",
"GRANT_... | Tries to discover the grant type requested for the token associated with this request.
@return the grant type if known, or null otherwise | [
"Tries",
"to",
"discover",
"the",
"grant",
"type",
"requested",
"for",
"the",
"token",
"associated",
"with",
"this",
"request",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/OAuth2Request.java#L181-L192 |
129,105 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/HMAC_SHA1SignatureMethod.java | HMAC_SHA1SignatureMethod.sign | public String sign(String signatureBaseString) {
try {
Mac mac = Mac.getInstance(MAC_NAME);
mac.init(key);
byte[] text = signatureBaseString.getBytes("UTF-8");
byte[] signatureBytes = mac.doFinal(text);
signatureBytes = Base64.encodeBase64(signatureBytes);
String signature = new ... | java | public String sign(String signatureBaseString) {
try {
Mac mac = Mac.getInstance(MAC_NAME);
mac.init(key);
byte[] text = signatureBaseString.getBytes("UTF-8");
byte[] signatureBytes = mac.doFinal(text);
signatureBytes = Base64.encodeBase64(signatureBytes);
String signature = new ... | [
"public",
"String",
"sign",
"(",
"String",
"signatureBaseString",
")",
"{",
"try",
"{",
"Mac",
"mac",
"=",
"Mac",
".",
"getInstance",
"(",
"MAC_NAME",
")",
";",
"mac",
".",
"init",
"(",
"key",
")",
";",
"byte",
"[",
"]",
"text",
"=",
"signatureBaseStri... | Sign the signature base string. The signature is the digest octet string, first base64-encoded per RFC2045, section 6.8, then URL-encoded per
OAuth Parameter Encoding.
@param signatureBaseString The signature base string.
@return The signature. | [
"Sign",
"the",
"signature",
"base",
"string",
".",
"The",
"signature",
"is",
"the",
"digest",
"octet",
"string",
"first",
"base64",
"-",
"encoded",
"per",
"RFC2045",
"section",
"6",
".",
"8",
"then",
"URL",
"-",
"encoded",
"per",
"OAuth",
"Parameter",
"Enc... | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/HMAC_SHA1SignatureMethod.java#L75-L100 |
129,106 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/DefaultAuthenticationHandler.java | DefaultAuthenticationHandler.createAuthentication | public Authentication createAuthentication(HttpServletRequest request, ConsumerAuthentication authentication, OAuthAccessProviderToken authToken) {
if (authToken != null) {
Authentication userAuthentication = authToken.getUserAuthentication();
if (userAuthentication instanceof AbstractAuthenticationToke... | java | public Authentication createAuthentication(HttpServletRequest request, ConsumerAuthentication authentication, OAuthAccessProviderToken authToken) {
if (authToken != null) {
Authentication userAuthentication = authToken.getUserAuthentication();
if (userAuthentication instanceof AbstractAuthenticationToke... | [
"public",
"Authentication",
"createAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"ConsumerAuthentication",
"authentication",
",",
"OAuthAccessProviderToken",
"authToken",
")",
"{",
"if",
"(",
"authToken",
"!=",
"null",
")",
"{",
"Authentication",
"userAuthen... | Default implementation returns the user authentication associated with the auth token, if the token is provided. Otherwise, the consumer authentication
is returned.
@param request The request that was successfully authenticated.
@param authentication The consumer authentication (details about how the request was authe... | [
"Default",
"implementation",
"returns",
"the",
"user",
"authentication",
"associated",
"with",
"the",
"auth",
"token",
"if",
"the",
"token",
"is",
"provided",
".",
"Otherwise",
"the",
"consumer",
"authentication",
"is",
"returned",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/DefaultAuthenticationHandler.java#L26-L37 |
129,107 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java | OAuthProviderProcessingFilter.parametersAreAdequate | protected boolean parametersAreAdequate(Map<String, String> oauthParams) {
return oauthParams.containsKey(OAuthConsumerParameter.oauth_consumer_key.toString());
} | java | protected boolean parametersAreAdequate(Map<String, String> oauthParams) {
return oauthParams.containsKey(OAuthConsumerParameter.oauth_consumer_key.toString());
} | [
"protected",
"boolean",
"parametersAreAdequate",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"oauthParams",
")",
"{",
"return",
"oauthParams",
".",
"containsKey",
"(",
"OAuthConsumerParameter",
".",
"oauth_consumer_key",
".",
"toString",
"(",
")",
")",
";",
"... | By default, OAuth parameters are adequate if a consumer key is present.
@param oauthParams The oauth params.
@return Whether the parsed parameters are adequate. | [
"By",
"default",
"OAuth",
"parameters",
"are",
"adequate",
"if",
"a",
"consumer",
"key",
"is",
"present",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java#L220-L222 |
129,108 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java | OAuthProviderProcessingFilter.validateSignature | protected void validateSignature(ConsumerAuthentication authentication) throws AuthenticationException {
SignatureSecret secret = authentication.getConsumerDetails().getSignatureSecret();
String token = authentication.getConsumerCredentials().getToken();
OAuthProviderToken authToken = null;
if (token !=... | java | protected void validateSignature(ConsumerAuthentication authentication) throws AuthenticationException {
SignatureSecret secret = authentication.getConsumerDetails().getSignatureSecret();
String token = authentication.getConsumerCredentials().getToken();
OAuthProviderToken authToken = null;
if (token !=... | [
"protected",
"void",
"validateSignature",
"(",
"ConsumerAuthentication",
"authentication",
")",
"throws",
"AuthenticationException",
"{",
"SignatureSecret",
"secret",
"=",
"authentication",
".",
"getConsumerDetails",
"(",
")",
".",
"getSignatureSecret",
"(",
")",
";",
"... | Validate the signature of the request given the authentication request.
@param authentication The authentication request. | [
"Validate",
"the",
"signature",
"of",
"the",
"request",
"given",
"the",
"authentication",
"request",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java#L254-L277 |
129,109 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java | OAuthProviderProcessingFilter.validateOAuthParams | protected void validateOAuthParams(ConsumerDetails consumerDetails, Map<String, String> oauthParams) throws InvalidOAuthParametersException {
String version = oauthParams.get(OAuthConsumerParameter.oauth_version.toString());
if ((version != null) && (!"1.0".equals(version))) {
throw new OAuthVersionUnsupp... | java | protected void validateOAuthParams(ConsumerDetails consumerDetails, Map<String, String> oauthParams) throws InvalidOAuthParametersException {
String version = oauthParams.get(OAuthConsumerParameter.oauth_version.toString());
if ((version != null) && (!"1.0".equals(version))) {
throw new OAuthVersionUnsupp... | [
"protected",
"void",
"validateOAuthParams",
"(",
"ConsumerDetails",
"consumerDetails",
",",
"Map",
"<",
"String",
",",
"String",
">",
"oauthParams",
")",
"throws",
"InvalidOAuthParametersException",
"{",
"String",
"version",
"=",
"oauthParams",
".",
"get",
"(",
"OAu... | Validates the OAuth parameters for the given consumer. Base implementation validates only those parameters
that are required for all OAuth requests. This includes the nonce and timestamp, but not the signature.
@param consumerDetails The consumer details.
@param oauthParams The OAuth parameters to validate.
@throw... | [
"Validates",
"the",
"OAuth",
"parameters",
"for",
"the",
"given",
"consumer",
".",
"Base",
"implementation",
"validates",
"only",
"those",
"parameters",
"that",
"are",
"required",
"for",
"all",
"OAuth",
"requests",
".",
"This",
"includes",
"the",
"nonce",
"and",... | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java#L299-L341 |
129,110 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java | OAuthProviderProcessingFilter.fail | protected void fail(HttpServletRequest request, HttpServletResponse response, AuthenticationException failure) throws IOException, ServletException {
SecurityContextHolder.getContext().setAuthentication(null);
if (log.isDebugEnabled()) {
log.debug(failure);
}
authenticationEntryPoint.commence(re... | java | protected void fail(HttpServletRequest request, HttpServletResponse response, AuthenticationException failure) throws IOException, ServletException {
SecurityContextHolder.getContext().setAuthentication(null);
if (log.isDebugEnabled()) {
log.debug(failure);
}
authenticationEntryPoint.commence(re... | [
"protected",
"void",
"fail",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"AuthenticationException",
"failure",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"SecurityContextHolder",
".",
"getContext",
"(",
")",
".",
... | Common logic for OAuth failed.
@param request The request.
@param response The response.
@param failure The failure.
@throws IOException thrown when there's an underlying IO exception
@throws ServletException thrown in the case of an underlying Servlet exception | [
"Common",
"logic",
"for",
"OAuth",
"failed",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java#L371-L379 |
129,111 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java | OAuthProviderProcessingFilter.requiresAuthentication | protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) {
//copied from org.springframework.security.ui.AbstractProcessingFilter.requiresAuthentication
String uri = request.getRequestURI();
int pathParamIndex = uri.indexOf(';');
if (pa... | java | protected boolean requiresAuthentication(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) {
//copied from org.springframework.security.ui.AbstractProcessingFilter.requiresAuthentication
String uri = request.getRequestURI();
int pathParamIndex = uri.indexOf(';');
if (pa... | [
"protected",
"boolean",
"requiresAuthentication",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"FilterChain",
"filterChain",
")",
"{",
"//copied from org.springframework.security.ui.AbstractProcessingFilter.requiresAuthentication",
"String",
"uri... | Whether this filter is configured to process the specified request.
@param request The request.
@param response The response
@param filterChain The filter chain
@return Whether this filter is configured to process the specified request. | [
"Whether",
"this",
"filter",
"is",
"configured",
"to",
"process",
"the",
"specified",
"request",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java#L389-L408 |
129,112 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java | OAuthProviderProcessingFilter.skipProcessing | protected boolean skipProcessing(HttpServletRequest request) {
return ((request.getAttribute(OAUTH_PROCESSING_HANDLED) != null) && (Boolean.TRUE.equals(request.getAttribute(OAUTH_PROCESSING_HANDLED))));
} | java | protected boolean skipProcessing(HttpServletRequest request) {
return ((request.getAttribute(OAUTH_PROCESSING_HANDLED) != null) && (Boolean.TRUE.equals(request.getAttribute(OAUTH_PROCESSING_HANDLED))));
} | [
"protected",
"boolean",
"skipProcessing",
"(",
"HttpServletRequest",
"request",
")",
"{",
"return",
"(",
"(",
"request",
".",
"getAttribute",
"(",
"OAUTH_PROCESSING_HANDLED",
")",
"!=",
"null",
")",
"&&",
"(",
"Boolean",
".",
"TRUE",
".",
"equals",
"(",
"reque... | Whether to skip processing for the specified request.
@param request The request.
@return Whether to skip processing. | [
"Whether",
"to",
"skip",
"processing",
"for",
"the",
"specified",
"request",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java#L416-L418 |
129,113 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java | OAuthProviderProcessingFilter.setAllowedMethods | public void setAllowedMethods(List<String> allowedMethods) {
this.allowedMethods.clear();
if (allowedMethods != null) {
for (String allowedMethod : allowedMethods) {
this.allowedMethods.add(allowedMethod.toUpperCase());
}
}
} | java | public void setAllowedMethods(List<String> allowedMethods) {
this.allowedMethods.clear();
if (allowedMethods != null) {
for (String allowedMethod : allowedMethods) {
this.allowedMethods.add(allowedMethod.toUpperCase());
}
}
} | [
"public",
"void",
"setAllowedMethods",
"(",
"List",
"<",
"String",
">",
"allowedMethods",
")",
"{",
"this",
".",
"allowedMethods",
".",
"clear",
"(",
")",
";",
"if",
"(",
"allowedMethods",
"!=",
"null",
")",
"{",
"for",
"(",
"String",
"allowedMethod",
":",... | The allowed set of HTTP methods.
@param allowedMethods The allowed set of methods. | [
"The",
"allowed",
"set",
"of",
"HTTP",
"methods",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/OAuthProviderProcessingFilter.java#L584-L591 |
129,114 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/CoreOAuthProviderSupport.java | CoreOAuthProviderSupport.parseHeaderParameters | protected Map<String, String> parseHeaderParameters(HttpServletRequest request) {
String header = null;
Enumeration<String> headers = request.getHeaders("Authorization");
while (headers.hasMoreElements()) {
String value = headers.nextElement();
if ((value.toLowerCase().startsWith("oauth "))) {
... | java | protected Map<String, String> parseHeaderParameters(HttpServletRequest request) {
String header = null;
Enumeration<String> headers = request.getHeaders("Authorization");
while (headers.hasMoreElements()) {
String value = headers.nextElement();
if ((value.toLowerCase().startsWith("oauth "))) {
... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"parseHeaderParameters",
"(",
"HttpServletRequest",
"request",
")",
"{",
"String",
"header",
"=",
"null",
";",
"Enumeration",
"<",
"String",
">",
"headers",
"=",
"request",
".",
"getHeaders",
"(",
"\"Autho... | Parse the OAuth header parameters. The parameters will be oauth-decoded.
@param request The request.
@return The parsed parameters, or null if no OAuth authorization header was supplied. | [
"Parse",
"the",
"OAuth",
"header",
"parameters",
".",
"The",
"parameters",
"will",
"be",
"oauth",
"-",
"decoded",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/CoreOAuthProviderSupport.java#L73-L105 |
129,115 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/CoreOAuthProviderSupport.java | CoreOAuthProviderSupport.normalizeUrl | protected String normalizeUrl(String url) {
try {
URL requestURL = new URL(url);
StringBuilder normalized = new StringBuilder(requestURL.getProtocol().toLowerCase()).append("://").append(requestURL.getHost().toLowerCase());
if ((requestURL.getPort() >= 0) && (requestURL.getPort() != requestURL.get... | java | protected String normalizeUrl(String url) {
try {
URL requestURL = new URL(url);
StringBuilder normalized = new StringBuilder(requestURL.getProtocol().toLowerCase()).append("://").append(requestURL.getHost().toLowerCase());
if ((requestURL.getPort() >= 0) && (requestURL.getPort() != requestURL.get... | [
"protected",
"String",
"normalizeUrl",
"(",
"String",
"url",
")",
"{",
"try",
"{",
"URL",
"requestURL",
"=",
"new",
"URL",
"(",
"url",
")",
";",
"StringBuilder",
"normalized",
"=",
"new",
"StringBuilder",
"(",
"requestURL",
".",
"getProtocol",
"(",
")",
".... | Normalize the URL for use in the signature. The OAuth spec says the URL protocol and host are to be lower-case,
and the query and fragments are to be stripped.
@param url The URL.
@return The URL normalized for use in the signature. | [
"Normalize",
"the",
"URL",
"for",
"use",
"in",
"the",
"signature",
".",
"The",
"OAuth",
"spec",
"says",
"the",
"URL",
"protocol",
"and",
"host",
"are",
"to",
"be",
"lower",
"-",
"case",
"and",
"the",
"query",
"and",
"fragments",
"are",
"to",
"be",
"str... | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/CoreOAuthProviderSupport.java#L154-L167 |
129,116 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/UnauthenticatedRequestTokenProcessingFilter.java | UnauthenticatedRequestTokenProcessingFilter.createOAuthToken | protected OAuthProviderToken createOAuthToken(ConsumerAuthentication authentication) {
return getTokenServices().createUnauthorizedRequestToken(authentication.getConsumerDetails().getConsumerKey(),
authentication.getOAuthParameters().get(OAuthConsumerPara... | java | protected OAuthProviderToken createOAuthToken(ConsumerAuthentication authentication) {
return getTokenServices().createUnauthorizedRequestToken(authentication.getConsumerDetails().getConsumerKey(),
authentication.getOAuthParameters().get(OAuthConsumerPara... | [
"protected",
"OAuthProviderToken",
"createOAuthToken",
"(",
"ConsumerAuthentication",
"authentication",
")",
"{",
"return",
"getTokenServices",
"(",
")",
".",
"createUnauthorizedRequestToken",
"(",
"authentication",
".",
"getConsumerDetails",
"(",
")",
".",
"getConsumerKey"... | Create the OAuth token for the specified consumer key.
@param authentication The authentication request.
@return The OAuth token. | [
"Create",
"the",
"OAuth",
"token",
"for",
"the",
"specified",
"consumer",
"key",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/filter/UnauthenticatedRequestTokenProcessingFilter.java#L106-L109 |
129,117 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/store/jwk/JwkVerifyingJwtAccessTokenConverter.java | JwkVerifyingJwtAccessTokenConverter.decode | @Override
protected Map<String, Object> decode(String token) {
Map<String, String> headers = this.jwtHeaderConverter.convert(token);
// Validate "kid" header
String keyIdHeader = headers.get(KEY_ID);
if (keyIdHeader == null) {
throw new InvalidTokenException("Invalid JWT/JWS: " + KEY_ID + " is a required J... | java | @Override
protected Map<String, Object> decode(String token) {
Map<String, String> headers = this.jwtHeaderConverter.convert(token);
// Validate "kid" header
String keyIdHeader = headers.get(KEY_ID);
if (keyIdHeader == null) {
throw new InvalidTokenException("Invalid JWT/JWS: " + KEY_ID + " is a required J... | [
"@",
"Override",
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"decode",
"(",
"String",
"token",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
"=",
"this",
".",
"jwtHeaderConverter",
".",
"convert",
"(",
"token",
")",
";",
"//... | Decodes and validates the supplied JWT followed by signature verification
before returning the Claims from the JWT Payload.
@param token the JSON Web Token
@return a <code>Map</code> of the JWT Claims
@throws JwkException if the JWT is invalid or if the JWS could not be verified | [
"Decodes",
"and",
"validates",
"the",
"supplied",
"JWT",
"followed",
"by",
"signature",
"verification",
"before",
"returning",
"the",
"Claims",
"from",
"the",
"JWT",
"Payload",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/store/jwk/JwkVerifyingJwtAccessTokenConverter.java#L94-L132 |
129,118 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.configureURLForProtectedAccess | public URL configureURLForProtectedAccess(URL url, OAuthConsumerToken accessToken, String httpMethod, Map<String, String> additionalParameters) throws OAuthRequestFailedException {
return configureURLForProtectedAccess(url, accessToken, getProtectedResourceDetailsService().loadProtectedResourceDetailsById(accessTok... | java | public URL configureURLForProtectedAccess(URL url, OAuthConsumerToken accessToken, String httpMethod, Map<String, String> additionalParameters) throws OAuthRequestFailedException {
return configureURLForProtectedAccess(url, accessToken, getProtectedResourceDetailsService().loadProtectedResourceDetailsById(accessTok... | [
"public",
"URL",
"configureURLForProtectedAccess",
"(",
"URL",
"url",
",",
"OAuthConsumerToken",
"accessToken",
",",
"String",
"httpMethod",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalParameters",
")",
"throws",
"OAuthRequestFailedException",
"{",
"retu... | Create a configured URL. If the HTTP method to access the resource is "POST" or "PUT" and the "Authorization"
header isn't supported, then the OAuth parameters will be expected to be sent in the body of the request. Otherwise,
you can assume that the given URL is ready to be used without further work.
@param url ... | [
"Create",
"a",
"configured",
"URL",
".",
"If",
"the",
"HTTP",
"method",
"to",
"access",
"the",
"resource",
"is",
"POST",
"or",
"PUT",
"and",
"the",
"Authorization",
"header",
"isn",
"t",
"supported",
"then",
"the",
"OAuth",
"parameters",
"will",
"be",
"exp... | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L258-L260 |
129,119 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.configureURLForProtectedAccess | protected URL configureURLForProtectedAccess(URL url, OAuthConsumerToken requestToken, ProtectedResourceDetails details, String httpMethod, Map<String, String> additionalParameters) {
String file;
if (!"POST".equalsIgnoreCase(httpMethod) && !"PUT".equalsIgnoreCase(httpMethod) && !details.isAcceptsAuthorizationH... | java | protected URL configureURLForProtectedAccess(URL url, OAuthConsumerToken requestToken, ProtectedResourceDetails details, String httpMethod, Map<String, String> additionalParameters) {
String file;
if (!"POST".equalsIgnoreCase(httpMethod) && !"PUT".equalsIgnoreCase(httpMethod) && !details.isAcceptsAuthorizationH... | [
"protected",
"URL",
"configureURLForProtectedAccess",
"(",
"URL",
"url",
",",
"OAuthConsumerToken",
"requestToken",
",",
"ProtectedResourceDetails",
"details",
",",
"String",
"httpMethod",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalParameters",
")",
"{"... | Internal use of configuring the URL for protected access, the resource details already having been loaded.
@param url The URL.
@param requestToken The request token.
@param details The details.
@param httpMethod The http method.
@param additionalParameters Any additional request parameters.
@return The... | [
"Internal",
"use",
"of",
"configuring",
"the",
"URL",
"for",
"protected",
"access",
"the",
"resource",
"details",
"already",
"having",
"been",
"loaded",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L272-L300 |
129,120 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.findValidHeaderValue | protected String findValidHeaderValue(Set<CharSequence> paramValues) {
String selectedValue = null;
if (paramValues != null && !paramValues.isEmpty()) {
CharSequence value = paramValues.iterator().next();
if (!(value instanceof QueryParameterValue)) {
selectedValue = value.toString();
... | java | protected String findValidHeaderValue(Set<CharSequence> paramValues) {
String selectedValue = null;
if (paramValues != null && !paramValues.isEmpty()) {
CharSequence value = paramValues.iterator().next();
if (!(value instanceof QueryParameterValue)) {
selectedValue = value.toString();
... | [
"protected",
"String",
"findValidHeaderValue",
"(",
"Set",
"<",
"CharSequence",
">",
"paramValues",
")",
"{",
"String",
"selectedValue",
"=",
"null",
";",
"if",
"(",
"paramValues",
"!=",
"null",
"&&",
"!",
"paramValues",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Finds a valid header value that is valid for the OAuth header.
@param paramValues The possible values for the oauth header.
@return The selected value, or null if none were found. | [
"Finds",
"a",
"valid",
"header",
"value",
"that",
"is",
"valid",
"for",
"the",
"OAuth",
"header",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L341-L350 |
129,121 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.getTokenFromProvider | protected OAuthConsumerToken getTokenFromProvider(ProtectedResourceDetails details, URL tokenURL, String httpMethod,
OAuthConsumerToken requestToken, Map<String, String> additionalParameters) {
boolean isAccessToken = requestToken != null;
if (!isAccessToken) ... | java | protected OAuthConsumerToken getTokenFromProvider(ProtectedResourceDetails details, URL tokenURL, String httpMethod,
OAuthConsumerToken requestToken, Map<String, String> additionalParameters) {
boolean isAccessToken = requestToken != null;
if (!isAccessToken) ... | [
"protected",
"OAuthConsumerToken",
"getTokenFromProvider",
"(",
"ProtectedResourceDetails",
"details",
",",
"URL",
"tokenURL",
",",
"String",
"httpMethod",
",",
"OAuthConsumerToken",
"requestToken",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalParameters",
... | Get the consumer token with the given parameters and URL. The determination of whether the retrieved token
is an access token depends on whether a request token is provided.
@param details The resource details.
@param tokenURL The token URL.
@param httpMethod The http method.
@param requestToken The request... | [
"Get",
"the",
"consumer",
"token",
"with",
"the",
"given",
"parameters",
"and",
"URL",
".",
"The",
"determination",
"of",
"whether",
"the",
"retrieved",
"token",
"is",
"an",
"access",
"token",
"depends",
"on",
"whether",
"a",
"request",
"token",
"is",
"provi... | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L406-L475 |
129,122 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.urlDecode | protected String urlDecode(String token) {
try {
return URLDecoder.decode(token, "utf-8");
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | java | protected String urlDecode(String token) {
try {
return URLDecoder.decode(token, "utf-8");
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | [
"protected",
"String",
"urlDecode",
"(",
"String",
"token",
")",
"{",
"try",
"{",
"return",
"URLDecoder",
".",
"decode",
"(",
"token",
",",
"\"utf-8\"",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"e",
")",
"{",
"throw",
"new",
"RuntimeExcep... | URL-decode a token.
@param token The token to URL-decode.
@return The decoded token. | [
"URL",
"-",
"decode",
"a",
"token",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L575-L582 |
129,123 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.openConnection | protected HttpURLConnection openConnection(URL requestTokenURL) {
try {
HttpURLConnection connection = (HttpURLConnection) requestTokenURL.openConnection(selectProxy(requestTokenURL));
connection.setConnectTimeout(getConnectionTimeout());
connection.setReadTimeout(getReadTimeout());
return c... | java | protected HttpURLConnection openConnection(URL requestTokenURL) {
try {
HttpURLConnection connection = (HttpURLConnection) requestTokenURL.openConnection(selectProxy(requestTokenURL));
connection.setConnectTimeout(getConnectionTimeout());
connection.setReadTimeout(getReadTimeout());
return c... | [
"protected",
"HttpURLConnection",
"openConnection",
"(",
"URL",
"requestTokenURL",
")",
"{",
"try",
"{",
"HttpURLConnection",
"connection",
"=",
"(",
"HttpURLConnection",
")",
"requestTokenURL",
".",
"openConnection",
"(",
"selectProxy",
"(",
"requestTokenURL",
")",
"... | Open a connection to the given URL.
@param requestTokenURL The request token URL.
@return The HTTP URL connection. | [
"Open",
"a",
"connection",
"to",
"the",
"given",
"URL",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L590-L600 |
129,124 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.selectProxy | protected Proxy selectProxy(URL requestTokenURL) {
try {
List<Proxy> selectedProxies = getProxySelector().select(requestTokenURL.toURI());
return selectedProxies.isEmpty() ? Proxy.NO_PROXY : selectedProxies.get(0);
}
catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
... | java | protected Proxy selectProxy(URL requestTokenURL) {
try {
List<Proxy> selectedProxies = getProxySelector().select(requestTokenURL.toURI());
return selectedProxies.isEmpty() ? Proxy.NO_PROXY : selectedProxies.get(0);
}
catch (URISyntaxException e) {
throw new IllegalArgumentException(e);
... | [
"protected",
"Proxy",
"selectProxy",
"(",
"URL",
"requestTokenURL",
")",
"{",
"try",
"{",
"List",
"<",
"Proxy",
">",
"selectedProxies",
"=",
"getProxySelector",
"(",
")",
".",
"select",
"(",
"requestTokenURL",
".",
"toURI",
"(",
")",
")",
";",
"return",
"s... | Selects a proxy for the given URL.
@param requestTokenURL The URL
@return The proxy. | [
"Selects",
"a",
"proxy",
"for",
"the",
"given",
"URL",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L608-L616 |
129,125 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java | CoreOAuthConsumerSupport.getSignatureBaseString | protected String getSignatureBaseString(Map<String, Set<CharSequence>> oauthParams, URL requestURL, String httpMethod) {
TreeMap<String, TreeSet<String>> sortedParameters = new TreeMap<String, TreeSet<String>>();
for (Map.Entry<String, Set<CharSequence>> param : oauthParams.entrySet()) {
//first encode a... | java | protected String getSignatureBaseString(Map<String, Set<CharSequence>> oauthParams, URL requestURL, String httpMethod) {
TreeMap<String, TreeSet<String>> sortedParameters = new TreeMap<String, TreeSet<String>>();
for (Map.Entry<String, Set<CharSequence>> param : oauthParams.entrySet()) {
//first encode a... | [
"protected",
"String",
"getSignatureBaseString",
"(",
"Map",
"<",
"String",
",",
"Set",
"<",
"CharSequence",
">",
">",
"oauthParams",
",",
"URL",
"requestURL",
",",
"String",
"httpMethod",
")",
"{",
"TreeMap",
"<",
"String",
",",
"TreeSet",
"<",
"String",
">... | Get the signature base string for the specified parameters. It is presumed the parameters are NOT OAuth-encoded.
@param oauthParams The parameters (NOT oauth-encoded).
@param requestURL The request URL.
@param httpMethod The http method.
@return The signature base string. | [
"Get",
"the",
"signature",
"base",
"string",
"for",
"the",
"specified",
"parameters",
".",
"It",
"is",
"presumed",
"the",
"parameters",
"are",
"NOT",
"OAuth",
"-",
"encoded",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/client/CoreOAuthConsumerSupport.java#L626-L670 |
129,126 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/client/filter/OAuth2ClientContextFilter.java | OAuth2ClientContextFilter.redirectUser | protected void redirectUser(UserRedirectRequiredException e,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
String redirectUri = e.getRedirectUri();
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(redirectUri);
Map<String, String> requestParams = e.getRe... | java | protected void redirectUser(UserRedirectRequiredException e,
HttpServletRequest request, HttpServletResponse response)
throws IOException {
String redirectUri = e.getRedirectUri();
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl(redirectUri);
Map<String, String> requestParams = e.getRe... | [
"protected",
"void",
"redirectUser",
"(",
"UserRedirectRequiredException",
"e",
",",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"String",
"redirectUri",
"=",
"e",
".",
"getRedirectUri",
"(",
")",
";",
... | Redirect the user according to the specified exception.
@param e
The user redirect exception.
@param request
The request.
@param response
The response. | [
"Redirect",
"the",
"user",
"according",
"to",
"the",
"specified",
"exception",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/client/filter/OAuth2ClientContextFilter.java#L93-L111 |
129,127 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/client/filter/OAuth2ClientContextFilter.java | OAuth2ClientContextFilter.calculateCurrentUri | protected String calculateCurrentUri(HttpServletRequest request)
throws UnsupportedEncodingException {
ServletUriComponentsBuilder builder = ServletUriComponentsBuilder
.fromRequest(request);
// Now work around SPR-10172...
String queryString = request.getQueryString();
boolean legalSpaces = queryString ... | java | protected String calculateCurrentUri(HttpServletRequest request)
throws UnsupportedEncodingException {
ServletUriComponentsBuilder builder = ServletUriComponentsBuilder
.fromRequest(request);
// Now work around SPR-10172...
String queryString = request.getQueryString();
boolean legalSpaces = queryString ... | [
"protected",
"String",
"calculateCurrentUri",
"(",
"HttpServletRequest",
"request",
")",
"throws",
"UnsupportedEncodingException",
"{",
"ServletUriComponentsBuilder",
"builder",
"=",
"ServletUriComponentsBuilder",
".",
"fromRequest",
"(",
"request",
")",
";",
"// Now work aro... | Calculate the current URI given the request.
@param request
The request.
@return The current uri. | [
"Calculate",
"the",
"current",
"URI",
"given",
"the",
"request",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/client/filter/OAuth2ClientContextFilter.java#L120-L144 |
129,128 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/config/annotation/web/configurers/AuthorizationServerSecurityConfigurer.java | AuthorizationServerSecurityConfigurer.tokenEndpointAuthenticationFilters | public void tokenEndpointAuthenticationFilters(List<Filter> filters) {
Assert.notNull(filters, "Custom authentication filter list must not be null");
this.tokenEndpointAuthenticationFilters = new ArrayList<Filter>(filters);
} | java | public void tokenEndpointAuthenticationFilters(List<Filter> filters) {
Assert.notNull(filters, "Custom authentication filter list must not be null");
this.tokenEndpointAuthenticationFilters = new ArrayList<Filter>(filters);
} | [
"public",
"void",
"tokenEndpointAuthenticationFilters",
"(",
"List",
"<",
"Filter",
">",
"filters",
")",
"{",
"Assert",
".",
"notNull",
"(",
"filters",
",",
"\"Custom authentication filter list must not be null\"",
")",
";",
"this",
".",
"tokenEndpointAuthenticationFilter... | Sets a new list of custom authentication filters for the TokenEndpoint. Filters will be set upstream of the
default BasicAuthenticationFilter.
@param filters The authentication filters to set. | [
"Sets",
"a",
"new",
"list",
"of",
"custom",
"authentication",
"filters",
"for",
"the",
"TokenEndpoint",
".",
"Filters",
"will",
"be",
"set",
"upstream",
"of",
"the",
"default",
"BasicAuthenticationFilter",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/config/annotation/web/configurers/AuthorizationServerSecurityConfigurer.java#L244-L247 |
129,129 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/attributes/ConsumerSecurityVoter.java | ConsumerSecurityVoter.vote | public int vote(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) {
int result = ACCESS_ABSTAIN;
if (authentication.getDetails() instanceof OAuthAuthenticationDetails) {
OAuthAuthenticationDetails details = (OAuthAuthenticationDetails) authentication.getDetails()... | java | public int vote(Authentication authentication, Object object, Collection<ConfigAttribute> configAttributes) {
int result = ACCESS_ABSTAIN;
if (authentication.getDetails() instanceof OAuthAuthenticationDetails) {
OAuthAuthenticationDetails details = (OAuthAuthenticationDetails) authentication.getDetails()... | [
"public",
"int",
"vote",
"(",
"Authentication",
"authentication",
",",
"Object",
"object",
",",
"Collection",
"<",
"ConfigAttribute",
">",
"configAttributes",
")",
"{",
"int",
"result",
"=",
"ACCESS_ABSTAIN",
";",
"if",
"(",
"authentication",
".",
"getDetails",
... | Votes on giving access to the specified authentication based on the security attributes.
@param authentication The authentication.
@param object The object.
@param configAttributes the ConfigAttributes.
@return The vote. | [
"Votes",
"on",
"giving",
"access",
"to",
"the",
"specified",
"authentication",
"based",
"on",
"the",
"security",
"attributes",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/attributes/ConsumerSecurityVoter.java#L62-L97 |
129,130 | spring-projects/spring-security-oauth | samples/oauth2/sparklr/src/main/java/org/springframework/security/oauth/examples/sparklr/config/WebMvcConfig.java | WebMvcConfig.adminController | @Bean
public AdminController adminController(TokenStore tokenStore,
@Qualifier("consumerTokenServices") ConsumerTokenServices tokenServices,
SparklrUserApprovalHandler userApprovalHandler) {
AdminController adminController = new AdminController();
adminController.setTokenStore(tokenStore);
adminController.... | java | @Bean
public AdminController adminController(TokenStore tokenStore,
@Qualifier("consumerTokenServices") ConsumerTokenServices tokenServices,
SparklrUserApprovalHandler userApprovalHandler) {
AdminController adminController = new AdminController();
adminController.setTokenStore(tokenStore);
adminController.... | [
"@",
"Bean",
"public",
"AdminController",
"adminController",
"(",
"TokenStore",
"tokenStore",
",",
"@",
"Qualifier",
"(",
"\"consumerTokenServices\"",
")",
"ConsumerTokenServices",
"tokenServices",
",",
"SparklrUserApprovalHandler",
"userApprovalHandler",
")",
"{",
"AdminCo... | N.B. the @Qualifier here should not be necessary (gh-298) but lots of users report needing it. | [
"N",
".",
"B",
".",
"the"
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/samples/oauth2/sparklr/src/main/java/org/springframework/security/oauth/examples/sparklr/config/WebMvcConfig.java#L100-L109 |
129,131 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/approval/TokenApprovalStore.java | TokenApprovalStore.revokeApprovals | @Override
public boolean revokeApprovals(Collection<Approval> approvals) {
boolean success = true;
for (Approval approval : approvals) {
Collection<OAuth2AccessToken> tokens = store.findTokensByClientIdAndUserName(approval.getClientId(), approval.getUserId());
for (OAuth2AccessToken token : tokens) {
OAu... | java | @Override
public boolean revokeApprovals(Collection<Approval> approvals) {
boolean success = true;
for (Approval approval : approvals) {
Collection<OAuth2AccessToken> tokens = store.findTokensByClientIdAndUserName(approval.getClientId(), approval.getUserId());
for (OAuth2AccessToken token : tokens) {
OAu... | [
"@",
"Override",
"public",
"boolean",
"revokeApprovals",
"(",
"Collection",
"<",
"Approval",
">",
"approvals",
")",
"{",
"boolean",
"success",
"=",
"true",
";",
"for",
"(",
"Approval",
"approval",
":",
"approvals",
")",
"{",
"Collection",
"<",
"OAuth2AccessTok... | Revoke all tokens that match the client and user in the approvals supplied.
@see org.springframework.security.oauth2.provider.approval.ApprovalStore#revokeApprovals(java.util.Collection) | [
"Revoke",
"all",
"tokens",
"that",
"match",
"the",
"client",
"and",
"user",
"in",
"the",
"approvals",
"supplied",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/approval/TokenApprovalStore.java#L66-L80 |
129,132 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/approval/TokenApprovalStore.java | TokenApprovalStore.getApprovals | @Override
public Collection<Approval> getApprovals(String userId, String clientId) {
Collection<Approval> result = new HashSet<Approval>();
Collection<OAuth2AccessToken> tokens = store.findTokensByClientIdAndUserName(clientId, userId);
for (OAuth2AccessToken token : tokens) {
OAuth2Authentication authenticati... | java | @Override
public Collection<Approval> getApprovals(String userId, String clientId) {
Collection<Approval> result = new HashSet<Approval>();
Collection<OAuth2AccessToken> tokens = store.findTokensByClientIdAndUserName(clientId, userId);
for (OAuth2AccessToken token : tokens) {
OAuth2Authentication authenticati... | [
"@",
"Override",
"public",
"Collection",
"<",
"Approval",
">",
"getApprovals",
"(",
"String",
"userId",
",",
"String",
"clientId",
")",
"{",
"Collection",
"<",
"Approval",
">",
"result",
"=",
"new",
"HashSet",
"<",
"Approval",
">",
"(",
")",
";",
"Collecti... | Extract the implied approvals from any tokens associated with the user and client id supplied.
@see org.springframework.security.oauth2.provider.approval.ApprovalStore#getApprovals(java.lang.String,
java.lang.String) | [
"Extract",
"the",
"implied",
"approvals",
"from",
"any",
"tokens",
"associated",
"with",
"the",
"user",
"and",
"client",
"id",
"supplied",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/approval/TokenApprovalStore.java#L88-L102 |
129,133 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/filter/OAuthConsumerContextFilter.java | OAuthConsumerContextFilter.checkForResourceThatNeedsAuthorization | protected ProtectedResourceDetails checkForResourceThatNeedsAuthorization(Exception ex) throws ServletException, IOException {
Throwable[] causeChain = getThrowableAnalyzer().determineCauseChain(ex);
AccessTokenRequiredException ase = (AccessTokenRequiredException) getThrowableAnalyzer().getFirstThrowableOfType(Acc... | java | protected ProtectedResourceDetails checkForResourceThatNeedsAuthorization(Exception ex) throws ServletException, IOException {
Throwable[] causeChain = getThrowableAnalyzer().determineCauseChain(ex);
AccessTokenRequiredException ase = (AccessTokenRequiredException) getThrowableAnalyzer().getFirstThrowableOfType(Acc... | [
"protected",
"ProtectedResourceDetails",
"checkForResourceThatNeedsAuthorization",
"(",
"Exception",
"ex",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"Throwable",
"[",
"]",
"causeChain",
"=",
"getThrowableAnalyzer",
"(",
")",
".",
"determineCauseChain",
"... | Check the given exception for the resource that needs authorization. If the exception was not thrown because a resource needed authorization, then rethrow
the exception.
@param ex The exception.
@return The resource that needed authorization (never null).
@throws ServletException in the case of an underlying Servlet A... | [
"Check",
"the",
"given",
"exception",
"for",
"the",
"resource",
"that",
"needs",
"authorization",
".",
"If",
"the",
"exception",
"was",
"not",
"thrown",
"because",
"a",
"resource",
"needed",
"authorization",
"then",
"rethrow",
"the",
"exception",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/filter/OAuthConsumerContextFilter.java#L256-L282 |
129,134 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/filter/OAuthConsumerContextFilter.java | OAuthConsumerContextFilter.getUserAuthorizationRedirectURL | protected String getUserAuthorizationRedirectURL(ProtectedResourceDetails details, OAuthConsumerToken requestToken, String callbackURL) {
try {
String baseURL = details.getUserAuthorizationURL();
StringBuilder builder = new StringBuilder(baseURL);
char appendChar = baseURL.indexOf('?') < 0 ? '?' : '&';
bu... | java | protected String getUserAuthorizationRedirectURL(ProtectedResourceDetails details, OAuthConsumerToken requestToken, String callbackURL) {
try {
String baseURL = details.getUserAuthorizationURL();
StringBuilder builder = new StringBuilder(baseURL);
char appendChar = baseURL.indexOf('?') < 0 ? '?' : '&';
bu... | [
"protected",
"String",
"getUserAuthorizationRedirectURL",
"(",
"ProtectedResourceDetails",
"details",
",",
"OAuthConsumerToken",
"requestToken",
",",
"String",
"callbackURL",
")",
"{",
"try",
"{",
"String",
"baseURL",
"=",
"details",
".",
"getUserAuthorizationURL",
"(",
... | Get the URL to which to redirect the user for authorization of protected resources.
@param details The resource for which to get the authorization url.
@param requestToken The request token.
@param callbackURL The callback URL.
@return The URL. | [
"Get",
"the",
"URL",
"to",
"which",
"to",
"redirect",
"the",
"user",
"for",
"authorization",
"of",
"protected",
"resources",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/consumer/filter/OAuthConsumerContextFilter.java#L302-L318 |
129,135 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/DefaultTokenServices.java | DefaultTokenServices.createRefreshedAuthentication | private OAuth2Authentication createRefreshedAuthentication(OAuth2Authentication authentication, TokenRequest request) {
OAuth2Authentication narrowed = authentication;
Set<String> scope = request.getScope();
OAuth2Request clientAuth = authentication.getOAuth2Request().refresh(request);
if (scope != null && !sco... | java | private OAuth2Authentication createRefreshedAuthentication(OAuth2Authentication authentication, TokenRequest request) {
OAuth2Authentication narrowed = authentication;
Set<String> scope = request.getScope();
OAuth2Request clientAuth = authentication.getOAuth2Request().refresh(request);
if (scope != null && !sco... | [
"private",
"OAuth2Authentication",
"createRefreshedAuthentication",
"(",
"OAuth2Authentication",
"authentication",
",",
"TokenRequest",
"request",
")",
"{",
"OAuth2Authentication",
"narrowed",
"=",
"authentication",
";",
"Set",
"<",
"String",
">",
"scope",
"=",
"request",... | Create a refreshed authentication.
@param authentication The authentication.
@param request The scope for the refreshed token.
@return The refreshed authentication.
@throws InvalidScopeException If the scope requested is invalid or wider than the original scope. | [
"Create",
"a",
"refreshed",
"authentication",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/DefaultTokenServices.java#L196-L212 |
129,136 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/DefaultTokenServices.java | DefaultTokenServices.getAccessTokenValiditySeconds | protected int getAccessTokenValiditySeconds(OAuth2Request clientAuth) {
if (clientDetailsService != null) {
ClientDetails client = clientDetailsService.loadClientByClientId(clientAuth.getClientId());
Integer validity = client.getAccessTokenValiditySeconds();
if (validity != null) {
return validity;
}
... | java | protected int getAccessTokenValiditySeconds(OAuth2Request clientAuth) {
if (clientDetailsService != null) {
ClientDetails client = clientDetailsService.loadClientByClientId(clientAuth.getClientId());
Integer validity = client.getAccessTokenValiditySeconds();
if (validity != null) {
return validity;
}
... | [
"protected",
"int",
"getAccessTokenValiditySeconds",
"(",
"OAuth2Request",
"clientAuth",
")",
"{",
"if",
"(",
"clientDetailsService",
"!=",
"null",
")",
"{",
"ClientDetails",
"client",
"=",
"clientDetailsService",
".",
"loadClientByClientId",
"(",
"clientAuth",
".",
"... | The access token validity period in seconds
@param clientAuth the current authorization request
@return the access token validity period in seconds | [
"The",
"access",
"token",
"validity",
"period",
"in",
"seconds"
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/DefaultTokenServices.java#L310-L319 |
129,137 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/DefaultTokenServices.java | DefaultTokenServices.getRefreshTokenValiditySeconds | protected int getRefreshTokenValiditySeconds(OAuth2Request clientAuth) {
if (clientDetailsService != null) {
ClientDetails client = clientDetailsService.loadClientByClientId(clientAuth.getClientId());
Integer validity = client.getRefreshTokenValiditySeconds();
if (validity != null) {
return validity;
... | java | protected int getRefreshTokenValiditySeconds(OAuth2Request clientAuth) {
if (clientDetailsService != null) {
ClientDetails client = clientDetailsService.loadClientByClientId(clientAuth.getClientId());
Integer validity = client.getRefreshTokenValiditySeconds();
if (validity != null) {
return validity;
... | [
"protected",
"int",
"getRefreshTokenValiditySeconds",
"(",
"OAuth2Request",
"clientAuth",
")",
"{",
"if",
"(",
"clientDetailsService",
"!=",
"null",
")",
"{",
"ClientDetails",
"client",
"=",
"clientDetailsService",
".",
"loadClientByClientId",
"(",
"clientAuth",
".",
... | The refresh token validity period in seconds
@param clientAuth the current authorization request
@return the refresh token validity period in seconds | [
"The",
"refresh",
"token",
"validity",
"period",
"in",
"seconds"
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/token/DefaultTokenServices.java#L327-L336 |
129,138 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/nonce/ExpiringTimestampNonceServices.java | ExpiringTimestampNonceServices.validateNonce | public void validateNonce(ConsumerDetails consumerDetails, long timestamp, String nonce) throws AuthenticationException {
long nowSeconds = (System.currentTimeMillis() / 1000);
if ((nowSeconds - timestamp) > getValidityWindowSeconds()) {
throw new CredentialsExpiredException("Expired timestamp.");
}
... | java | public void validateNonce(ConsumerDetails consumerDetails, long timestamp, String nonce) throws AuthenticationException {
long nowSeconds = (System.currentTimeMillis() / 1000);
if ((nowSeconds - timestamp) > getValidityWindowSeconds()) {
throw new CredentialsExpiredException("Expired timestamp.");
}
... | [
"public",
"void",
"validateNonce",
"(",
"ConsumerDetails",
"consumerDetails",
",",
"long",
"timestamp",
",",
"String",
"nonce",
")",
"throws",
"AuthenticationException",
"{",
"long",
"nowSeconds",
"=",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
"/",
"1000"... | we'll default to a 12-hour validity window. | [
"we",
"ll",
"default",
"to",
"a",
"12",
"-",
"hour",
"validity",
"window",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/provider/nonce/ExpiringTimestampNonceServices.java#L37-L42 |
129,139 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/PlainTextSignatureMethod.java | PlainTextSignatureMethod.verify | public void verify(String signatureBaseString, String signature) throws InvalidSignatureException {
if (this.encoder != null) {
if (!this.encoder.isPasswordValid(this.secret, signature, this.salt)) {
throw new InvalidSignatureException("Invalid signature for signature method " + getName());
}
... | java | public void verify(String signatureBaseString, String signature) throws InvalidSignatureException {
if (this.encoder != null) {
if (!this.encoder.isPasswordValid(this.secret, signature, this.salt)) {
throw new InvalidSignatureException("Invalid signature for signature method " + getName());
}
... | [
"public",
"void",
"verify",
"(",
"String",
"signatureBaseString",
",",
"String",
"signature",
")",
"throws",
"InvalidSignatureException",
"{",
"if",
"(",
"this",
".",
"encoder",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"this",
".",
"encoder",
".",
"isPassword... | Validates that the signature is the same as the secret.
@param signatureBaseString The signature base string (unimportant, ignored).
@param signature The signature.
@throws InvalidSignatureException If the signature is not the same as the secret. | [
"Validates",
"that",
"the",
"signature",
"is",
"the",
"same",
"as",
"the",
"secret",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/PlainTextSignatureMethod.java#L85-L94 |
129,140 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/expression/OAuth2SecurityExpressionMethods.java | OAuth2SecurityExpressionMethods.hasAnyScope | public boolean hasAnyScope(String... scopes) {
boolean result = OAuth2ExpressionUtils.hasAnyScope(authentication, scopes);
if (!result) {
missingScopes.addAll(Arrays.asList(scopes));
}
return result;
} | java | public boolean hasAnyScope(String... scopes) {
boolean result = OAuth2ExpressionUtils.hasAnyScope(authentication, scopes);
if (!result) {
missingScopes.addAll(Arrays.asList(scopes));
}
return result;
} | [
"public",
"boolean",
"hasAnyScope",
"(",
"String",
"...",
"scopes",
")",
"{",
"boolean",
"result",
"=",
"OAuth2ExpressionUtils",
".",
"hasAnyScope",
"(",
"authentication",
",",
"scopes",
")",
";",
"if",
"(",
"!",
"result",
")",
"{",
"missingScopes",
".",
"ad... | Check if the current OAuth2 authentication has one of the scopes specified.
@param scopes the scopes to check
@return true if the OAuth2 token has one of these scopes
@throws AccessDeniedException if the scope is invalid and we the flag is set to throw the exception | [
"Check",
"if",
"the",
"current",
"OAuth2",
"authentication",
"has",
"one",
"of",
"the",
"scopes",
"specified",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/expression/OAuth2SecurityExpressionMethods.java#L116-L122 |
129,141 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/expression/OAuth2SecurityExpressionMethods.java | OAuth2SecurityExpressionMethods.hasAnyScopeMatching | public boolean hasAnyScopeMatching(String... scopesRegex) {
boolean result = OAuth2ExpressionUtils.hasAnyScopeMatching(authentication, scopesRegex);
if (!result) {
missingScopes.addAll(Arrays.asList(scopesRegex));
}
return result;
} | java | public boolean hasAnyScopeMatching(String... scopesRegex) {
boolean result = OAuth2ExpressionUtils.hasAnyScopeMatching(authentication, scopesRegex);
if (!result) {
missingScopes.addAll(Arrays.asList(scopesRegex));
}
return result;
} | [
"public",
"boolean",
"hasAnyScopeMatching",
"(",
"String",
"...",
"scopesRegex",
")",
"{",
"boolean",
"result",
"=",
"OAuth2ExpressionUtils",
".",
"hasAnyScopeMatching",
"(",
"authentication",
",",
"scopesRegex",
")",
";",
"if",
"(",
"!",
"result",
")",
"{",
"mi... | Check if the current OAuth2 authentication has one of the scopes matching a specified regex expression.
<pre>
access = "#oauth2.hasAnyScopeMatching('admin:manage_scopes','.*_admin:manage_scopes','.*_admin:read_scopes')))"
</pre>
@param scopesRegex the scopes regex to match
@return true if the OAuth2 token h... | [
"Check",
"if",
"the",
"current",
"OAuth2",
"authentication",
"has",
"one",
"of",
"the",
"scopes",
"matching",
"a",
"specified",
"regex",
"expression",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/provider/expression/OAuth2SecurityExpressionMethods.java#L149-L156 |
129,142 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/RSAKeySecret.java | RSAKeySecret.createPublicKey | public static PublicKey createPublicKey(byte[] publicKey) {
if (publicKey == null) {
return null;
}
try {
KeyFactory fac = KeyFactory.getInstance("RSA");
EncodedKeySpec spec = new X509EncodedKeySpec(publicKey);
return fac.generatePublic(spec);
}
catch (NoSuchAlgorithmExc... | java | public static PublicKey createPublicKey(byte[] publicKey) {
if (publicKey == null) {
return null;
}
try {
KeyFactory fac = KeyFactory.getInstance("RSA");
EncodedKeySpec spec = new X509EncodedKeySpec(publicKey);
return fac.generatePublic(spec);
}
catch (NoSuchAlgorithmExc... | [
"public",
"static",
"PublicKey",
"createPublicKey",
"(",
"byte",
"[",
"]",
"publicKey",
")",
"{",
"if",
"(",
"publicKey",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"KeyFactory",
"fac",
"=",
"KeyFactory",
".",
"getInstance",
"(",
"\"... | Creates a public key from the X509-encoded value of the given bytes.
@param publicKey The X509-encoded public key bytes.
@return The public key. | [
"Creates",
"a",
"public",
"key",
"from",
"the",
"X509",
"-",
"encoded",
"value",
"of",
"the",
"given",
"bytes",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/RSAKeySecret.java#L116-L132 |
129,143 | spring-projects/spring-security-oauth | spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/RSAKeySecret.java | RSAKeySecret.base64Decode | private static byte[] base64Decode(String value) {
if (value == null) {
return null;
}
try {
return Base64.decodeBase64(value.getBytes("UTF-8"));
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | java | private static byte[] base64Decode(String value) {
if (value == null) {
return null;
}
try {
return Base64.decodeBase64(value.getBytes("UTF-8"));
}
catch (UnsupportedEncodingException e) {
throw new RuntimeException(e);
}
} | [
"private",
"static",
"byte",
"[",
"]",
"base64Decode",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"Base64",
".",
"decodeBase64",
"(",
"value",
".",
"getBytes",
"(",
... | Utility method for decoding a base-64-encoded string.
@param value The base-64-encoded string.
@return The decoded value. | [
"Utility",
"method",
"for",
"decoding",
"a",
"base",
"-",
"64",
"-",
"encoded",
"string",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth/src/main/java/org/springframework/security/oauth/common/signature/RSAKeySecret.java#L164-L175 |
129,144 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/exceptions/OAuth2Exception.java | OAuth2Exception.addAdditionalInformation | public void addAdditionalInformation(String key, String value) {
if (this.additionalInformation == null) {
this.additionalInformation = new TreeMap<String, String>();
}
this.additionalInformation.put(key, value);
} | java | public void addAdditionalInformation(String key, String value) {
if (this.additionalInformation == null) {
this.additionalInformation = new TreeMap<String, String>();
}
this.additionalInformation.put(key, value);
} | [
"public",
"void",
"addAdditionalInformation",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"this",
".",
"additionalInformation",
"==",
"null",
")",
"{",
"this",
".",
"additionalInformation",
"=",
"new",
"TreeMap",
"<",
"String",
",",
"S... | Add some additional information with this OAuth error.
@param key The key.
@param value The value. | [
"Add",
"some",
"additional",
"information",
"with",
"this",
"OAuth",
"error",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/exceptions/OAuth2Exception.java#L79-L86 |
129,145 | spring-projects/spring-security-oauth | spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/exceptions/OAuth2Exception.java | OAuth2Exception.create | public static OAuth2Exception create(String errorCode, String errorMessage) {
if (errorMessage == null) {
errorMessage = errorCode == null ? "OAuth Error" : errorCode;
}
if (INVALID_CLIENT.equals(errorCode)) {
return new InvalidClientException(errorMessage);
}
else if (UNAUTHORIZED_CLIENT.equals(errorCo... | java | public static OAuth2Exception create(String errorCode, String errorMessage) {
if (errorMessage == null) {
errorMessage = errorCode == null ? "OAuth Error" : errorCode;
}
if (INVALID_CLIENT.equals(errorCode)) {
return new InvalidClientException(errorMessage);
}
else if (UNAUTHORIZED_CLIENT.equals(errorCo... | [
"public",
"static",
"OAuth2Exception",
"create",
"(",
"String",
"errorCode",
",",
"String",
"errorMessage",
")",
"{",
"if",
"(",
"errorMessage",
"==",
"null",
")",
"{",
"errorMessage",
"=",
"errorCode",
"==",
"null",
"?",
"\"OAuth Error\"",
":",
"errorCode",
"... | Creates the appropriate subclass of OAuth2Exception given the errorCode.
@param errorCode
@param errorMessage
@return | [
"Creates",
"the",
"appropriate",
"subclass",
"of",
"OAuth2Exception",
"given",
"the",
"errorCode",
"."
] | bbae0027eceb2c74a21ac26bbc86142dc732ffbe | https://github.com/spring-projects/spring-security-oauth/blob/bbae0027eceb2c74a21ac26bbc86142dc732ffbe/spring-security-oauth2/src/main/java/org/springframework/security/oauth2/common/exceptions/OAuth2Exception.java#L94-L131 |
129,146 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.getURI | @Override
public URI getURI() throws URIException {
StringBuffer buffer = new StringBuffer();
if (this.httphost != null) {
buffer.append(this.httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(this.httphost.getHostName());
int por... | java | @Override
public URI getURI() throws URIException {
StringBuffer buffer = new StringBuffer();
if (this.httphost != null) {
buffer.append(this.httphost.getProtocol().getScheme());
buffer.append("://");
buffer.append(this.httphost.getHostName());
int por... | [
"@",
"Override",
"public",
"URI",
"getURI",
"(",
")",
"throws",
"URIException",
"{",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"if",
"(",
"this",
".",
"httphost",
"!=",
"null",
")",
"{",
"buffer",
".",
"append",
"(",
"this",
... | Returns the URI of the HTTP method
@return The URI
@throws URIException If the URI cannot be created.
@see org.apache.commons.httpclient.HttpMethod#getURI() | [
"Returns",
"the",
"URI",
"of",
"the",
"HTTP",
"method"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L268-L288 |
129,147 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.setURI | @Override
public void setURI(URI uri) throws URIException {
// only set the host if specified by the URI
if (uri.isAbsoluteURI()) {
this.httphost = new HttpHost(uri);
}
// set the path, defaulting to root
setPath(
uri.getPath() == null
? "/... | java | @Override
public void setURI(URI uri) throws URIException {
// only set the host if specified by the URI
if (uri.isAbsoluteURI()) {
this.httphost = new HttpHost(uri);
}
// set the path, defaulting to root
setPath(
uri.getPath() == null
? "/... | [
"@",
"Override",
"public",
"void",
"setURI",
"(",
"URI",
"uri",
")",
"throws",
"URIException",
"{",
"// only set the host if specified by the URI",
"if",
"(",
"uri",
".",
"isAbsoluteURI",
"(",
")",
")",
"{",
"this",
".",
"httphost",
"=",
"new",
"HttpHost",
"("... | Sets the URI for this method.
@param uri URI to be set
@throws URIException if a URI cannot be set
@since 3.0 | [
"Sets",
"the",
"URI",
"for",
"this",
"method",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L299-L312 |
129,148 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.setHttp11 | @Deprecated
public void setHttp11(boolean http11) {
if (http11) {
this.params.setVersion(HttpVersion.HTTP_1_1);
} else {
this.params.setVersion(HttpVersion.HTTP_1_0);
}
} | java | @Deprecated
public void setHttp11(boolean http11) {
if (http11) {
this.params.setVersion(HttpVersion.HTTP_1_1);
} else {
this.params.setVersion(HttpVersion.HTTP_1_0);
}
} | [
"@",
"Deprecated",
"public",
"void",
"setHttp11",
"(",
"boolean",
"http11",
")",
"{",
"if",
"(",
"http11",
")",
"{",
"this",
".",
"params",
".",
"setVersion",
"(",
"HttpVersion",
".",
"HTTP_1_1",
")",
";",
"}",
"else",
"{",
"this",
".",
"params",
".",
... | Sets whether version 1.1 of the HTTP protocol should be used per default.
@param http11 <tt>true</tt> to use HTTP/1.1, <tt>false</tt> to use 1.0
@deprecated Use {@link HttpMethodParams#setVersion(HttpVersion)} | [
"Sets",
"whether",
"version",
"1",
".",
"1",
"of",
"the",
"HTTP",
"protocol",
"should",
"be",
"used",
"per",
"default",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L344-L351 |
129,149 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.setQueryString | @Override
public void setQueryString(NameValuePair[] params) {
LOG.trace("enter HttpMethodBase.setQueryString(NameValuePair[])");
queryString = EncodingUtil.formUrlEncode(params, "UTF-8");
} | java | @Override
public void setQueryString(NameValuePair[] params) {
LOG.trace("enter HttpMethodBase.setQueryString(NameValuePair[])");
queryString = EncodingUtil.formUrlEncode(params, "UTF-8");
} | [
"@",
"Override",
"public",
"void",
"setQueryString",
"(",
"NameValuePair",
"[",
"]",
"params",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.setQueryString(NameValuePair[])\"",
")",
";",
"queryString",
"=",
"EncodingUtil",
".",
"formUrlEncode",
"(",
"p... | Sets the query string of this HTTP method. The pairs are encoded as UTF-8 characters.
To use a different charset the parameters can be encoded manually using EncodingUtil
and set as a single String.
@param params an array of {@link NameValuePair}s to add as query string
parameters. The name/value pairs will be automc... | [
"Sets",
"the",
"query",
"string",
"of",
"this",
"HTTP",
"method",
".",
"The",
"pairs",
"are",
"encoded",
"as",
"UTF",
"-",
"8",
"characters",
".",
"To",
"use",
"a",
"different",
"charset",
"the",
"parameters",
"can",
"be",
"encoded",
"manually",
"using",
... | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L475-L479 |
129,150 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.setRequestHeader | @Override
public void setRequestHeader(String headerName, String headerValue) {
Header header = new Header(headerName, headerValue);
setRequestHeader(header);
} | java | @Override
public void setRequestHeader(String headerName, String headerValue) {
Header header = new Header(headerName, headerValue);
setRequestHeader(header);
} | [
"@",
"Override",
"public",
"void",
"setRequestHeader",
"(",
"String",
"headerName",
",",
"String",
"headerValue",
")",
"{",
"Header",
"header",
"=",
"new",
"Header",
"(",
"headerName",
",",
"headerValue",
")",
";",
"setRequestHeader",
"(",
"header",
")",
";",
... | Set the specified request header, overwriting any previous value. Note
that header-name matching is case-insensitive.
@param headerName the header's name
@param headerValue the header's value | [
"Set",
"the",
"specified",
"request",
"header",
"overwriting",
"any",
"previous",
"value",
".",
"Note",
"that",
"header",
"-",
"name",
"matching",
"is",
"case",
"-",
"insensitive",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L498-L502 |
129,151 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.setRequestHeader | @Override
public void setRequestHeader(Header header) {
Header[] headers = getRequestHeaderGroup().getHeaders(header.getName());
for (int i = 0; i < headers.length; i++) {
getRequestHeaderGroup().removeHeader(headers[i]);
}
getRequestHeaderGroup... | java | @Override
public void setRequestHeader(Header header) {
Header[] headers = getRequestHeaderGroup().getHeaders(header.getName());
for (int i = 0; i < headers.length; i++) {
getRequestHeaderGroup().removeHeader(headers[i]);
}
getRequestHeaderGroup... | [
"@",
"Override",
"public",
"void",
"setRequestHeader",
"(",
"Header",
"header",
")",
"{",
"Header",
"[",
"]",
"headers",
"=",
"getRequestHeaderGroup",
"(",
")",
".",
"getHeaders",
"(",
"header",
".",
"getName",
"(",
")",
")",
";",
"for",
"(",
"int",
"i",... | Sets the specified request header, overwriting any previous value.
Note that header-name matching is case insensitive.
@param header the header | [
"Sets",
"the",
"specified",
"request",
"header",
"overwriting",
"any",
"previous",
"value",
".",
"Note",
"that",
"header",
"-",
"name",
"matching",
"is",
"case",
"insensitive",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L510-L521 |
129,152 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.checkExecuteConditions | private void checkExecuteConditions(HttpState state, HttpConnection conn)
throws HttpException {
if (state == null) {
throw new IllegalArgumentException("HttpState parameter may not be null");
}
if (conn == null) {
throw new IllegalArgumentException("HttpConnection p... | java | private void checkExecuteConditions(HttpState state, HttpConnection conn)
throws HttpException {
if (state == null) {
throw new IllegalArgumentException("HttpState parameter may not be null");
}
if (conn == null) {
throw new IllegalArgumentException("HttpConnection p... | [
"private",
"void",
"checkExecuteConditions",
"(",
"HttpState",
"state",
",",
"HttpConnection",
"conn",
")",
"throws",
"HttpException",
"{",
"if",
"(",
"state",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"HttpState parameter may not be n... | Tests if the this method is ready to be executed.
@param state the {@link HttpState state} information associated with this method
@param conn the {@link HttpConnection connection} to be used
@throws HttpException If the method is in invalid state. | [
"Tests",
"if",
"the",
"this",
"method",
"is",
"ready",
"to",
"be",
"executed",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1102-L1117 |
129,153 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.abort | @Override
public void abort() {
if (this.aborted) {
return;
}
this.aborted = true;
HttpConnection conn = this.responseConnection;
if (conn != null) {
conn.close();
}
} | java | @Override
public void abort() {
if (this.aborted) {
return;
}
this.aborted = true;
HttpConnection conn = this.responseConnection;
if (conn != null) {
conn.close();
}
} | [
"@",
"Override",
"public",
"void",
"abort",
"(",
")",
"{",
"if",
"(",
"this",
".",
"aborted",
")",
"{",
"return",
";",
"}",
"this",
".",
"aborted",
"=",
"true",
";",
"HttpConnection",
"conn",
"=",
"this",
".",
"responseConnection",
";",
"if",
"(",
"c... | Aborts the execution of this method.
@since 3.0 | [
"Aborts",
"the",
"execution",
"of",
"this",
"method",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1168-L1178 |
129,154 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.recycle | @Deprecated
@Override
public void recycle() {
LOG.trace("enter HttpMethodBase.recycle()");
releaseConnection();
path = null;
followRedirects = false;
doAuthentication = true;
queryString = null;
getRequestHeaderGroup().clear();
getResponseHeaderG... | java | @Deprecated
@Override
public void recycle() {
LOG.trace("enter HttpMethodBase.recycle()");
releaseConnection();
path = null;
followRedirects = false;
doAuthentication = true;
queryString = null;
getRequestHeaderGroup().clear();
getResponseHeaderG... | [
"@",
"Deprecated",
"@",
"Override",
"public",
"void",
"recycle",
"(",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.recycle()\"",
")",
";",
"releaseConnection",
"(",
")",
";",
"path",
"=",
"null",
";",
"followRedirects",
"=",
"false",
";",
"doA... | Recycles the HTTP method so that it can be used again.
Note that all of the instance variables will be reset
once this method has been called. This method will also
release the connection being used by this HTTP method.
@see #releaseConnection()
@deprecated no longer supported and will be removed in the future
versio... | [
"Recycles",
"the",
"HTTP",
"method",
"so",
"that",
"it",
"can",
"be",
"used",
"again",
".",
"Note",
"that",
"all",
"of",
"the",
"instance",
"variables",
"will",
"be",
"reset",
"once",
"this",
"method",
"has",
"been",
"called",
".",
"This",
"method",
"wil... | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1202-L1228 |
129,155 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.removeRequestHeader | @Override
public void removeRequestHeader(String headerName) {
Header[] headers = getRequestHeaderGroup().getHeaders(headerName);
for (int i = 0; i < headers.length; i++) {
getRequestHeaderGroup().removeHeader(headers[i]);
}
} | java | @Override
public void removeRequestHeader(String headerName) {
Header[] headers = getRequestHeaderGroup().getHeaders(headerName);
for (int i = 0; i < headers.length; i++) {
getRequestHeaderGroup().removeHeader(headers[i]);
}
} | [
"@",
"Override",
"public",
"void",
"removeRequestHeader",
"(",
"String",
"headerName",
")",
"{",
"Header",
"[",
"]",
"headers",
"=",
"getRequestHeaderGroup",
"(",
")",
".",
"getHeaders",
"(",
"headerName",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Remove the request header associated with the given name. Note that
header-name matching is case insensitive.
@param headerName the header name | [
"Remove",
"the",
"request",
"header",
"associated",
"with",
"the",
"given",
"name",
".",
"Note",
"that",
"header",
"-",
"name",
"matching",
"is",
"case",
"insensitive",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1259-L1267 |
129,156 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.getCookieSpec | @SuppressWarnings("deprecation")
private CookieSpec getCookieSpec(final HttpState state) {
if (this.cookiespec == null) {
int i = state.getCookiePolicy();
if (i == -1) {
this.cookiespec = CookiePolicy.getCookieSpec(this.params.getCookiePolicy());
} else {
this.cookiespec =... | java | @SuppressWarnings("deprecation")
private CookieSpec getCookieSpec(final HttpState state) {
if (this.cookiespec == null) {
int i = state.getCookiePolicy();
if (i == -1) {
this.cookiespec = CookiePolicy.getCookieSpec(this.params.getCookiePolicy());
} else {
this.cookiespec =... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"CookieSpec",
"getCookieSpec",
"(",
"final",
"HttpState",
"state",
")",
"{",
"if",
"(",
"this",
".",
"cookiespec",
"==",
"null",
")",
"{",
"int",
"i",
"=",
"state",
".",
"getCookiePolicy",
"(",... | Returns the actual cookie policy
@param state HTTP state. TODO: to be removed in the future
@return cookie spec | [
"Returns",
"the",
"actual",
"cookie",
"policy"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1302-L1315 |
129,157 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.putAllCookiesInASingleHeader | private void putAllCookiesInASingleHeader(String host, CookieSpec matcher,
Cookie[] cookies) {
LOG.trace("enter putAllCookiesInASingleHeader(String host, CookieSpec matcher, Cookie[] cookies)" );
//use a map to make sure we only have one cookie per name
HashMap<String, Cooki... | java | private void putAllCookiesInASingleHeader(String host, CookieSpec matcher,
Cookie[] cookies) {
LOG.trace("enter putAllCookiesInASingleHeader(String host, CookieSpec matcher, Cookie[] cookies)" );
//use a map to make sure we only have one cookie per name
HashMap<String, Cooki... | [
"private",
"void",
"putAllCookiesInASingleHeader",
"(",
"String",
"host",
",",
"CookieSpec",
"matcher",
",",
"Cookie",
"[",
"]",
"cookies",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"enter putAllCookiesInASingleHeader(String host, CookieSpec matcher, Cookie[] cookies)\"",
")",
... | Put all the cookies in a single header line.
Merge the cookies already present in the request
with the cookies coming from the state.
@param host the host used with this cookies
@param matcher the {@link CookieSpec matcher} used in this context
@param cookies associated with the {@link HttpState state} | [
"Put",
"all",
"the",
"cookies",
"in",
"a",
"single",
"header",
"line",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1390-L1414 |
129,158 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.parseCookieHeader | static List<Cookie> parseCookieHeader(String host, String cookieHeaderValue) {
if (StringUtils.isEmpty(cookieHeaderValue)){
return Collections.emptyList();
}
String[] cookies = cookieHeaderValue.split(";");
List<Cookie> cookiesList = new ArrayList<Cookie>();
for (Stri... | java | static List<Cookie> parseCookieHeader(String host, String cookieHeaderValue) {
if (StringUtils.isEmpty(cookieHeaderValue)){
return Collections.emptyList();
}
String[] cookies = cookieHeaderValue.split(";");
List<Cookie> cookiesList = new ArrayList<Cookie>();
for (Stri... | [
"static",
"List",
"<",
"Cookie",
">",
"parseCookieHeader",
"(",
"String",
"host",
",",
"String",
"cookieHeaderValue",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"cookieHeaderValue",
")",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
... | Parse a cookie header to return a list of cookies.
Unfortunatly the method Header.getElements() is not working properly.
On a line like Cookie: has-js=1; drupal-toolbar=off it only returns the
first element has-js=1. So we rework this one.
This is a "won't fix" known issue as the project ended.
https://issues.apache.... | [
"Parse",
"a",
"cookie",
"header",
"to",
"return",
"a",
"list",
"of",
"cookies",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1430-L1446 |
129,159 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.generateRequestLine | protected static String generateRequestLine(HttpConnection connection,
String name, String requestPath, String query, String version) {
LOG.trace("enter HttpMethodBase.generateRequestLine(HttpConnection, "
+ "String, String, String, String)");
StringBuffer buf = new StringBuffer();
... | java | protected static String generateRequestLine(HttpConnection connection,
String name, String requestPath, String query, String version) {
LOG.trace("enter HttpMethodBase.generateRequestLine(HttpConnection, "
+ "String, String, String, String)");
StringBuffer buf = new StringBuffer();
... | [
"protected",
"static",
"String",
"generateRequestLine",
"(",
"HttpConnection",
"connection",
",",
"String",
"name",
",",
"String",
"requestPath",
",",
"String",
"query",
",",
"String",
"version",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.generateRe... | Generates HTTP request line according to the specified attributes.
@param connection the {@link HttpConnection connection} used to execute
this HTTP method
@param name the method name generate a request for
@param requestPath the path string for the request
@param query the query string for the request
@param version ... | [
"Generates",
"HTTP",
"request",
"line",
"according",
"to",
"the",
"specified",
"attributes",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L1628-L1673 |
129,160 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.getRequestLine | private String getRequestLine(HttpConnection conn) {
return HttpMethodBase.generateRequestLine(conn, getName(),
getPath(), getQueryString(), this.effectiveVersion.toString());
} | java | private String getRequestLine(HttpConnection conn) {
return HttpMethodBase.generateRequestLine(conn, getName(),
getPath(), getQueryString(), this.effectiveVersion.toString());
} | [
"private",
"String",
"getRequestLine",
"(",
"HttpConnection",
"conn",
")",
"{",
"return",
"HttpMethodBase",
".",
"generateRequestLine",
"(",
"conn",
",",
"getName",
"(",
")",
",",
"getPath",
"(",
")",
",",
"getQueryString",
"(",
")",
",",
"this",
".",
"effec... | Returns the request line.
@param conn the {@link HttpConnection connection} used to execute
this HTTP method
@return The request line. | [
"Returns",
"the",
"request",
"line",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L2361-L2364 |
129,161 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.canResponseHaveBody | private static boolean canResponseHaveBody(int status) {
LOG.trace("enter HttpMethodBase.canResponseHaveBody(int)");
boolean result = true;
if ((status >= 100 && status <= 199) || (status == 204)
|| (status == 304)) { // NOT MODIFIED
result = false;
}
r... | java | private static boolean canResponseHaveBody(int status) {
LOG.trace("enter HttpMethodBase.canResponseHaveBody(int)");
boolean result = true;
if ((status >= 100 && status <= 199) || (status == 204)
|| (status == 304)) { // NOT MODIFIED
result = false;
}
r... | [
"private",
"static",
"boolean",
"canResponseHaveBody",
"(",
"int",
"status",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.canResponseHaveBody(int)\"",
")",
";",
"boolean",
"result",
"=",
"true",
";",
"if",
"(",
"(",
"status",
">=",
"100",
"&&",
... | Per RFC 2616 section 4.3, some response can never contain a message
body.
@param status - the HTTP status code
@return <tt>true</tt> if the message may contain a body, <tt>false</tt> if it can not
contain a message body | [
"Per",
"RFC",
"2616",
"section",
"4",
".",
"3",
"some",
"response",
"can",
"never",
"contain",
"a",
"message",
"body",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L2414-L2425 |
129,162 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodBase.java | HttpMethodBase.responseBodyConsumed | protected void responseBodyConsumed() {
// make sure this is the initial invocation of the notification,
// ignore subsequent ones.
responseStream = null;
if (responseConnection != null) {
responseConnection.setLastResponseInputStream(null);
// At this point, no... | java | protected void responseBodyConsumed() {
// make sure this is the initial invocation of the notification,
// ignore subsequent ones.
responseStream = null;
if (responseConnection != null) {
responseConnection.setLastResponseInputStream(null);
// At this point, no... | [
"protected",
"void",
"responseBodyConsumed",
"(",
")",
"{",
"// make sure this is the initial invocation of the notification,",
"// ignore subsequent ones.",
"responseStream",
"=",
"null",
";",
"if",
"(",
"responseConnection",
"!=",
"null",
")",
"{",
"responseConnection",
"."... | A response has been consumed.
<p>The default behavior for this class is to check to see if the connection
should be closed, and close if need be, and to ensure that the connection
is returned to the connection manager - if and only if we are not still
inside the execute call.</p> | [
"A",
"response",
"has",
"been",
"consumed",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodBase.java#L2526-L2560 |
129,163 | zaproxy/zaproxy | src/org/zaproxy/zap/spider/SpiderController.java | SpiderController.addSeed | protected void addSeed(URI uri, String method) {
// Check if the uri was processed already
String visitedURI;
try {
visitedURI = URLCanonicalizer.buildCleanedParametersURIRepresentation(uri, spider.getSpiderParam()
.getHandleParameters(), spider.getSpiderParam().isHandleODataParametersVisited());
} catc... | java | protected void addSeed(URI uri, String method) {
// Check if the uri was processed already
String visitedURI;
try {
visitedURI = URLCanonicalizer.buildCleanedParametersURIRepresentation(uri, spider.getSpiderParam()
.getHandleParameters(), spider.getSpiderParam().isHandleODataParametersVisited());
} catc... | [
"protected",
"void",
"addSeed",
"(",
"URI",
"uri",
",",
"String",
"method",
")",
"{",
"// Check if the uri was processed already",
"String",
"visitedURI",
";",
"try",
"{",
"visitedURI",
"=",
"URLCanonicalizer",
".",
"buildCleanedParametersURIRepresentation",
"(",
"uri",... | Adds a new seed, if it wasn't already processed.
@param uri the uri
@param method the http method used for fetching the resource | [
"Adds",
"a",
"new",
"seed",
"if",
"it",
"wasn",
"t",
"already",
"processed",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderController.java#L163-L185 |
129,164 | zaproxy/zaproxy | src/org/zaproxy/zap/spider/SpiderController.java | SpiderController.addFetchFilter | public void addFetchFilter(FetchFilter filter) {
log.debug("Loading fetch filter: " + filter.getClass().getSimpleName());
fetchFilters.add(filter);
} | java | public void addFetchFilter(FetchFilter filter) {
log.debug("Loading fetch filter: " + filter.getClass().getSimpleName());
fetchFilters.add(filter);
} | [
"public",
"void",
"addFetchFilter",
"(",
"FetchFilter",
"filter",
")",
"{",
"log",
".",
"debug",
"(",
"\"Loading fetch filter: \"",
"+",
"filter",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
")",
";",
"fetchFilters",
".",
"add",
"(",
"filter",... | Adds a new fetch filter to the spider.
@param filter the filter | [
"Adds",
"a",
"new",
"fetch",
"filter",
"to",
"the",
"spider",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderController.java#L201-L204 |
129,165 | zaproxy/zaproxy | src/org/zaproxy/zap/spider/SpiderController.java | SpiderController.addParseFilter | public void addParseFilter(ParseFilter filter) {
log.debug("Loading parse filter: " + filter.getClass().getSimpleName());
parseFilters.add(filter);
} | java | public void addParseFilter(ParseFilter filter) {
log.debug("Loading parse filter: " + filter.getClass().getSimpleName());
parseFilters.add(filter);
} | [
"public",
"void",
"addParseFilter",
"(",
"ParseFilter",
"filter",
")",
"{",
"log",
".",
"debug",
"(",
"\"Loading parse filter: \"",
"+",
"filter",
".",
"getClass",
"(",
")",
".",
"getSimpleName",
"(",
")",
")",
";",
"parseFilters",
".",
"add",
"(",
"filter",... | Adds the parse filter to the spider controller.
@param filter the filter | [
"Adds",
"the",
"parse",
"filter",
"to",
"the",
"spider",
"controller",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderController.java#L220-L223 |
129,166 | zaproxy/zaproxy | src/org/zaproxy/zap/spider/SpiderController.java | SpiderController.reset | public void reset() {
visitedGet.clear();
visitedPost.clear();
for (SpiderParser parser : parsers) {
parser.removeSpiderParserListener(this);
}
} | java | public void reset() {
visitedGet.clear();
visitedPost.clear();
for (SpiderParser parser : parsers) {
parser.removeSpiderParserListener(this);
}
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"visitedGet",
".",
"clear",
"(",
")",
";",
"visitedPost",
".",
"clear",
"(",
")",
";",
"for",
"(",
"SpiderParser",
"parser",
":",
"parsers",
")",
"{",
"parser",
".",
"removeSpiderParserListener",
"(",
"this",
")"... | Clears the previous process. | [
"Clears",
"the",
"previous",
"process",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderController.java#L237-L244 |
129,167 | zaproxy/zaproxy | src/org/zaproxy/zap/spider/SpiderController.java | SpiderController.arrayKeyValueExists | private boolean arrayKeyValueExists(String key, String value) {
if (visitedPost.containsKey(key)) {
for(String s : visitedPost.get(key)) {
if(s.equals(value)) {
return true;
}
}
}
return false;
} | java | private boolean arrayKeyValueExists(String key, String value) {
if (visitedPost.containsKey(key)) {
for(String s : visitedPost.get(key)) {
if(s.equals(value)) {
return true;
}
}
}
return false;
} | [
"private",
"boolean",
"arrayKeyValueExists",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"visitedPost",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"for",
"(",
"String",
"s",
":",
"visitedPost",
".",
"get",
"(",
"key",
")",
")... | Checks whether the value exists in an ArrayList of certain key.
@param key the string of the uri
@param value the request body of the uri
@return true or false depending whether the uri and request body have already been processed | [
"Checks",
"whether",
"the",
"value",
"exists",
"in",
"an",
"ArrayList",
"of",
"certain",
"key",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/SpiderController.java#L358-L369 |
129,168 | zaproxy/zaproxy | src/org/zaproxy/zap/view/SummaryAndConfigPanel.java | SummaryAndConfigPanel.setSummaryContent | public void setSummaryContent(String content) {
Logger.getRootLogger().info("New summary: "+content);
summaryArea.setText("<html><b>" + summaryTitleText + "</b><br/><br/>" + content + "</html>");
} | java | public void setSummaryContent(String content) {
Logger.getRootLogger().info("New summary: "+content);
summaryArea.setText("<html><b>" + summaryTitleText + "</b><br/><br/>" + content + "</html>");
} | [
"public",
"void",
"setSummaryContent",
"(",
"String",
"content",
")",
"{",
"Logger",
".",
"getRootLogger",
"(",
")",
".",
"info",
"(",
"\"New summary: \"",
"+",
"content",
")",
";",
"summaryArea",
".",
"setText",
"(",
"\"<html><b>\"",
"+",
"summaryTitleText",
... | Sets the summary content.
@param content the new summary content | [
"Sets",
"the",
"summary",
"content",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/SummaryAndConfigPanel.java#L81-L84 |
129,169 | zaproxy/zaproxy | src/org/zaproxy/zap/extension/ascan/OptionsScannerPanel.java | OptionsScannerPanel.getSliderHostPerScan | private JSlider getSliderHostPerScan() {
if (sliderHostPerScan == null) {
sliderHostPerScan = new JSlider();
sliderHostPerScan.setMaximum(5);
sliderHostPerScan.setMinimum(1);
sliderHostPerScan.setMinorTickSpacing(1);
sliderHostPerScan.setPaintTic... | java | private JSlider getSliderHostPerScan() {
if (sliderHostPerScan == null) {
sliderHostPerScan = new JSlider();
sliderHostPerScan.setMaximum(5);
sliderHostPerScan.setMinimum(1);
sliderHostPerScan.setMinorTickSpacing(1);
sliderHostPerScan.setPaintTic... | [
"private",
"JSlider",
"getSliderHostPerScan",
"(",
")",
"{",
"if",
"(",
"sliderHostPerScan",
"==",
"null",
")",
"{",
"sliderHostPerScan",
"=",
"new",
"JSlider",
"(",
")",
";",
"sliderHostPerScan",
".",
"setMaximum",
"(",
"5",
")",
";",
"sliderHostPerScan",
"."... | This method initializes sliderHostPerScan
@return javax.swing.JSlider | [
"This",
"method",
"initializes",
"sliderHostPerScan"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/ascan/OptionsScannerPanel.java#L245-L259 |
129,170 | zaproxy/zaproxy | src/org/zaproxy/zap/extension/ascan/OptionsScannerPanel.java | OptionsScannerPanel.getSliderThreadsPerHost | private JSlider getSliderThreadsPerHost() {
if (sliderThreadsPerHost == null) {
sliderThreadsPerHost = new PositiveValuesSlider(Constant.MAX_THREADS_PER_SCAN);
sliderThreadsPerHost.addChangeListener(new ChangeListener() {
@Override
public void state... | java | private JSlider getSliderThreadsPerHost() {
if (sliderThreadsPerHost == null) {
sliderThreadsPerHost = new PositiveValuesSlider(Constant.MAX_THREADS_PER_SCAN);
sliderThreadsPerHost.addChangeListener(new ChangeListener() {
@Override
public void state... | [
"private",
"JSlider",
"getSliderThreadsPerHost",
"(",
")",
"{",
"if",
"(",
"sliderThreadsPerHost",
"==",
"null",
")",
"{",
"sliderThreadsPerHost",
"=",
"new",
"PositiveValuesSlider",
"(",
"Constant",
".",
"MAX_THREADS_PER_SCAN",
")",
";",
"sliderThreadsPerHost",
".",
... | This method initializes sliderThreadsPerHost
@return javax.swing.JSlider | [
"This",
"method",
"initializes",
"sliderThreadsPerHost"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/ascan/OptionsScannerPanel.java#L266-L278 |
129,171 | zaproxy/zaproxy | src/org/zaproxy/zap/control/AddOnRunIssuesUtils.java | AddOnRunIssuesUtils.createScrollableTreeAddOnsNotRunnable | private static JScrollPane createScrollableTreeAddOnsNotRunnable(
final AddOnCollection availableAddOns,
AddOn... addOnsNotRunnable) {
AddOnSearcher addOnSearcher = new AddOnSearcher() {
@Override
public AddOn searchAddOn(String id) {
return avail... | java | private static JScrollPane createScrollableTreeAddOnsNotRunnable(
final AddOnCollection availableAddOns,
AddOn... addOnsNotRunnable) {
AddOnSearcher addOnSearcher = new AddOnSearcher() {
@Override
public AddOn searchAddOn(String id) {
return avail... | [
"private",
"static",
"JScrollPane",
"createScrollableTreeAddOnsNotRunnable",
"(",
"final",
"AddOnCollection",
"availableAddOns",
",",
"AddOn",
"...",
"addOnsNotRunnable",
")",
"{",
"AddOnSearcher",
"addOnSearcher",
"=",
"new",
"AddOnSearcher",
"(",
")",
"{",
"@",
"Overr... | Creates a scrollable tree with the given add-ons as root nodes and its issues as child nodes.
@param availableAddOns the add-ons that are available, used to create check the running issues
@param addOnsNotRunnable the add-ons with running issues that will be shown in the tree
@return the tree wrapper in a {@code JSCro... | [
"Creates",
"a",
"scrollable",
"tree",
"with",
"the",
"given",
"add",
"-",
"ons",
"as",
"root",
"nodes",
"and",
"its",
"issues",
"as",
"child",
"nodes",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/control/AddOnRunIssuesUtils.java#L86-L121 |
129,172 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodDirector.java | HttpMethodDirector.applyConnectionParams | private void applyConnectionParams(final HttpMethod method) throws IOException {
int timeout = 0;
// see if a timeout is given for this method
Object param = method.getParams().getParameter(HttpMethodParams.SO_TIMEOUT);
if (param == null) {
// if not, use the default value
... | java | private void applyConnectionParams(final HttpMethod method) throws IOException {
int timeout = 0;
// see if a timeout is given for this method
Object param = method.getParams().getParameter(HttpMethodParams.SO_TIMEOUT);
if (param == null) {
// if not, use the default value
... | [
"private",
"void",
"applyConnectionParams",
"(",
"final",
"HttpMethod",
"method",
")",
"throws",
"IOException",
"{",
"int",
"timeout",
"=",
"0",
";",
"// see if a timeout is given for this method",
"Object",
"param",
"=",
"method",
".",
"getParams",
"(",
")",
".",
... | Applies connection parameters specified for a given method
@param method HTTP method
@throws IOException if an I/O occurs setting connection parameters | [
"Applies",
"connection",
"parameters",
"specified",
"for",
"a",
"given",
"method"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodDirector.java#L406-L418 |
129,173 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodDirector.java | HttpMethodDirector.executeConnect | private boolean executeConnect()
throws IOException, HttpException {
this.connectMethod = new ConnectMethod(this.hostConfiguration);
this.connectMethod.getParams().setDefaults(this.hostConfiguration.getParams());
String agent = (String) getParams().getParameter(PARAM_DEFAULT_USER_AGENT... | java | private boolean executeConnect()
throws IOException, HttpException {
this.connectMethod = new ConnectMethod(this.hostConfiguration);
this.connectMethod.getParams().setDefaults(this.hostConfiguration.getParams());
String agent = (String) getParams().getParameter(PARAM_DEFAULT_USER_AGENT... | [
"private",
"boolean",
"executeConnect",
"(",
")",
"throws",
"IOException",
",",
"HttpException",
"{",
"this",
".",
"connectMethod",
"=",
"new",
"ConnectMethod",
"(",
"this",
".",
"hostConfiguration",
")",
";",
"this",
".",
"connectMethod",
".",
"getParams",
"(",... | Executes a ConnectMethod to establish a tunneled connection.
@return <code>true</code> if the connect was successful
@throws IOException
@throws HttpException | [
"Executes",
"a",
"ConnectMethod",
"to",
"establish",
"a",
"tunneled",
"connection",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodDirector.java#L551-L603 |
129,174 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodDirector.java | HttpMethodDirector.processRedirectResponse | private boolean processRedirectResponse(final HttpMethod method)
throws RedirectException {
//get the location header to find out where to redirect to
Header locationHeader = method.getResponseHeader("location");
if (locationHeader == null) {
// got a redirect response, but no location header
LOG.error... | java | private boolean processRedirectResponse(final HttpMethod method)
throws RedirectException {
//get the location header to find out where to redirect to
Header locationHeader = method.getResponseHeader("location");
if (locationHeader == null) {
// got a redirect response, but no location header
LOG.error... | [
"private",
"boolean",
"processRedirectResponse",
"(",
"final",
"HttpMethod",
"method",
")",
"throws",
"RedirectException",
"{",
"//get the location header to find out where to redirect to",
"Header",
"locationHeader",
"=",
"method",
".",
"getResponseHeader",
"(",
"\"location\""... | Process the redirect response.
@return <code>true</code> if the redirect was successful | [
"Process",
"the",
"redirect",
"response",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodDirector.java#L651-L731 |
129,175 | zaproxy/zaproxy | src/org/apache/commons/httpclient/HttpMethodDirector.java | HttpMethodDirector.processAuthenticationResponse | private boolean processAuthenticationResponse(final HttpMethod method) {
LOG.trace("enter HttpMethodBase.processAuthenticationResponse("
+ "HttpState, HttpConnection)");
try {
switch (method.getStatusCode()) {
case HttpStatus.SC_UNAUTHORIZED:
return processWWWAuth... | java | private boolean processAuthenticationResponse(final HttpMethod method) {
LOG.trace("enter HttpMethodBase.processAuthenticationResponse("
+ "HttpState, HttpConnection)");
try {
switch (method.getStatusCode()) {
case HttpStatus.SC_UNAUTHORIZED:
return processWWWAuth... | [
"private",
"boolean",
"processAuthenticationResponse",
"(",
"final",
"HttpMethod",
"method",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"enter HttpMethodBase.processAuthenticationResponse(\"",
"+",
"\"HttpState, HttpConnection)\"",
")",
";",
"try",
"{",
"switch",
"(",
"method"... | Processes a response that requires authentication
@param method the current {@link HttpMethod HTTP method}
@return <tt>true</tt> if the authentication challenge can be responsed to,
(that is, at least one of the requested authentication scheme is supported,
and matching credentials have been found), <tt>false</tt> ot... | [
"Processes",
"a",
"response",
"that",
"requires",
"authentication"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/apache/commons/httpclient/HttpMethodDirector.java#L742-L761 |
129,176 | zaproxy/zaproxy | src/org/zaproxy/zap/view/JCheckBoxTree.java | JCheckBoxTree.isSelectedPartially | public boolean isSelectedPartially(TreePath path) {
CheckedNode cn = nodesCheckingState.get(path);
return cn.isSelected && cn.hasChildren && !cn.allChildrenSelected;
} | java | public boolean isSelectedPartially(TreePath path) {
CheckedNode cn = nodesCheckingState.get(path);
return cn.isSelected && cn.hasChildren && !cn.allChildrenSelected;
} | [
"public",
"boolean",
"isSelectedPartially",
"(",
"TreePath",
"path",
")",
"{",
"CheckedNode",
"cn",
"=",
"nodesCheckingState",
".",
"get",
"(",
"path",
")",
";",
"return",
"cn",
".",
"isSelected",
"&&",
"cn",
".",
"hasChildren",
"&&",
"!",
"cn",
".",
"allC... | Returns true in case that the node is selected, has children but not all of them are selected | [
"Returns",
"true",
"in",
"case",
"that",
"the",
"node",
"is",
"selected",
"has",
"children",
"but",
"not",
"all",
"of",
"them",
"are",
"selected"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/JCheckBoxTree.java#L112-L115 |
129,177 | zaproxy/zaproxy | src/org/zaproxy/zap/view/JCheckBoxTree.java | JCheckBoxTree.addSubtreeToCheckingStateTracking | private void addSubtreeToCheckingStateTracking(DefaultMutableTreeNode node) {
TreeNode[] path = node.getPath();
TreePath tp = new TreePath(path);
CheckedNode cn = new CheckedNode(false, node.getChildCount() > 0, false);
nodesCheckingState.put(tp, cn);
for (int i = 0 ; i < node... | java | private void addSubtreeToCheckingStateTracking(DefaultMutableTreeNode node) {
TreeNode[] path = node.getPath();
TreePath tp = new TreePath(path);
CheckedNode cn = new CheckedNode(false, node.getChildCount() > 0, false);
nodesCheckingState.put(tp, cn);
for (int i = 0 ; i < node... | [
"private",
"void",
"addSubtreeToCheckingStateTracking",
"(",
"DefaultMutableTreeNode",
"node",
")",
"{",
"TreeNode",
"[",
"]",
"path",
"=",
"node",
".",
"getPath",
"(",
")",
";",
"TreePath",
"tp",
"=",
"new",
"TreePath",
"(",
"path",
")",
";",
"CheckedNode",
... | Creating data structure of the current model for the checking mechanism | [
"Creating",
"data",
"structure",
"of",
"the",
"current",
"model",
"for",
"the",
"checking",
"mechanism"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/JCheckBoxTree.java#L127-L135 |
129,178 | zaproxy/zaproxy | src/org/parosproxy/paros/extension/option/OptionsConnectionPanel.java | OptionsConnectionPanel.getChkShowPassword | private JCheckBox getChkShowPassword() {
if (chkShowPassword == null) {
chkShowPassword = new JCheckBox();
chkShowPassword.setText(Constant.messages.getString("conn.options.proxy.auth.showpass"));
chkShowPassword.addActionListener(new java.awt.event.ActionListener() {
@Override
public void a... | java | private JCheckBox getChkShowPassword() {
if (chkShowPassword == null) {
chkShowPassword = new JCheckBox();
chkShowPassword.setText(Constant.messages.getString("conn.options.proxy.auth.showpass"));
chkShowPassword.addActionListener(new java.awt.event.ActionListener() {
@Override
public void a... | [
"private",
"JCheckBox",
"getChkShowPassword",
"(",
")",
"{",
"if",
"(",
"chkShowPassword",
"==",
"null",
")",
"{",
"chkShowPassword",
"=",
"new",
"JCheckBox",
"(",
")",
";",
"chkShowPassword",
".",
"setText",
"(",
"Constant",
".",
"messages",
".",
"getString",... | This method initializes chkShowPassword
@return javax.swing.JCheckBox | [
"This",
"method",
"initializes",
"chkShowPassword"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/option/OptionsConnectionPanel.java#L123-L141 |
129,179 | zaproxy/zaproxy | src/org/parosproxy/paros/extension/option/OptionsConnectionPanel.java | OptionsConnectionPanel.getChkUseProxyChain | private JCheckBox getChkUseProxyChain() {
if (chkUseProxyChain == null) {
chkUseProxyChain = new JCheckBox();
chkUseProxyChain.setText(Constant.messages.getString("conn.options.useProxy"));
chkUseProxyChain.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionP... | java | private JCheckBox getChkUseProxyChain() {
if (chkUseProxyChain == null) {
chkUseProxyChain = new JCheckBox();
chkUseProxyChain.setText(Constant.messages.getString("conn.options.useProxy"));
chkUseProxyChain.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionP... | [
"private",
"JCheckBox",
"getChkUseProxyChain",
"(",
")",
"{",
"if",
"(",
"chkUseProxyChain",
"==",
"null",
")",
"{",
"chkUseProxyChain",
"=",
"new",
"JCheckBox",
"(",
")",
";",
"chkUseProxyChain",
".",
"setText",
"(",
"Constant",
".",
"messages",
".",
"getStri... | This method initializes chkUseProxyChain
@return javax.swing.JCheckBox | [
"This",
"method",
"initializes",
"chkUseProxyChain"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/option/OptionsConnectionPanel.java#L148-L162 |
129,180 | zaproxy/zaproxy | src/org/parosproxy/paros/extension/option/OptionsConnectionPanel.java | OptionsConnectionPanel.getChkProxyChainAuth | private JCheckBox getChkProxyChainAuth() {
if (chkProxyChainAuth == null) {
chkProxyChainAuth = new JCheckBox();
chkProxyChainAuth.setText(Constant.messages.getString("conn.options.proxy.auth.required"));
chkProxyChainAuth.addActionListener(new java.awt.event.ActionListener() {
@Override
pub... | java | private JCheckBox getChkProxyChainAuth() {
if (chkProxyChainAuth == null) {
chkProxyChainAuth = new JCheckBox();
chkProxyChainAuth.setText(Constant.messages.getString("conn.options.proxy.auth.required"));
chkProxyChainAuth.addActionListener(new java.awt.event.ActionListener() {
@Override
pub... | [
"private",
"JCheckBox",
"getChkProxyChainAuth",
"(",
")",
"{",
"if",
"(",
"chkProxyChainAuth",
"==",
"null",
")",
"{",
"chkProxyChainAuth",
"=",
"new",
"JCheckBox",
"(",
")",
";",
"chkProxyChainAuth",
".",
"setText",
"(",
"Constant",
".",
"messages",
".",
"get... | This method initializes chkProxyChainAuth
@return javax.swing.JCheckBox | [
"This",
"method",
"initializes",
"chkProxyChainAuth"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/option/OptionsConnectionPanel.java#L736-L751 |
129,181 | zaproxy/zaproxy | src/org/zaproxy/zap/utils/ClassLoaderUtil.java | ClassLoaderUtil.addFile | public static void addFile(String s) throws IOException {
File f = new File(s);
addFile(f);
} | java | public static void addFile(String s) throws IOException {
File f = new File(s);
addFile(f);
} | [
"public",
"static",
"void",
"addFile",
"(",
"String",
"s",
")",
"throws",
"IOException",
"{",
"File",
"f",
"=",
"new",
"File",
"(",
"s",
")",
";",
"addFile",
"(",
"f",
")",
";",
"}"
] | Add file to CLASSPATH
@param s File name
@throws IOException IOException | [
"Add",
"file",
"to",
"CLASSPATH"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/ClassLoaderUtil.java#L32-L35 |
129,182 | zaproxy/zaproxy | src/org/zaproxy/zap/utils/ClassLoaderUtil.java | ClassLoaderUtil.addURL | public static void addURL(URL u) throws IOException {
if (!(ClassLoader.getSystemClassLoader() instanceof URLClassLoader)) {
return;
}
URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
URL[] urls = sysLoader.getURLs();
for (int i ... | java | public static void addURL(URL u) throws IOException {
if (!(ClassLoader.getSystemClassLoader() instanceof URLClassLoader)) {
return;
}
URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
URL[] urls = sysLoader.getURLs();
for (int i ... | [
"public",
"static",
"void",
"addURL",
"(",
"URL",
"u",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"(",
"ClassLoader",
".",
"getSystemClassLoader",
"(",
")",
"instanceof",
"URLClassLoader",
")",
")",
"{",
"return",
";",
"}",
"URLClassLoader",
"sysLoad... | Add URL to CLASSPATH
@param u URL
@throws IOException IOException | [
"Add",
"URL",
"to",
"CLASSPATH"
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/ClassLoaderUtil.java#L51-L75 |
129,183 | zaproxy/zaproxy | src/org/zaproxy/zap/extension/sessions/ContextSessionManagementPanel.java | ContextSessionManagementPanel.getSessionManagementMethodsComboBox | protected JComboBox<SessionManagementMethodType> getSessionManagementMethodsComboBox() {
if (sessionManagementMethodsComboBox == null) {
Vector<SessionManagementMethodType> methods = new Vector<>(
extension.getSessionManagementMethodTypes());
sessionManagementMethodsComboBox = new JComboBox<>(methods);
... | java | protected JComboBox<SessionManagementMethodType> getSessionManagementMethodsComboBox() {
if (sessionManagementMethodsComboBox == null) {
Vector<SessionManagementMethodType> methods = new Vector<>(
extension.getSessionManagementMethodTypes());
sessionManagementMethodsComboBox = new JComboBox<>(methods);
... | [
"protected",
"JComboBox",
"<",
"SessionManagementMethodType",
">",
"getSessionManagementMethodsComboBox",
"(",
")",
"{",
"if",
"(",
"sessionManagementMethodsComboBox",
"==",
"null",
")",
"{",
"Vector",
"<",
"SessionManagementMethodType",
">",
"methods",
"=",
"new",
"Vec... | Gets the session management methods combo box.
@return the session management methods combo box | [
"Gets",
"the",
"session",
"management",
"methods",
"combo",
"box",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/sessions/ContextSessionManagementPanel.java#L161-L195 |
129,184 | zaproxy/zaproxy | src/org/zaproxy/zap/extension/sessions/ContextSessionManagementPanel.java | ContextSessionManagementPanel.getConfigContainerPanel | private JPanel getConfigContainerPanel() {
if (configContainerPanel == null) {
configContainerPanel = new JPanel(new BorderLayout());
configContainerPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
Constant.messages.getString("sessionmanagement.panel.config.title"),
javax.swing.borde... | java | private JPanel getConfigContainerPanel() {
if (configContainerPanel == null) {
configContainerPanel = new JPanel(new BorderLayout());
configContainerPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
Constant.messages.getString("sessionmanagement.panel.config.title"),
javax.swing.borde... | [
"private",
"JPanel",
"getConfigContainerPanel",
"(",
")",
"{",
"if",
"(",
"configContainerPanel",
"==",
"null",
")",
"{",
"configContainerPanel",
"=",
"new",
"JPanel",
"(",
"new",
"BorderLayout",
"(",
")",
")",
";",
"configContainerPanel",
".",
"setBorder",
"(",... | Gets the configuration container panel.
@return the config container panel | [
"Gets",
"the",
"configuration",
"container",
"panel",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/sessions/ContextSessionManagementPanel.java#L202-L212 |
129,185 | zaproxy/zaproxy | src/org/parosproxy/paros/extension/ExtensionHookMenu.java | ExtensionHookMenu.unmodifiableList | private static <T> List<T> unmodifiableList(List<T> list) {
if (list == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(list);
} | java | private static <T> List<T> unmodifiableList(List<T> list) {
if (list == null) {
return Collections.emptyList();
}
return Collections.unmodifiableList(list);
} | [
"private",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"unmodifiableList",
"(",
"List",
"<",
"T",
">",
"list",
")",
"{",
"if",
"(",
"list",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"return",
"Collec... | Gets an unmodifiable list from the given list.
@param list the list, might be {@code null}.
@return an unmodifiable list, never {@code null}. | [
"Gets",
"an",
"unmodifiable",
"list",
"from",
"the",
"given",
"list",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/ExtensionHookMenu.java#L463-L468 |
129,186 | zaproxy/zaproxy | src/org/zaproxy/zap/GuiBootstrap.java | GuiBootstrap.warnAddOnsAndExtensionsNoLongerRunnable | private static void warnAddOnsAndExtensionsNoLongerRunnable() {
final AddOnLoader addOnLoader = ExtensionFactory.getAddOnLoader();
List<String> idsAddOnsNoLongerRunning = addOnLoader.getIdsAddOnsWithRunningIssuesSinceLastRun();
if (idsAddOnsNoLongerRunning.isEmpty()) {
return;
... | java | private static void warnAddOnsAndExtensionsNoLongerRunnable() {
final AddOnLoader addOnLoader = ExtensionFactory.getAddOnLoader();
List<String> idsAddOnsNoLongerRunning = addOnLoader.getIdsAddOnsWithRunningIssuesSinceLastRun();
if (idsAddOnsNoLongerRunning.isEmpty()) {
return;
... | [
"private",
"static",
"void",
"warnAddOnsAndExtensionsNoLongerRunnable",
"(",
")",
"{",
"final",
"AddOnLoader",
"addOnLoader",
"=",
"ExtensionFactory",
".",
"getAddOnLoader",
"(",
")",
";",
"List",
"<",
"String",
">",
"idsAddOnsNoLongerRunning",
"=",
"addOnLoader",
"."... | Warns, through a dialogue, about add-ons and extensions that are no longer runnable because of changes in its
dependencies. | [
"Warns",
"through",
"a",
"dialogue",
"about",
"add",
"-",
"ons",
"and",
"extensions",
"that",
"are",
"no",
"longer",
"runnable",
"because",
"of",
"changes",
"in",
"its",
"dependencies",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/GuiBootstrap.java#L556-L572 |
129,187 | zaproxy/zaproxy | src/org/zaproxy/zap/GuiBootstrap.java | GuiBootstrap.isFirstTime | private static boolean isFirstTime() {
Path acceptedLicenseFile = Paths.get(Constant.getInstance().ACCEPTED_LICENSE);
return Files.notExists(acceptedLicenseFile);
} | java | private static boolean isFirstTime() {
Path acceptedLicenseFile = Paths.get(Constant.getInstance().ACCEPTED_LICENSE);
return Files.notExists(acceptedLicenseFile);
} | [
"private",
"static",
"boolean",
"isFirstTime",
"(",
")",
"{",
"Path",
"acceptedLicenseFile",
"=",
"Paths",
".",
"get",
"(",
"Constant",
".",
"getInstance",
"(",
")",
".",
"ACCEPTED_LICENSE",
")",
";",
"return",
"Files",
".",
"notExists",
"(",
"acceptedLicenseF... | Tells whether or not ZAP is being started for first time. It does so by checking if the license was not yet been
accepted.
@return {@code true} if it's the first time, {@code false} otherwise.
@see Constant#ACCEPTED_LICENSE | [
"Tells",
"whether",
"or",
"not",
"ZAP",
"is",
"being",
"started",
"for",
"first",
"time",
".",
"It",
"does",
"so",
"by",
"checking",
"if",
"the",
"license",
"was",
"not",
"yet",
"been",
"accepted",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/GuiBootstrap.java#L601-L604 |
129,188 | zaproxy/zaproxy | src/org/zaproxy/zap/extension/globalexcludeurl/GlobalExcludeURLParam.java | GlobalExcludeURLParam.setDefaultList | private void setDefaultList() {
// Remember, these are regexs, so escape properly \\ vs \
// Also, http://regexpal.com/ for quick testing.
// The file formats are common types, not inclusive of all types. Remember, more == slower;
// complex == slower. Don't overload with every obscu... | java | private void setDefaultList() {
// Remember, these are regexs, so escape properly \\ vs \
// Also, http://regexpal.com/ for quick testing.
// The file formats are common types, not inclusive of all types. Remember, more == slower;
// complex == slower. Don't overload with every obscu... | [
"private",
"void",
"setDefaultList",
"(",
")",
"{",
"// Remember, these are regexs, so escape properly \\\\ vs \\\r",
"// Also, http://regexpal.com/ for quick testing.\r",
"// The file formats are common types, not inclusive of all types. Remember, more == slower;\r",
"// complex == slower. Don't ... | Fills in the list of default regexs to ignore. In a future version, this could be read from a
system-wide default HierarchicalConfiguration xml config file
instead or even a HierarchicalConfiguration string directly embedded in this file. | [
"Fills",
"in",
"the",
"list",
"of",
"default",
"regexs",
"to",
"ignore",
".",
"In",
"a",
"future",
"version",
"this",
"could",
"be",
"read",
"from",
"a",
"system",
"-",
"wide",
"default",
"HierarchicalConfiguration",
"xml",
"config",
"file",
"instead",
"or",... | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/globalexcludeurl/GlobalExcludeURLParam.java#L53-L180 |
129,189 | zaproxy/zaproxy | src/org/zaproxy/zap/extension/spider/SpiderAPI.java | SpiderAPI.getSpiderScan | private GenericScanner2 getSpiderScan(JSONObject params) throws ApiException {
GenericScanner2 spiderScan;
int id = getParam(params, PARAM_SCAN_ID, -1);
if (id == -1) {
spiderScan = extension.getLastScan();
} else {
spiderScan = extension.getScan(id);
}
if (spiderScan == null) {
throw new ApiExcep... | java | private GenericScanner2 getSpiderScan(JSONObject params) throws ApiException {
GenericScanner2 spiderScan;
int id = getParam(params, PARAM_SCAN_ID, -1);
if (id == -1) {
spiderScan = extension.getLastScan();
} else {
spiderScan = extension.getScan(id);
}
if (spiderScan == null) {
throw new ApiExcep... | [
"private",
"GenericScanner2",
"getSpiderScan",
"(",
"JSONObject",
"params",
")",
"throws",
"ApiException",
"{",
"GenericScanner2",
"spiderScan",
";",
"int",
"id",
"=",
"getParam",
"(",
"params",
",",
"PARAM_SCAN_ID",
",",
"-",
"1",
")",
";",
"if",
"(",
"id",
... | Returns the specified GenericScanner2 or the last scan available.
@param params the parameters of the API call
@return the GenericScanner2 with the given scan ID or, if not present, the last scan available
@throws ApiException if there's no scan with the given scan ID
@see #PARAM_SCAN_ID | [
"Returns",
"the",
"specified",
"GenericScanner2",
"or",
"the",
"last",
"scan",
"available",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/spider/SpiderAPI.java#L417-L431 |
129,190 | zaproxy/zaproxy | src/org/parosproxy/paros/extension/option/OptionsParamView.java | OptionsParamView.setUseSystemsLocaleForFormat | public void setUseSystemsLocaleForFormat(boolean useSystemsLocale) {
if (useSystemsLocaleForFormat != useSystemsLocale) {
useSystemsLocaleForFormat = useSystemsLocale;
getConfig().setProperty(USE_SYSTEMS_LOCALE_FOR_FORMAT_KEY, useSystemsLocaleForFormat);
}
} | java | public void setUseSystemsLocaleForFormat(boolean useSystemsLocale) {
if (useSystemsLocaleForFormat != useSystemsLocale) {
useSystemsLocaleForFormat = useSystemsLocale;
getConfig().setProperty(USE_SYSTEMS_LOCALE_FOR_FORMAT_KEY, useSystemsLocaleForFormat);
}
} | [
"public",
"void",
"setUseSystemsLocaleForFormat",
"(",
"boolean",
"useSystemsLocale",
")",
"{",
"if",
"(",
"useSystemsLocaleForFormat",
"!=",
"useSystemsLocale",
")",
"{",
"useSystemsLocaleForFormat",
"=",
"useSystemsLocale",
";",
"getConfig",
"(",
")",
".",
"setPropert... | Sets whether or not the system's locale should be used for formatting.
@param useSystemsLocale {@code true} if the system's locale should be used for formatting, {@code false} otherwise.
@since 2.7.0
@see #isUseSystemsLocaleForFormat()
@see java.util.Locale.Category#FORMAT | [
"Sets",
"whether",
"or",
"not",
"the",
"system",
"s",
"locale",
"should",
"be",
"used",
"for",
"formatting",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/option/OptionsParamView.java#L587-L592 |
129,191 | zaproxy/zaproxy | src/org/zaproxy/zap/spider/DomainAlwaysInScopeMatcher.java | DomainAlwaysInScopeMatcher.matches | public boolean matches(String domain) {
if (pattern != null) {
return pattern.matcher(domain).matches();
}
return this.domain.equals(domain);
} | java | public boolean matches(String domain) {
if (pattern != null) {
return pattern.matcher(domain).matches();
}
return this.domain.equals(domain);
} | [
"public",
"boolean",
"matches",
"(",
"String",
"domain",
")",
"{",
"if",
"(",
"pattern",
"!=",
"null",
")",
"{",
"return",
"pattern",
".",
"matcher",
"(",
"domain",
")",
".",
"matches",
"(",
")",
";",
"}",
"return",
"this",
".",
"domain",
".",
"equal... | Tells whether or not the given domain is considered always in scope.
@param domain the domain that will be checked
@return {@code true} if the domain is considered always in scope, {@code false} otherwise. | [
"Tells",
"whether",
"or",
"not",
"the",
"given",
"domain",
"is",
"considered",
"always",
"in",
"scope",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/DomainAlwaysInScopeMatcher.java#L90-L96 |
129,192 | zaproxy/zaproxy | src/org/parosproxy/paros/extension/option/OptionsParamCertificate.java | OptionsParamCertificate.saveClientCertSettings | private void saveClientCertSettings(){
if (getBoolean(PERSIST_CLIENT_CERT, false)){
logger.warn("Saving Client Certificate settings: password will be found in config");
setUseClientCert(getBoolean(USE_CLIENT_CERT, false));
setClientCertLocation(getString(CLIENT_CERT_LOC... | java | private void saveClientCertSettings(){
if (getBoolean(PERSIST_CLIENT_CERT, false)){
logger.warn("Saving Client Certificate settings: password will be found in config");
setUseClientCert(getBoolean(USE_CLIENT_CERT, false));
setClientCertLocation(getString(CLIENT_CERT_LOC... | [
"private",
"void",
"saveClientCertSettings",
"(",
")",
"{",
"if",
"(",
"getBoolean",
"(",
"PERSIST_CLIENT_CERT",
",",
"false",
")",
")",
"{",
"logger",
".",
"warn",
"(",
"\"Saving Client Certificate settings: password will be found in config\"",
")",
";",
"setUseClientC... | Saves the client cert settings if the flag is set explicitly.
Only works for the CLI currently. | [
"Saves",
"the",
"client",
"cert",
"settings",
"if",
"the",
"flag",
"is",
"set",
"explicitly",
".",
"Only",
"works",
"for",
"the",
"CLI",
"currently",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/option/OptionsParamCertificate.java#L86-L102 |
129,193 | zaproxy/zaproxy | src/org/parosproxy/paros/extension/option/OptionsParamCertificate.java | OptionsParamCertificate.clientCertCheck | private void clientCertCheck(){
boolean enableClientCert = getBoolean(USE_CLIENT_CERT, false);
String certPath = getString(CLIENT_CERT_LOCATION, "");
String certPass = getString(CLIENT_CERT_PASSWORD, "");
int certIndex = getInt(CLIENT_CERT_INDEX, 0);
if(enableClientCert ... | java | private void clientCertCheck(){
boolean enableClientCert = getBoolean(USE_CLIENT_CERT, false);
String certPath = getString(CLIENT_CERT_LOCATION, "");
String certPass = getString(CLIENT_CERT_PASSWORD, "");
int certIndex = getInt(CLIENT_CERT_INDEX, 0);
if(enableClientCert ... | [
"private",
"void",
"clientCertCheck",
"(",
")",
"{",
"boolean",
"enableClientCert",
"=",
"getBoolean",
"(",
"USE_CLIENT_CERT",
",",
"false",
")",
";",
"String",
"certPath",
"=",
"getString",
"(",
"CLIENT_CERT_LOCATION",
",",
"\"\"",
")",
";",
"String",
"certPass... | Enables ClientCertificate from -config CLI parameters
Requires location, password and a flag to use client certificate. | [
"Enables",
"ClientCertificate",
"from",
"-",
"config",
"CLI",
"parameters",
"Requires",
"location",
"password",
"and",
"a",
"flag",
"to",
"use",
"client",
"certificate",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/option/OptionsParamCertificate.java#L108-L133 |
129,194 | zaproxy/zaproxy | src/org/zaproxy/zap/extension/brk/ExtensionBreak.java | ExtensionBreak.getBreakpointsEnabledList | public List<BreakpointMessageInterface> getBreakpointsEnabledList() {
if (mode.equals(Mode.safe)) {
return new ArrayList<>();
}
return getBreakpointsModel().getBreakpointsEnabledList();
} | java | public List<BreakpointMessageInterface> getBreakpointsEnabledList() {
if (mode.equals(Mode.safe)) {
return new ArrayList<>();
}
return getBreakpointsModel().getBreakpointsEnabledList();
} | [
"public",
"List",
"<",
"BreakpointMessageInterface",
">",
"getBreakpointsEnabledList",
"(",
")",
"{",
"if",
"(",
"mode",
".",
"equals",
"(",
"Mode",
".",
"safe",
")",
")",
"{",
"return",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"return",
"getBreakpoin... | Exposes list of enabled breakpoints.
@return list of enabled breakpoints | [
"Exposes",
"list",
"of",
"enabled",
"breakpoints",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/brk/ExtensionBreak.java#L597-L602 |
129,195 | zaproxy/zaproxy | src/org/zaproxy/zap/utils/BoyerMooreMatcher.java | BoyerMooreMatcher.findInContent | public int findInContent(String content) {
int n = content.length();
int m = pattern.length();
int skip;
char val;
for (int i = 0; i <= n - m; i = i + skip) {
skip = 0;
for (int j = m - 1; j >= 0; j--) {
if (pattern.charAt(j) != c... | java | public int findInContent(String content) {
int n = content.length();
int m = pattern.length();
int skip;
char val;
for (int i = 0; i <= n - m; i = i + skip) {
skip = 0;
for (int j = m - 1; j >= 0; j--) {
if (pattern.charAt(j) != c... | [
"public",
"int",
"findInContent",
"(",
"String",
"content",
")",
"{",
"int",
"n",
"=",
"content",
".",
"length",
"(",
")",
";",
"int",
"m",
"=",
"pattern",
".",
"length",
"(",
")",
";",
"int",
"skip",
";",
"char",
"val",
";",
"for",
"(",
"int",
"... | Returns the index within this string of the first occurrence of the
specified substring. If it is not a substring, return -1.
@param content the content where we've to search into
@return the index of the occurrence or -1 if no occurrence has been found | [
"Returns",
"the",
"index",
"within",
"this",
"string",
"of",
"the",
"first",
"occurrence",
"of",
"the",
"specified",
"substring",
".",
"If",
"it",
"is",
"not",
"a",
"substring",
"return",
"-",
"1",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/BoyerMooreMatcher.java#L61-L87 |
129,196 | zaproxy/zaproxy | src/org/zaproxy/zap/extension/stdmenus/PopupMenuSpiderURLAsUser.java | PopupMenuSpiderURLAsUser.getExtensionSpider | private ExtensionSpider getExtensionSpider() {
if (extension == null) {
extension = Control.getSingleton().getExtensionLoader().getExtension(ExtensionSpider.class);
}
return extension;
} | java | private ExtensionSpider getExtensionSpider() {
if (extension == null) {
extension = Control.getSingleton().getExtensionLoader().getExtension(ExtensionSpider.class);
}
return extension;
} | [
"private",
"ExtensionSpider",
"getExtensionSpider",
"(",
")",
"{",
"if",
"(",
"extension",
"==",
"null",
")",
"{",
"extension",
"=",
"Control",
".",
"getSingleton",
"(",
")",
".",
"getExtensionLoader",
"(",
")",
".",
"getExtension",
"(",
"ExtensionSpider",
"."... | Gets the extension spider.
@return the extension spider | [
"Gets",
"the",
"extension",
"spider",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/stdmenus/PopupMenuSpiderURLAsUser.java#L58-L63 |
129,197 | zaproxy/zaproxy | src/org/parosproxy/paros/extension/filter/AllFilterTableEditor.java | AllFilterTableEditor.getTableCellEditorComponent | @Override
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int rowIndex, int vColIndex) {
// 'value' is value contained in the cell located at (rowIndex, vColIndex)
if (isSelected) {
// cell (and perhaps other cells) ... | java | @Override
public Component getTableCellEditorComponent(JTable table, Object value,
boolean isSelected, int rowIndex, int vColIndex) {
// 'value' is value contained in the cell located at (rowIndex, vColIndex)
if (isSelected) {
// cell (and perhaps other cells) ... | [
"@",
"Override",
"public",
"Component",
"getTableCellEditorComponent",
"(",
"JTable",
"table",
",",
"Object",
"value",
",",
"boolean",
"isSelected",
",",
"int",
"rowIndex",
",",
"int",
"vColIndex",
")",
"{",
"// 'value' is value contained in the cell located at (rowIndex,... | This method is called when a cell value is edited by the user. | [
"This",
"method",
"is",
"called",
"when",
"a",
"cell",
"value",
"is",
"edited",
"by",
"the",
"user",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/extension/filter/AllFilterTableEditor.java#L66-L82 |
129,198 | zaproxy/zaproxy | src/org/parosproxy/paros/core/scanner/ScannerParam.java | ScannerParam.setScanHeadersAllRequests | public void setScanHeadersAllRequests(boolean scanAllRequests) {
if (scanAllRequests == scanHeadersAllRequests) {
return;
}
this.scanHeadersAllRequests = scanAllRequests;
getConfig().setProperty(SCAN_HEADERS_ALL_REQUESTS, this.scanHeadersAllRequests);
} | java | public void setScanHeadersAllRequests(boolean scanAllRequests) {
if (scanAllRequests == scanHeadersAllRequests) {
return;
}
this.scanHeadersAllRequests = scanAllRequests;
getConfig().setProperty(SCAN_HEADERS_ALL_REQUESTS, this.scanHeadersAllRequests);
} | [
"public",
"void",
"setScanHeadersAllRequests",
"(",
"boolean",
"scanAllRequests",
")",
"{",
"if",
"(",
"scanAllRequests",
"==",
"scanHeadersAllRequests",
")",
"{",
"return",
";",
"}",
"this",
".",
"scanHeadersAllRequests",
"=",
"scanAllRequests",
";",
"getConfig",
"... | Sets whether or not the HTTP Headers of all requests should be scanned, not just requests that send parameters, through
the query or request body.
@param scanAllRequests {@code true} if the HTTP Headers of all requests should be scanned, {@code false} otherwise
@since 2.5.0
@see #isScanHeadersAllRequests() | [
"Sets",
"whether",
"or",
"not",
"the",
"HTTP",
"Headers",
"of",
"all",
"requests",
"should",
"be",
"scanned",
"not",
"just",
"requests",
"that",
"send",
"parameters",
"through",
"the",
"query",
"or",
"request",
"body",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/ScannerParam.java#L598-L605 |
129,199 | zaproxy/zaproxy | src/org/zaproxy/zap/view/popup/PopupMenuUtils.java | PopupMenuUtils.removeAllSeparators | public static void removeAllSeparators(JPopupMenu popupMenu) {
for (int i = 0; i < popupMenu.getComponentCount(); i++) {
if (isPopupMenuSeparator(popupMenu.getComponent(i))) {
popupMenu.remove(i);
i--;
}
}
} | java | public static void removeAllSeparators(JPopupMenu popupMenu) {
for (int i = 0; i < popupMenu.getComponentCount(); i++) {
if (isPopupMenuSeparator(popupMenu.getComponent(i))) {
popupMenu.remove(i);
i--;
}
}
} | [
"public",
"static",
"void",
"removeAllSeparators",
"(",
"JPopupMenu",
"popupMenu",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"popupMenu",
".",
"getComponentCount",
"(",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"isPopupMenuSeparator",
"(... | Removes all separators from the given pop up menu.
@param popupMenu the pop up menu whose separators will be removed
@see javax.swing.JPopupMenu.Separator | [
"Removes",
"all",
"separators",
"from",
"the",
"given",
"pop",
"up",
"menu",
"."
] | 0cbe5121f2ae1ecca222513d182759210c569bec | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/popup/PopupMenuUtils.java#L144-L151 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.