Revanth14 opened a new pull request, #2417:
URL: https://github.com/apache/iceberg-go/pull/2417

   ## Problem
   
   A vended storage credential was merged two ways (#2181). Plan-scoped IO 
(`propertiesForLocation`) replaced every base property of an overlapping 
credential type through `clearOverriddenCredentialProperties`, while the 
table-wide sites (Create/Register/Load, `RefreshTableCredentials` and renewal) 
layered it with `maps.Copy`. On the table-wide sites, a vended S3 key pair 
without a session token inherited the `s3.session-token` from table or catalog 
config, and the read got a 403, because an STS token only works with the key 
pair it was issued with.
   
   ## Fix
   
   Every site now layers through `mergeVendedCredentials`, as agreed on #2181: 
properties the credential doesn't vend are kept, and 
`clearOverriddenCredentialProperties` is removed. The one S3 exception, next to 
the existing `adls.token` one: a vended `s3.access-key-id` drops the base 
`s3.session-token` and `s3.session-token-expires-at-ms`, and the token and 
expiry vended with the key are copied back in. This also covers a vended pair 
plus token without an expiry, which would otherwise carry the old token's 
expiry.
   
   GCS and ADLS SAS expiries need no equivalent rule. The GCS FileIO only 
attaches `gcs.oauth2.token-expires-at` to a static token source, which 
`oauth2.Transport` never checks, and no other FileIO reads an expiry key. 
Plan-scoped IO reads expiry from the matched credential's own config, not the 
merged properties.
   
   ## Testing
   
   - `TestMergeVendedCredentialsS3SessionToken` covers four cases: a key pair 
without a token, a key pair with a token, a key pair with a token and expiry, 
and a token on its own.
   - `TestTableResponseDropsStaleS3SessionTokenForVendedKeyPair` covers the 
table-wide sites; it fails on `main`.
   - `TestPrefixScopedIOLayersPartialS3Credential` covers plan-scoped IO and 
matches `TestTableResponseLayersPartialS3Credential`, which is unchanged; it 
fails on `main`.
   - `TestPrefixScopedIOReplacesS3CredentialAtomically` is renamed to 
`TestPrefixScopedIODropsStaleS3SessionTokenForVendedKeyPair`, since plan-scoped 
IO no longer replaces.
   
   ## Context
   
   Closes #2181. 
   


-- 
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]

Reply via email to