Skip to content

Commit ac6a123

Browse files
address review feedback
1 parent 8794353 commit ac6a123

19 files changed

Lines changed: 402 additions & 157 deletions
Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
# S3-backed tests against MinIO (Linux and macOS only).
19-
name: S3 Tests
18+
# AWS-related tests. ICEBERG_S3 (Arrow's bundled AWS SDK) and ICEBERG_SIGV4
19+
# (vcpkg-installed aws-cpp-sdk-core) are tested in separate jobs: linking
20+
# both into one binary causes ODR conflicts on the shared AWS SDK symbols.
21+
name: AWS Tests
2022

2123
on:
2224
push:
@@ -39,21 +41,31 @@ env:
3941
ICEBERG_HOME: /tmp/iceberg
4042

4143
jobs:
42-
s3-minio:
44+
aws:
4345
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.draft == false }}
44-
name: S3 (${{ matrix.title }})
46+
name: AWS (${{ matrix.title }})
4547
runs-on: ${{ matrix.runs-on }}
46-
timeout-minutes: 35
48+
timeout-minutes: 45
4749
strategy:
4850
fail-fast: false
4951
matrix:
5052
include:
51-
- title: AMD64 Ubuntu 24.04
53+
- title: AMD64 Ubuntu 24.04, S3
5254
runs-on: ubuntu-24.04
5355
CC: gcc-14
5456
CXX: g++-14
55-
- title: AArch64 macOS 26
57+
s3: "ON"
58+
sigv4: "OFF"
59+
- title: AMD64 Ubuntu 24.04, SigV4
60+
runs-on: ubuntu-24.04
61+
CC: gcc-14
62+
CXX: g++-14
63+
s3: "OFF"
64+
sigv4: "ON"
65+
- title: AArch64 macOS 26, S3
5666
runs-on: macos-26
67+
s3: "ON"
68+
sigv4: "OFF"
5769
env:
5870
ICEBERG_TEST_S3_URI: s3://iceberg-test
5971
AWS_ACCESS_KEY_ID: minio
@@ -70,14 +82,28 @@ jobs:
7082
if: ${{ startsWith(matrix.runs-on, 'ubuntu') }}
7183
shell: bash
7284
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
85+
- name: Cache vcpkg packages
86+
if: ${{ matrix.sigv4 == 'ON' }}
87+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
88+
id: vcpkg-cache
89+
with:
90+
path: /usr/local/share/vcpkg/installed
91+
key: vcpkg-x64-linux-aws-sdk-cpp-core-${{ hashFiles('.github/workflows/aws_test.yml') }}
92+
- name: Install AWS SDK via vcpkg
93+
if: ${{ matrix.sigv4 == 'ON' && steps.vcpkg-cache.outputs.cache-hit != 'true' }}
94+
shell: bash
95+
run: vcpkg install aws-sdk-cpp[core]:x64-linux
7396
- name: Set Ubuntu Compilers
7497
if: ${{ startsWith(matrix.runs-on, 'ubuntu') }}
7598
run: |
7699
echo "CC=${{ matrix.CC }}" >> $GITHUB_ENV
77100
echo "CXX=${{ matrix.CXX }}" >> $GITHUB_ENV
78101
- name: Start MinIO
102+
if: ${{ matrix.s3 == 'ON' }}
79103
shell: bash
80104
run: bash ci/scripts/start_minio.sh
81-
- name: Build and test Iceberg with S3
105+
- name: Build and test Iceberg
82106
shell: bash
83-
run: ci/scripts/build_iceberg.sh "$(pwd)" OFF OFF ON
107+
env:
108+
CMAKE_TOOLCHAIN_FILE: ${{ matrix.sigv4 == 'ON' && '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake' || '' }}
109+
run: ci/scripts/build_iceberg.sh "$(pwd)" OFF OFF ${{ matrix.s3 }} ${{ matrix.sigv4 }}

.github/workflows/sigv4_test.yml

Lines changed: 0 additions & 71 deletions
This file was deleted.

ci/scripts/build_iceberg.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ if is_windows; then
6060
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Release")
6161
else
6262
CMAKE_ARGS+=("-DCMAKE_BUILD_TYPE=Debug")
63-
if [[ -n "${CMAKE_TOOLCHAIN_FILE:-}" ]]; then
64-
CMAKE_ARGS+=("-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}")
65-
fi
6663
fi
6764

6865
if [[ "${build_enable_sccache}" == "ON" ]]; then

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,11 @@ function(resolve_aws_sdk_dependency)
638638
set(ICEBERG_SYSTEM_DEPENDENCIES
639639
${ICEBERG_SYSTEM_DEPENDENCIES}
640640
PARENT_SCOPE)
641+
# Forwarded to find_dependency(AWSSDK ...) in iceberg-config.cmake.in so
642+
# downstream installed builds load aws-cpp-sdk-core via AWSSDK_FIND_COMPONENTS.
643+
set(ICEBERG_FIND_EXTRA_ARGS_AWSSDK
644+
"COMPONENTS;core"
645+
PARENT_SCOPE)
641646
endfunction()
642647

