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

   ## Problem
   
   #2502 added `rest.auth.type` with `none`, `oauth2` and `google`. Java also 
accepts `basic` (`BasicAuthManager`), so a configuration that uses HTTP Basic 
authentication in Java fails in iceberg-go with an unknown auth type.
   
   ## Fix
   
   `basic` is now a built-in `rest.auth.type`, next to `none` and `oauth2`. It 
requires `rest.auth.basic.username` and `rest.auth.basic.password`, as Java 
does, and sends `Authorization: Basic` with their base64 encoding. 
`RegisterAuthManager` reserves the name.
   
   Like the rest of `rest.auth.type`, the credentials are read from the 
client-supplied properties before `/v1/config`. This differs from Java, which 
builds the catalog session from the merged properties, so a server override 
could replace the credentials there. Keeping one rule for every auth type means 
a server can't change what the client authenticates with.
   
   ## Testing
   
   - `TestAuthTypeSelectsAuthentication`: `basic` sends the expected header on 
`/v1/config` and the catalog request, matches case-insensitively, and wins over 
`token`.
   - `TestBasicAuthIgnoresServerOverrides`: `/v1/config` overrides of the 
username and password don't change the header.
   - `TestAuthTypeErrors`: a missing username or password fails catalog 
construction, and the error doesn't include the password.
   
   Each fails with its fix reverted. gofmt, `go vet` (also with `-tags 
integration`), the `modernize` analyzer and `go test -race ./...` pass locally. 
golangci-lint was not run locally.
   
   ## Context
   
   Follow-up to #2502 (#2428). `sigv4` as an auth type is the remaining Java 
value.
   


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