Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,4 @@ public ResponseObject loginUser(HttpSession session, String username, String pas
public String handleRequest(Map<String, Object[]> params, String responseType, StringBuilder auditTrailSb) throws ServerApiException;

public Class<?> getCmdClass(String cmdName);

public boolean isValidApiName(String apiName);
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ public List<Map<String, Object>> getRules() {
if (Strings.isNullOrEmpty(rule)) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Empty rule provided in rules param");
}
if (!rule.contains("*") && !_apiServer.isValidApiName(rule)) {
throw new ServerApiException(ApiErrorCode.PARAM_ERROR, "Invalid api name: " + rule + " provided in rules param");
}
ruleDetails.put(ApiConstants.RULE, new Rule(rule));

String permission = detail.get(ApiConstants.PERMISSION);
Expand Down
11 changes: 0 additions & 11 deletions server/src/main/java/com/cloud/api/ApiServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -1208,17 +1208,6 @@ else if (cmdList.size() == 1)
}
}

@Override
public boolean isValidApiName(String apiName) {
if (apiName == null || apiName.isEmpty())
return false;

if (!s_apiNameCmdClassMap.containsKey(apiName))
return false;

return true;
}

// FIXME: rather than isError, we might was to pass in the status code to give more flexibility
private void writeResponse(final HttpResponse resp, final String responseText, final int statusCode, final String responseType, final String reasonPhrase) {
try {
Expand Down