643648
if(ICEBERG_SIGV4)

src/iceberg/catalog/rest/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ set(ICEBERG_REST_SOURCES
2929
endpoint.cc
3030
error_handlers.cc
3131
http_client.cc
32+
http_request.cc
3233
json_serde.cc
3334
resource_paths.cc
3435
rest_catalog.cc

src/iceberg/catalog/rest/auth/auth_manager.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ Result<std::shared_ptr<AuthSession>> AuthManager::InitSession(
3838
}
3939

4040
Result<std::shared_ptr<AuthSession>> AuthManager::ContextualSession(
41-
[[maybe_unused]] const std::unordered_map<std::string, std::string>& context,
42-
std::shared_ptr<AuthSession> parent) {
41+
[[maybe_unused]] const SessionContext& context, std::shared_ptr<AuthSession> parent) {
4342
// By default, return the parent session as-is
4443
return parent;
4544
}

src/iceberg/catalog/rest/auth/auth_manager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <string>
2424
#include <unordered_map>
2525

26+
#include "iceberg/catalog/rest/auth/session_context.h"
2627
#include "iceberg/catalog/rest/iceberg_rest_export.h"
2728
#include "iceberg/catalog/rest/type_fwd.h"
2829
#include "iceberg/result.h"
@@ -70,13 +71,12 @@ class ICEBERG_REST_EXPORT AuthManager {
7071
/// This method is used by SessionCatalog to create sessions for different contexts
7172
/// (e.g., different users or tenants).
7273
///
73-
/// \param context Context properties (e.g., user credentials, tenant info).
74+
/// \param context Per-session properties and credentials.
7475
/// \param parent Catalog session to inherit from or return as-is.
7576
/// \return A context-specific session, or the parent session if no context-specific
7677
/// session is needed, or an error if session creation fails.
7778
virtual Result<std::shared_ptr<AuthSession>> ContextualSession(
78-
const std::unordered_map<std::string, std::string>& context,
79-
std::shared_ptr<AuthSession> parent);
79+
const SessionContext& context, std::shared_ptr<AuthSession> parent);
8080

8181
/// \brief Create or reuse a session scoped to a single table/view.
8282
///

src/iceberg/catalog/rest/auth/auth_managers.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ const std::unordered_set<std::string, StringHash, StringEqual>& KnownAuthTypes()
4646
// Infer the authentication type from properties.
4747
std::string InferAuthType(
4848
const std::unordered_map<std::string, std::string>& properties) {
49+
// Deprecated alias: rest.sigv4-enabled=true forces SigV4.
50+
if (auto it = properties.find(AuthProperties::kSigV4Enabled);
51+
it != properties.end() && StringUtils::EqualsIgnoreCase(it->second, "true")) {
52+
return AuthProperties::kAuthTypeSigV4;
53+
}
54+
4955
auto it = properties.find(AuthProperties::kAuthType);
5056
if (it != properties.end() && !it->second.empty()) {
5157
return StringUtils::ToLower(it->second);
@@ -61,8 +67,8 @@ std::string InferAuthType(
6167
return AuthProperties::kAuthTypeNone;
6268
}
6369

64-
AuthManagerRegistry CreateDefaultRegistry() {
65-
AuthManagerRegistry registry = {
70+
AuthManagerRegistry& GetRegistry() {
71+
static AuthManagerRegistry registry = {
6672
{AuthProperties::kAuthTypeNone, MakeNoopAuthManager},
6773
{AuthProperties::kAuthTypeBasic, MakeBasicAuthManager},
6874
{AuthProperties::kAuthTypeOAuth2, MakeOAuth2Manager},
@@ -71,12 +77,6 @@ AuthManagerRegistry CreateDefaultRegistry() {
7177
return registry;
7278
}
7379

74-
// Get the global registry of auth manager factories.
75-
AuthManagerRegistry& GetRegistry() {
76-
static AuthManagerRegistry registry = CreateDefaultRegistry();
77-
return registry;
78-
}
79-
8080
} // namespace
8181

8282
void AuthManagers::Register(std::string_view auth_type, AuthManagerFactory factory) {

src/iceberg/catalog/rest/auth/auth_properties.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ class ICEBERG_REST_EXPORT AuthProperties : public ConfigBase<AuthProperties> {
5454

5555
// ---- SigV4 entries ----
5656

57+
/// Deprecated: `rest.sigv4-enabled=true` selects SigV4 regardless of
58+
/// `rest.auth.type`.
59+
inline static const std::string kSigV4Enabled = "rest.sigv4-enabled";
5760
inline static const std::string kSigV4DelegateAuthType =
5861
"rest.auth.sigv4.delegate-auth-type";
5962
inline static const std::string kSigV4SigningRegion = "rest.signing-region";

src/iceberg/catalog/rest/auth/meson.build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ install_headers(
2323
'auth_session.h',
2424
'aws_sdk.h',
2525
'oauth2_util.h',
26+
'session_context.h',
2627
],
2728
subdir: 'iceberg/catalog/rest/auth',
2829
)

0 commit comments

Comments
 (0)