Skip to content

Commit

Permalink
Remove config headers while fetching vended credentials from credenti…
Browse files Browse the repository at this point in the history
…al endpoint.
  • Loading branch information
ChaladiMohanVamsi committed Dec 16, 2024
1 parent bc08205 commit 5913fd1
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
import org.apache.iceberg.rest.ErrorHandlers;
import org.apache.iceberg.rest.HTTPClient;
import org.apache.iceberg.rest.RESTClient;
import org.apache.iceberg.rest.RESTUtil;
import org.apache.iceberg.rest.auth.OAuth2Properties;
import org.apache.iceberg.rest.auth.OAuth2Util;
import org.apache.iceberg.rest.credentials.Credential;
Expand Down Expand Up @@ -141,23 +140,15 @@ private RESTClient httpClient() {
}

private LoadCredentialsResponse fetchCredentials() {
Map<String, String> headers =
RESTUtil.merge(
configHeaders(properties),
OAuth2Util.authHeaders(properties.get(OAuth2Properties.TOKEN)));
return httpClient()
.get(
properties.get(URI),
null,
LoadCredentialsResponse.class,
headers,
OAuth2Util.authHeaders(properties.get(OAuth2Properties.TOKEN)),
ErrorHandlers.defaultErrorHandler());
}

private Map<String, String> configHeaders(Map<String, String> props) {
return RESTUtil.extractPrefixMap(props, "header.");
}

private void checkCredential(Credential credential, String property) {
Preconditions.checkState(
credential.config().containsKey(property),
Expand Down

0 comments on commit 5913fd1

Please sign in to comment.