diff --git a/nexus/src/external_api/console_api.rs b/nexus/src/external_api/console_api.rs index d9fba343af..68d6359ceb 100644 --- a/nexus/src/external_api/console_api.rs +++ b/nexus/src/external_api/console_api.rs @@ -558,22 +558,8 @@ pub async fn session_me( apictx.external_latencies.instrument_dropshot_handler(&rqctx, handler).await } -// Dropshot does not have route match ranking and does not allow overlapping -// route definitions, so we cannot have a catchall `/*` route for console pages -// and then also define, e.g., `/api/blah/blah` and give the latter priority -// because it's a more specific match. So for now we simply give the console -// catchall route a prefix to avoid overlap. Long-term, if a route prefix is -// part of the solution, we would probably prefer it to be on the API endpoints, -// not on the console pages. Conveniently, all the console page routes start -// with /orgs already. -#[endpoint { - method = GET, - path = "/orgs/{path:.*}", - unpublished = true, -}] -pub async fn console_page( +async fn console_page_inner( rqctx: Arc>>, - _path_params: Path, ) -> Result, HttpError> { let opctx = OpContext::for_external_api(&rqctx).await; @@ -599,6 +585,38 @@ pub async fn console_page( .body("".into())?) } +// Dropshot does not have route match ranking and does not allow overlapping +// route definitions, so we cannot have a catchall `/*` route for console pages +// and then also define, e.g., `/api/blah/blah` and give the latter priority +// because it's a more specific match. So for now we simply give the console +// catchall route a prefix to avoid overlap. Long-term, if a route prefix is +// part of the solution, we would probably prefer it to be on the API endpoints, +// not on the console pages. Conveniently, all the console page routes start +// with /orgs already. +#[endpoint { + method = GET, + path = "/orgs/{path:.*}", + unpublished = true, +}] +pub async fn console_page( + rqctx: Arc>>, + _path_params: Path, +) -> Result, HttpError> { + console_page_inner(rqctx).await +} + +#[endpoint { + method = GET, + path = "/settings/{path:.*}", + unpublished = true, +}] +pub async fn console_settings_page( + rqctx: Arc>>, + _path_params: Path, +) -> Result, HttpError> { + console_page_inner(rqctx).await +} + /// Fetch a static asset from `/assets`. 404 on virtually all /// errors. No auth. NO SENSITIVE FILES. #[endpoint {