Skip to content

Commit c23e3af

Browse files
fix(auth): fail fast on empty SigV4 credentials; fix stale CI comment
1 parent 10ce4f2 commit c23e3af

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎.github/workflows/aws_test.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
# under the License.
1717

1818
# AWS-related tests. ICEBERG_S3 and ICEBERG_SIGV4 are exercised individually and
19-
# together; with both on, Arrow's S3 reuses SigV4's system AWS SDK
20-
# (AWSSDK_SOURCE=SYSTEM) so a single AWS SDK is linked (no ODR).
19+
# together; with both on, ICEBERG_AWSSDK_SOURCE defaults to BUNDLED so SigV4
20+
# reuses Arrow's bundled aws-cpp-sdk-core — a single AWS SDK is linked (no ODR).
2121
name: AWS Tests
2222

2323
on:

‎src/iceberg/catalog/rest/auth/sigv4_auth_manager.cc‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,17 @@ Result<std::shared_ptr<AuthSession>> SigV4AuthManager::WrapSession(
430430
} else {
431431
ICEBERG_ASSIGN_OR_RAISE(credentials, MakeCredentialsProvider(properties));
432432
}
433+
// Fail fast when the provider cannot resolve credentials (e.g. an empty
434+
// default chain) instead of sending an effectively unsigned request later.
435+
if (credentials->GetAWSCredentials().IsEmpty()) {
436+
return std::unexpected<Error>(
437+
Error{.kind = ErrorKind::kAuthenticationFailed,
438+
.message = "SigV4: AWS credentials provider returned empty credentials; "
439+
"set '" +
440+
AuthProperties::kSigV4AccessKeyId + "' and '" +
441+
AuthProperties::kSigV4SecretAccessKey +
442+
"' or configure the AWS credentials chain"});
443+
}
433444
auto session =
434445
std::make_shared<SigV4AuthSession>(std::move(delegate_session), std::move(region),
435446
std::move(service), std::move(credentials));

0 commit comments

Comments
 (0)