Skip to content

Commit 6a0b149

Browse files
committed
Allow WebIdentityProvider to be used
1 parent 7188f4e commit 6a0b149

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/org/radarbase/output/config/RestructureConfig.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import com.azure.storage.blob.BlobServiceClientBuilder
66
import com.azure.storage.common.StorageSharedKeyCredential
77
import com.fasterxml.jackson.annotation.JsonIgnore
88
import io.minio.MinioClient
9+
import io.minio.credentials.IamAwsProvider
910
import org.apache.hadoop.conf.Configuration
1011
import org.radarbase.output.Application.Companion.CACHE_SIZE_DEFAULT
1112
import org.radarbase.output.Plugin
@@ -361,8 +362,10 @@ data class S3Config(
361362

362363
fun createS3Client(): MinioClient = MinioClient.Builder().apply {
363364
endpoint(endpoint)
364-
if (!accessToken.isNullOrBlank() && !secretKey.isNullOrBlank()) {
365+
if (accessToken.isNullOrBlank() || secretKey.isNullOrBlank()) {
365366
credentials(accessToken, secretKey)
367+
} else {
368+
credentialsProvider(IamAwsProvider(null, null))
366369
}
367370
}.build()
368371

0 commit comments

Comments
 (0)