Skip to content

Commit

Permalink
chore(oxauth): renamed requestUriBlackList -> requestUriBlockList (4.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriyz committed Jun 10, 2022
1 parent af08562 commit bcbabc1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public class AppConfiguration implements Configuration {
private Boolean requestUriParameterSupported;
private Boolean requestUriHashVerificationEnabled;
private Boolean requireRequestUriRegistration;
private List<String> requestUriBlackList;
private List<String> requestUriBlockList;
private String opPolicyUri;
private String opTosUri;
private int authorizationCodeLifetime;
Expand Down Expand Up @@ -2090,13 +2090,13 @@ public void setCibaEnabled(Boolean cibaEnabled) {
this.cibaEnabled = cibaEnabled;
}

public List<String> getRequestUriBlackList() {
if (requestUriBlackList == null) requestUriBlackList = Lists.newArrayList();
return requestUriBlackList;
public List<String> getRequestUriBlockList() {
if (requestUriBlockList == null) requestUriBlockList = Lists.newArrayList();
return requestUriBlockList;
}

public void setRequestUriBlackList(List<String> requestUriBlackList) {
this.requestUriBlackList = requestUriBlackList;
public void setRequestUriBlockList(List<String> requestUriBlockList) {
this.requestUriBlockList = requestUriBlockList;
}

public Boolean getRequestUriHashVerificationEnabled() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public static void validateRequestUri(String requestUri, Client client, AppConfi
}

// check black list
final List<String> blackList = appConfiguration.getRequestUriBlackList();
final List<String> blackList = appConfiguration.getRequestUriBlockList();
if (!blackList.isEmpty()) {
URLPatternList urlPatternList = new URLPatternList(blackList);
if (urlPatternList.isUrlListed(requestUri)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void validateRequestUri_whichIsBlackListed_shouldRaiseException() {
String requestUri = "https://myrp.com/request_uri";

final AppConfiguration appConfiguration = new AppConfiguration();
appConfiguration.setRequestUriBlackList(Arrays.asList("myrp.com", "evil.com"));
appConfiguration.setRequestUriBlockList(Arrays.asList("myrp.com", "evil.com"));
JwtAuthorizationRequest.validateRequestUri(requestUri, new Client(), appConfiguration, "", new ErrorResponseFactory());
}

Expand All @@ -53,7 +53,7 @@ public void validateRequestUri_forLocalhost_shouldRaiseException() {
String requestUri = "https://localhost/request_uri";

final AppConfiguration appConfiguration = new AppConfiguration();
appConfiguration.setRequestUriBlackList(Collections.singletonList("localhost"));
appConfiguration.setRequestUriBlockList(Collections.singletonList("localhost"));
JwtAuthorizationRequest.validateRequestUri(requestUri, new Client(), appConfiguration, "", new ErrorResponseFactory());
}

Expand All @@ -62,7 +62,7 @@ public void validateRequestUri_forLocalhostIp_shouldRaiseException() {
String requestUri = "https://127.0.0.1/request_uri";

final AppConfiguration appConfiguration = new AppConfiguration();
appConfiguration.setRequestUriBlackList(Collections.singletonList("127.0.0.1"));
appConfiguration.setRequestUriBlockList(Collections.singletonList("127.0.0.1"));
JwtAuthorizationRequest.validateRequestUri(requestUri, new Client(), appConfiguration, "", new ErrorResponseFactory());
}

Expand All @@ -71,7 +71,7 @@ public void validateRequestUri_whichIsNotBlackListed_shouldBeOk() {
String requestUri = "https://myrp.com/request_uri";

final AppConfiguration appConfiguration = new AppConfiguration();
appConfiguration.setRequestUriBlackList(Arrays.asList("evil.com", "second.com"));
appConfiguration.setRequestUriBlockList(Arrays.asList("evil.com", "second.com"));
JwtAuthorizationRequest.validateRequestUri(requestUri, new Client(), appConfiguration, "", new ErrorResponseFactory());
}
}

0 comments on commit bcbabc1

Please sign in to comment.