milleruntime closed pull request #331: ACCUMULO-4756 Allow default tables
validate REST
URL: https://github.com/apache/accumulo/pull/331
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/server/monitor/src/main/java/org/apache/accumulo/monitor/util/ParameterValidator.java
b/server/monitor/src/main/java/org/apache/accumulo/monitor/util/ParameterValidator.java
index a736a293bd..aec0826bb1 100644
---
a/server/monitor/src/main/java/org/apache/accumulo/monitor/util/ParameterValidator.java
+++
b/server/monitor/src/main/java/org/apache/accumulo/monitor/util/ParameterValidator.java
@@ -22,6 +22,8 @@
public interface ParameterValidator {
String ALPHA_NUM_REGEX = "\\w+";
+ // Allow the special default table IDs
+ String ALPHA_NUM_REGEX_TABLE_ID = "[!+]?\\w+";
String ALPHA_NUM_REGEX_BLANK_OK = "\\w*";
String RESOURCE_REGEX = "(\\w|:)+";
diff --git
a/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
b/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
index 9e26a484ad..e2425755ac 100644
---
a/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
+++
b/server/monitor/src/main/java/org/apache/accumulo/monitor/view/WebViews.java
@@ -18,6 +18,7 @@
import static
org.apache.accumulo.monitor.util.ParameterValidator.ALPHA_NUM_REGEX;
import static
org.apache.accumulo.monitor.util.ParameterValidator.ALPHA_NUM_REGEX_BLANK_OK;
+import static
org.apache.accumulo.monitor.util.ParameterValidator.ALPHA_NUM_REGEX_TABLE_ID;
import static
org.apache.accumulo.monitor.util.ParameterValidator.SERVER_REGEX_BLANK_OK;
import static org.apache.commons.lang.StringUtils.isBlank;
import static org.apache.commons.lang.StringUtils.isEmpty;
@@ -289,7 +290,7 @@ private void addExternalResources(Map<String,Object> model)
{
@GET
@Path("tables/{tableID}")
@Template(name = "/default.ftl")
- public Map<String,Object> getTables(@PathParam("tableID") @NotNull
@Pattern(regexp = ALPHA_NUM_REGEX) String tableID) throws
TableNotFoundException,
+ public Map<String,Object> getTables(@PathParam("tableID") @NotNull
@Pattern(regexp = ALPHA_NUM_REGEX_TABLE_ID) String tableID) throws
TableNotFoundException,
UnsupportedEncodingException {
String tableName = Tables.getTableName(Monitor.getContext().getInstance(),
Table.ID.of(tableID));
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services