Skip to content

Commit 0895bc2

Browse files
author
shuxu.li
committed
feat: Implement NoopAuthManager and integrate AuthManager into RestCatalog
1 parent 47167aa commit 0895bc2

File tree

3 files changed

+0
-25
lines changed

3 files changed

+0
-25
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ class NoopAuthManager : public AuthManager {
7979
AuthManagerRegistry& GetRegistry() {
8080
static AuthManagerRegistry registry = [] {
8181
AuthManagerRegistry r;
82-
// Register built-in "none" auth manager
8382
r[AuthProperties::kAuthTypeNone] =
8483
[]([[maybe_unused]] std::string_view name,
8584
[[maybe_unused]] const std::unordered_map<std::string, std::string>& props)

src/iceberg/catalog/rest/rest_catalog.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ Result<std::shared_ptr<RestCatalog>> RestCatalog::Make(
139139
ICEBERG_ASSIGN_OR_RAISE(auto server_config,
140140
FetchServerConfig(*paths, config, init_session));
141141

142-
// Merge client config with server defaults and overrides
143142
std::unique_ptr<RestCatalogProperties> final_config = RestCatalogProperties::FromMap(
144143
MergeConfigs(server_config.defaults, config.configs(), server_config.overrides));
145144

src/iceberg/test/auth_manager_test.cc

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -80,29 +80,6 @@ TEST_F(AuthManagerTest, UnknownAuthTypeReturnsInvalidArgument) {
8080
EXPECT_THAT(result, HasErrorMessage("Unknown authentication type"));
8181
}
8282

83-
// Verifies that known but unimplemented auth type returns NotImplemented
84-
TEST_F(AuthManagerTest, KnownButUnimplementedAuthType) {
85-
std::unordered_map<std::string, std::string> properties = {
86-
{AuthProperties::kAuthType, "basic"}};
87-
88-
auto result = AuthManagers::Load("test-catalog", properties);
89-
EXPECT_THAT(result, IsError(ErrorKind::kNotImplemented));
90-
EXPECT_THAT(result, HasErrorMessage("not yet supported"));
91-
}
92-
93-
// Verifies that OAuth2 auth type is inferred from credential or token properties
94-
TEST_F(AuthManagerTest, InferOAuth2FromProperties) {
95-
// From credential
96-
auto result1 = AuthManagers::Load(
97-
"test", {{AuthProperties::kOAuth2Credential, "client_id:client_secret"}});
98-
EXPECT_THAT(result1, IsError(ErrorKind::kNotImplemented));
99-
100-
// From token
101-
auto result2 =
102-
AuthManagers::Load("test", {{AuthProperties::kOAuth2Token, "bearer-token"}});
103-
EXPECT_THAT(result2, IsError(ErrorKind::kNotImplemented));
104-
}
105-
10683
// Verifies custom auth manager registration
10784
TEST_F(AuthManagerTest, RegisterCustomAuthManager) {
10885
AuthManagers::Register(

0 commit comments

Comments
 (0)