-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Separate out public API registration from xhr and static requests #21424
Comments
Conceptually, I'm on-board with this differentiation and find it to be quite helpful. Security does have a few public endpoints exposed on With regard to the saved object APIs that are exposed at |
We'll need to build in facades for all of the APIs documented here, which I assume will soon include security: https://www.elastic.co/guide/en/kibana/master/api.html. It's important that users of those endpoints don't notice this sort of change at all.
This particular proposal shouldn't affect the saved object client at all. Any saved object client exposed through the new platform needs to handle all the security stuff you're adding regardless of whether this proposal proceeds or not. |
This change would make it much easier to address #6021 |
@joshdover comment from #40623 APIs registered by plugins could benefit from having an explicit difference between public and internal APIs.
Additionally, these two types of APIs could have different URL prefixes. For example:
Benefits:
|
I propose that we don't expose HTTP directly to plugins. Instead, we expose interfaces for
api
,xhr
, andstatic
. All legacy platform endpoints will go throughxhr
. If you want to expose a legacy platform endpoint as a public API (e.g./api
), you'll need to create a new platform facade for it.api
This will mount to
/api
and will be the definitive place to register public API endpoints. There's an expectation that these will be consumed programmatically outside of Kibana itself. These should only have breaking changes in major versions.The
kbn-xsrf
header is enforced for direct access to these endpoints.kbn-version
does nothing.xhr
This will mount to
/xhr
and will be used to register endpoints that only support being consumed by the Kibana UI./xhr/api-proxy
will proxy through to the public api endpoints, so the Kibana UI will never query/api
directly.The
kbn-version
header behavior is strictly handled only through these endpoints and is the exclusive xsrf tool enforced on these endpoints as well.Since these are designed to be used by the Kibana UI alone, there are no concerns about breaking changes.
static
These are static resources, like images.
The text was updated successfully, but these errors were encountered: