Merged
Conversation
Introduce gRPC-based cluster forwarding and refactor SQL execution handling. The SQL forwarder now uses a ClusterClient/ForwardSqlRequest over gRPC (instead of HTTP) and returns leader responses directly; helpers added for header/address normalization and cluster client resolution. The EXECUTE AS parsing in the SQL executor was simplified to delegate to kalamdb_sql::execute_as. Several raft/network modules and cluster RPC helpers were added (network client, handler, serde, models, service), plus new raft tests and live cluster handler. UI: streaming feature pages, service, types and tests were added. Misc: added utility scripts and various tests. Cargo.toml and Cargo.lock updated to bump multiple dependencies (syn, uuid, clap, futures-*, flatbuffers, indicatif, sysinfo, etc.) to match the new code.
Treat malformed or missing auth tokens as 401 Unauthorized (OWASP info-disclosure mitigation) and update related tests accordingly. Adjust JWT test payload to omit the validated `username` claim so JWT encoder doesn't reject the test payload. In raft tests, avoid port conflicts by introducing separate unauthenticated RPC ports and make oversized-request assertions accept either a transport-level size rejection or a 401 from the auth handler. Update cluster HTTP tests to expect CLUSTER JOIN/LEAVE to return Error (commands removed). Make CLI storage tests use test-unique namespaces to prevent cross-test interference. Files changed: kalamdb-auth extractor & jwt provider, kalamdb-raft tests, backend JWT auth test, cluster HTTP test, and CLI hot/cold storage tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several dependency updates and refactors SQL forwarding logic for cluster mode, with improvements to error handling and forwarding via gRPC. It also enhances authentication error responses to comply with security best practices.
Dependency updates:
Cargo.toml, includinguuid,clap,sysinfo,indicatif,futures-util,flatbuffers,cc, andsyn, ensuring compatibility and access to latest features and bug fixes. [1] [2] [3] [4]Cluster SQL forwarding refactor:
backend/crates/kalamdb-api/src/handlers/sql/forward.rsto use gRPC for forwarding to leader and shard nodes, improving reliability and performance. Added helper functions for header extraction and node resolution, and removed legacy HTTP-based forwarding.Authentication error handling:
SQL parsing improvements:
parse_execute_statementfunction inbackend/crates/kalamdb-api/src/handlers/sql/execute.rsby delegating parsing to the canonical parser inkalamdb_sql::execute_as, reducing code duplication and improving maintainability.Miscellaneous:
Notes.mdregarding the need to shorten subscription IDs for better usability and future-proofing.