-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish API routes and console routes #430
Comments
An approach I've considered in the past (along with the different origins) was to have a very short prefix for the UI, something like |
Just realized the hack we've been relying on for omicron/nexus/src/external_api/console_api.rs Lines 608 to 638 in 54754a9
|
A temporary workaround would be to define handlers for all these directly instead of using
As a very temporary workaround, I will change the console routes to use |
Ok. I chatted with @smklein about this and we figured out some useful things. I will bring this up at Control Plane huddle since it affects everyone, but I want to collect my thoughts here. If we get to the point of proposing a particular course of action, this will probably become a short RFD. We don't need Dropshot support for overlapping routes to go with the
|
Is it worth prioritizing the work to figure out how API and console DNS names play into this and having Nexus figure out which one you're hitting by the server name? |
Yes. And I suppose another option would be to serve the console from a different Dropshot server. |
It's not clear to me why we would want different DNS names for each. I would expect that hitting the root of the silo URI gives you an auth screen that takes you to the console. It seems like standard practice that |
At the very least the DNS version feels a lot more complicated for little, if any, benefit. |
This may just be FUD, but in a past product we used a different subdomain for API calls and I recall it running afoul of Safari's anti-cross-site scripting heuristics. This was several years ago so the state of the art and the understand of that system may have evolved significantly. |
Yeah, let's forget the separate domains question then. I think it's still worth looking into for future-proofing, but we can always do it later. |
This is solved. All API routes will be behind |
Followup to #356 and #384
If we are going to serve console pages and the external API from the same server (Nexus), we need a way of distinguishing between the two sets of routes. More specifically, we need to be able to designate a catch-all route that matches all console URLs without matching any API routes.
In #384, we are able to cheat because all currently existing console routes start with
/orgs
, so we just use/orgs/*
as the catchall route for console pages. This only works because a) there aren't any other console routes, and b) the API routes for orgs start with the full word/organizations
. If we were to add console pages that don't start with/orgs
OR shorten the API ones to/orgs
(which we've discussed), we'd need another way of doing this.A common approach is to put an
/api
prefix on all the API routes. This is the solution @zephraph and I lean toward, though to make it really clean we would want/*
to match console routes, which would require Dropshot to allow overlapping route definitions (see oxidecomputer/dropshot#199).On the other hand, we can avoid this problem entirely by serving console and nexus from different origins, but in order to do that we would have to solve #410.
The text was updated successfully, but these errors were encountered: