Skip to content

Commit a343071

Browse files
committed
Detect empty Azure credentials as not usable
1 parent 5c85446 commit a343071

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,9 @@ data class AzureConfig(
339339
fun createAzureClient(): BlobServiceClient = BlobServiceClientBuilder().apply {
340340
endpoint(endpoint)
341341
when {
342-
username != null && password != null -> credential(BasicAuthenticationCredential(username, password))
343-
accountName != null && accountKey != null -> credential(StorageSharedKeyCredential(accountName, accountKey))
344-
sasToken != null -> sasToken(sasToken)
342+
!username.isNullOrEmpty() && !password.isNullOrEmpty() -> credential(BasicAuthenticationCredential(username, password))
343+
!accountName.isNullOrEmpty() && !accountKey.isNullOrEmpty() -> credential(StorageSharedKeyCredential(accountName, accountKey))
344+
!sasToken.isNullOrEmpty() -> sasToken(sasToken)
345345
else -> logger.warn("No Azure credentials supplied. Assuming a public blob storage.")
346346
}
347347
}.buildClient()

0 commit comments

Comments
 (0)