Skip to content
Open
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 @@ -76,6 +76,14 @@ public RouteDestination getRoutingService(String requestPath, HttpRequest httpRe
.stream(Splitter.on('/').omitEmptyStrings().split(requestPath).spliterator(), false)
.toArray(String[]::new);

if (uriParts.length == 0) {
return APP_FABRIC_HTTP;
}
if (uriParts[0].equals(Constants.Gateway.INTERNAL_API_VERSION_3_TOKEN)) {
// The internal API is for service-to-service calls over internal service
// discovery and must never be reachable through the external router.
return DONT_ROUTE;
}
Comment thread
evilgensec marked this conversation as resolved.
if (uriParts[0].equals(Constants.Gateway.API_VERSION_3_TOKEN)) {
return getV3RoutingService(uriParts, requestMethod);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,13 @@ public void testAppLifecycleAndWorkflowPaths() {

@Test
public void testProgramLifecycleInternalAndAppLifecycleInternalPaths() {
// The internal (v3Internal) API is for service-to-service calls over internal
// discovery and must not be routed from the external router.
assertRouting("v3Internal/namespaces//apps//versions//workflows/DataPipelineWorkflow/runs/",
RouterPathLookup.APP_FABRIC_HTTP);
RouterPathLookup.DONT_ROUTE);
assertRouting("v3Internal/namespaces/default/apps/app/states/key", RouterPathLookup.DONT_ROUTE);
assertRouting("v3Internal/namespaces/default/apps/app/preferences", RouterPathLookup.DONT_ROUTE);
assertRouting("v3Internal/location/some/abs/path", RouterPathLookup.DONT_ROUTE);
}

@Test
Expand Down