Skip to content

Conversation

@lishuxu
Copy link
Contributor

@lishuxu lishuxu commented Jan 2, 2026

feat: add restcatalog authentication api

/// \param properties Configuration properties.
/// \return A session for initialization, or the catalog session by default.
virtual std::shared_ptr<AuthSession> InitSession(
HttpClient* init_client,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use raw pointer?🤔 use std::shared_ptr instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AuthManager simply borrows the HTTP client owned by the catalog, it isn’t supposed to manage that client’s lifetime, so here use raw pointer.

Comment on lines +18 to +23
set(ICEBERG_REST_AUTH_SOURCES auth_session.cc auth_manager.cc auth_managers.cc)

# Expose sources to parent scope for inclusion in iceberg_rest library
set(ICEBERG_REST_AUTH_SOURCES
${ICEBERG_REST_AUTH_SOURCES}
PARENT_SCOPE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set(ICEBERG_REST_AUTH_SOURCES auth_session.cc auth_manager.cc auth_managers.cc)
# Expose sources to parent scope for inclusion in iceberg_rest library
set(ICEBERG_REST_AUTH_SOURCES
${ICEBERG_REST_AUTH_SOURCES}
PARENT_SCOPE)
iceberg_install_all_headers(iceberg/catalog/rest/auth)

The current pattern is inconsistent with other CMake config. We should only install headers for this subdirectory here.

Comment on lines +32 to +36
# Add auth sources with proper path prefix
foreach(AUTH_SOURCE ${ICEBERG_REST_AUTH_SOURCES})
list(APPEND ICEBERG_REST_SOURCES "auth/${AUTH_SOURCE}")
endforeach()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Add auth sources with proper path prefix
foreach(AUTH_SOURCE ${ICEBERG_REST_AUTH_SOURCES})
list(APPEND ICEBERG_REST_SOURCES "auth/${AUTH_SOURCE}")
endforeach()

Let's remove these lines by directly adding those files in the above set(ICEBERG_REST_SOURCES).

# specific language governing permissions and limitations
# under the License.

# Include auth subdirectory
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Include auth subdirectory

This comment is unnecessary.


} // namespace iceberg::rest

namespace iceberg::rest::auth {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really need the extra auth namespace?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants