Revanth14 commented on code in PR #2098:
URL: https://github.com/apache/iceberg-go/pull/2098#discussion_r4211009285
##########
catalog/rest/rest.go:
##########
@@ -1046,6 +1072,8 @@ func (r *Catalog) createSession(ctx context.Context, opts
*options) (*http.Clien
session := &sessionTransport{
RoundTripper: baseTransport,
defaultHeaders: http.Header{},
+ catalogOrigin: r.baseURI,
Review Comment:
I don't think this happens. `init` runs `fetchConfig`, which applies the
`uri` override to `r.baseURI`, and only then calls `createSession` for the
long-lived session, so `catalogOrigin` is already the post-config origin. Only
the short-lived bootstrap session that `fetchConfig` opens for `GET /v1/config`
sees the original origin, and it's closed when `fetchConfig` returns.
Since the gate now relies on that order, I added
`TestConfigURIOverrideKeepsCredentials`: `/v1/config` returns a `uri` on a
second origin, and the test checks that the second origin gets the credentials
and `header.*` values for a static token, client credentials (with the token
fetched from the new origin) and a signer. If `createSession` is moved before
`fetchConfig`, all three cases fail.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]