-
Notifications
You must be signed in to change notification settings - Fork 2.9k
OpenAPI: Express server capabilities via /config endpoint #9940
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
Conversation
c768db9 to
99f8143
Compare
|
|
||
| tags: | ||
| - name: remote-signing | ||
| description: Requires server to support remote signing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danielcweeks, @nastra, @jackye1995, if we add some form of capabilities to express what a REST service supports, then maybe we should merge the signer spec into the main REST catalog spec. Then everything is in one place and options are clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, I think it's probably good to merge those 2 specs together
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I commented elsewhere. It makes sense to merge them to me, but let's not do it in this PR. We can take care of it in a follow up.
|
@nastra, this is a great start. I think we also want to add a section in the overall API description that covers how tags are used when there is a matching capability. That is, capability tags represent optional functionality that must be declared by the service from the config route. To support a capability, all tagged routes must be implemented. @jackye1995, for context, we are exploring ways to express optional parts of the API so that we can evolve it by adding new functionality and letting callers know about it. |
99f8143 to
aac1583
Compare
81dc9d2 to
c9492b3
Compare
|
After some discussions, the capablities that we'd like to currently support are:
For |
I would assume since the server is doing work on behalf of the client for both scan
@nastra Also was wondering what you meant by this, did you want me to pick up these changes and include them into the preplan/plan pr? |
snazy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've got strong concerns about using enum here - special handling here and there, I think, that complicates things for adopters of any OpenAPI spec.
|
If I'm correct this approach provides a way to group catalog functionalities, and allow the server to explicitly define the support or not. This is kind of similar to what both the append and scan API's were trying to do with the feature flag configs. On that note if the server specifies no support for a feature, and we failing early on the client side? |
In this case here we don't set feature flags with true/false. The existence of a capability in For views there are cases where a client wouldn't call the endpoint (e.g. when renaming a table, it wouldn't also check if a view with the same name exists). In other cases the client would fail early, indicating that the server doesn't support X. |
@snazy we use |
The issue at hand is that an enum cannot (by default) handle unknown values - which is generally fine. But here we have to expect that endpoints to return values that are not known by a client. (Not only generated) client's that did not handle this rather special case will fail to parse the result, which is a problem. I'm still in favor of just using a string. |
3f70b55 to
cfa7918
Compare
snazy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using strings instead of an enum looks much better.
However, I've got concerns about the backwards compatibility stated in this specification.
It would also be good to have something written on the website how capabilities are meant to work, covering backwards compatibility - basically at least starting with a written documentation about Iceberg-REST (there is none on the website yet at all).
cfa7918 to
15c769a
Compare
73cc54f to
898ae59
Compare
decf5ca to
eaef2c6
Compare
| tags: | ||
| - Catalog API | ||
| - tables | ||
| - views |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, this seems like a problem to me. I want to avoid overlapping tags if possible, because when this happens, you need to know "if I support tables, not views, do I support this API?". The answer here might be a simple yes, but for complex capabilities, it might become a case by case analysis and things become really complex. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be more clear, I am okay with for example LoadTable having both a tag for tables and credentials-vending since the second tag is dedicated to a specific feature in the API. But here, tables and views requires exactly the same thing, which is that this API exists. That is the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having tables/ views here simply means that if a catalog supports tablesor views then it needs to support this endpoint as you won't be able to do something with tables if namespaces aren't supported. See also #9940 (comment).
Also I probably wouldn't tag any endpoint with credentials-vending, since that capability doesn't require to implement certain endpoints.
4c76fa6 to
abb7ed5
Compare
| - views | ||
| - remote-signing | ||
| - vended-credentials | ||
| - multi-table-commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed in the last sync meeting that the capability is useful when it impacts the client's fallback behavior. In that case, it seems to me that only views is a necessary capability. What other capabilities here would impact fallback behavior?
a03195d to
582aab0
Compare
582aab0 to
c77066b
Compare
|
closing this in favor of #10928 |
This introduces a
capabilitiesfield to the response of the/configendpoint, signaling what is being supported by the server.The current capabilities that come to mind are:
Capabilities like
scan-planning/views/remote-signing/oauth2would indicate that certain endpoints are implemented by the server and can be safely called by clients. Other capabilities would reflect using a certain query param or sending a particular header by a client to the server.Using
tagsallows to group endpoints in the Swagger UI:For
scan-planningit's not clear yet whether whether we'd like to only havescan-planningor whether there should also bescan-pre-planning, so it's best to introduce this capability as part of #9695 (cc @rahil-c)