2727import java .util .Map ;
2828
2929/**
30- * A static AWS credentials provider that can be instantiated by Iceberg's {@link
31- * org.apache.iceberg.aws.AwsClientProperties} via the {@code create(Map)} reflection mechanism.
32- *
33- * <p>When configured as {@code client.credentials-provider}, Iceberg strips the {@code
34- * client.credentials-provider.} prefix from sub-properties and passes the remaining map to {@link
35- * #create(Map)}. This provider reads the following keys from that map:
36- *
37- * <ul>
38- * <li>{@code access-key-id} — AWS access key ID
39- * <li>{@code secret-access-key} — AWS secret access key
40- * </ul>
41- *
42- * <p>This is needed because the Iceberg Glue client does not read S3-specific credential properties
43- * ({@code s3.access-key-id} / {@code s3.secret-access-key}). Without this provider, the Glue client
44- * falls back to the default AWS credential chain, which may not have valid credentials.
30+ * This is needed because the Iceberg Glue client does not read S3-specific credential properties
31+ * (s3.access-key-id / s3.secret-access-key). Without this provider, the Glue client falls back to
32+ * the default AWS credential chain, which may not have valid credentials.
4533 */
4634public class StaticAwsCredentialsProvider implements AwsCredentialsProvider {
4735
@@ -54,15 +42,6 @@ private StaticAwsCredentialsProvider(String accessKeyId, String secretAccessKey)
5442 this .credentials = AwsBasicCredentials .create (accessKeyId , secretAccessKey );
5543 }
5644
57- /**
58- * Called by Iceberg via reflection when {@code client.credentials-provider} is set to this
59- * class's fully qualified name. The properties map contains sub-properties under the {@code
60- * client.credentials-provider.} prefix (with the prefix stripped).
61- *
62- * @param properties map containing {@code access-key-id} and {@code secret-access-key}
63- * @return an {@link AwsCredentialsProvider} using the provided static credentials
64- * @throws IllegalArgumentException if either key is missing
65- */
6645 public static AwsCredentialsProvider create (Map <String , String > properties ) {
6746 String accessKeyId = properties .get (ACCESS_KEY_ID );
6847 String secretAccessKey = properties .get (SECRET_ACCESS_KEY );
0 commit comments