Hey Micah,

I think what we're trying to achieve is strike a balance between client
complexity and ability to support multiple server-side capabilities.  One
challenge we've run into is if a client performs an operation (e.g.
listViews), but receives a 403 code, it's not clear whether the client
doesn't have access or the server doesn't support an endpoint but isn't
sending a 404 for security reasons.  This is a simple way for the client to
understand what it should expect from the server.

>  Another option would be just list all endpoints . . . and let clients
take appropriate actions
> This could be done by vending the OpenAPI spec the server supports at its
own endpoint. I think this avoids the future problem of having to classify
new endpoints into a specific capability.

You're right that this would be the most complete way to handle this, but
it's really complicated and may require additional "handshake" calls even
for small interactions with the catalog service.  I think this puts a lot
of onus on the client, when what we're describing is a set of endpoints
that correspond to a capability.

I think we also want to avoid relyance on server specific published OpenAPI
as they may leak other options/parameters/etc.  This may lead to confusion
around what the canonical spec is and make clients incompatible if they're
generated off of a non-standard spec document.

All good points though, but I'm not aware of a standard way to handle this.

I think versioning adds another level of complexity, but might be necessary
since I expect these will evolve to some extent and may even require
hitting versioned urls.

-Dan




On Mon, Jun 24, 2024 at 12:03 AM Eduard Tudenhöfner <
etudenhoef...@apache.org> wrote:

> We had a separate discussion with Dan on the *oauth2* flag last week and
> came to the same conclusion that removing the *oauth2* capability is
> probably the best for now.
> This is mainly because we can't really act on the *oauth2* capability
> right now, because the */tokens* endpoint is called before we hit the
> */config* endpoint.
>
> > Another option would be just list all endpoints (and maybe even further
> which operations are supported) the server actually supports and let
> clients take appropriate actions (i.e. grouping could happen on the client
> side).  This could be done by vending the OpenAPI spec the server supports
> at its own endpoint. I think this avoids the future problem of having to
> classify new endpoints into a specific capability.
>
> @Micah this sounds to me as if the client would then have to parse a bunch
> of endpoints to figure out whether it's safe to e.g. call loading a view or
> dropping a table on the given REST server. Rather than having a dedicated
> endpoint we're just using the */config* endpoint to provide information
> about what a server supports.
>
> Thanks
> Eduard
>
> On Fri, Jun 21, 2024 at 8:27 PM Ryan Blue <b...@databricks.com.invalid>
> wrote:
>
>> Let's remove the oauth2 tag for now until we figure out how to move
>> forward there. That makes sense to me.
>>
>> On Fri, Jun 21, 2024 at 9:30 AM Dmitri Bourlatchkov
>> <dmitri.bourlatch...@dremio.com.invalid> wrote:
>>
>>> Hi Eduard,
>>>
>>> The capabilities PR looks good to me overall. I have a concern with the
>>> "oauth2" tag name though.
>>>
>>> I also commented [1] in GH but the comment appears to be closed by
>>> default :)
>>>
>>> I believe the term "oauth2" is confusing in this context with respect to
>>> RFC 6749 [2] as discussed in depth on another thread [3]
>>>
>>> The functionality behind the /tokens endpoint is quite specific to the
>>> Iceberg REST spec and as the other discussion highlights, there are
>>> concerns with respect to OAuth2 interoperability with other OAuth2 servers.
>>>
>>> What do you think about using a different tag name for it, for example
>>> "local-tokens" or "auth-tokens"?
>>>
>>> Thanks,
>>> Dmitri.
>>>
>>> [1]
>>> https://github.com/apache/iceberg/pull/9940/files/15c769a52b85ac4deff5659978c7ffa7802612b0#r1649173934
>>> [2] https://www.rfc-editor.org/rfc/rfc6749
>>> [3] https://lists.apache.org/thread/twk84xx7v0xy5q5tfd9x5torgr82vv50
>>>
>>> On Thu, Jun 20, 2024 at 7:28 AM Eduard Tudenhoefner <
>>> etudenhoef...@apache.org> wrote:
>>>
>>>> Hey everyone,
>>>>
>>>> I'd like to bring up the discussion around describing REST server
>>>> capabilities via the */config* endpoint.
>>>> There is PR #9940 <https://github.com/apache/iceberg/pull/9940> that
>>>> describes the OpenAPI spec changes.
>>>>
>>>> Mainly we'd like to have a *capabilities* field in the *ConfigResponse* 
>>>> that
>>>> allows servers to indicate to clients which capabilities are being
>>>> supported.
>>>>
>>>> So far we have the following capabilities:
>>>>
>>>>    - tables
>>>>    - views
>>>>    - remote-signing
>>>>    - vended-credentials
>>>>    - multi-table-commit
>>>>    - register-table
>>>>    - table-metrics
>>>>    - oauth2
>>>>
>>>>
>>>> The general idea behind a capability is that if e.g. a server supports
>>>> *views*, then that server must implement all endpoints grouped under
>>>> that capability.
>>>> It's worth noting that the */config* endpoint is currently being
>>>> implicit (meaning that every REST server would have to implement it).
>>>>
>>>> One discussion point that came up during review is how we want to
>>>> handle capabilities and backwards compatibility and what the default
>>>> capability would be, since older servers don't know anything about
>>>> *capabilities* (in such a case we could assume that the default
>>>> capabilities would be *oauth2* / *tables*).
>>>>
>>>> Are there any other capabilities that we'd like to include in the list?
>>>>
>>>> Eduard
>>>>
>>>
>>
>> --
>> Ryan Blue
>> Databricks
>>
>

Reply via email to