mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-08 22:14:59 +00:00
Introduces validation to restrict API's to single namespace (#51982)
To be merged after #51981 lands (cherry picked from commit 196eaf8ac1ccc777f5bd81469d1148bc7ec299dd)
This commit is contained in:
parent
898dd0b9cc
commit
f626700757
@ -47,6 +47,9 @@ public class ClientYamlSuiteRestApiParser {
|
|||||||
if (location.endsWith(apiName + ".json") == false) {
|
if (location.endsWith(apiName + ".json") == false) {
|
||||||
throw new IllegalArgumentException("API [" + apiName + "] should have the same name as its file [" + location + "]");
|
throw new IllegalArgumentException("API [" + apiName + "] should have the same name as its file [" + location + "]");
|
||||||
}
|
}
|
||||||
|
if (apiName.chars().filter(c -> c == '.').count() > 1) {
|
||||||
|
throw new IllegalArgumentException("API [" + apiName + "] contains more then one namespace [" + location + "]");
|
||||||
|
}
|
||||||
|
|
||||||
ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApi(location, apiName);
|
ClientYamlSuiteRestApi restApi = new ClientYamlSuiteRestApi(location, apiName);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user