Skip to content

Feature/flatbuffers#143

Merged
jamals86 merged 3 commits intomainfrom
feature/flatbuffers
Feb 18, 2026
Merged

Feature/flatbuffers#143
jamals86 merged 3 commits intomainfrom
feature/flatbuffers

Conversation

@jamals86
Copy link
Copy Markdown
Collaborator

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:

  • Updated versions for several dependencies in Cargo.toml, including uuid, clap, sysinfo, indicatif, futures-util, flatbuffers, cc, and syn, ensuring compatibility and access to latest features and bug fixes. [1] [2] [3] [4]

Cluster SQL forwarding refactor:

  • Refactored SQL forwarding logic in backend/crates/kalamdb-api/src/handlers/sql/forward.rs to 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.
  • Enhanced handling of NOT_LEADER errors by forwarding to the correct shard leader using gRPC, with improved error detection and fallback mechanisms.

Authentication error handling:

  • Changed malformed authorization token responses to return HTTP 401 Unauthorized instead of 400 Bad Request, following OWASP guidance to avoid information disclosure. Updated related tests for this behavior. [1] [2]

SQL parsing improvements:

  • Simplified the parse_execute_statement function in backend/crates/kalamdb-api/src/handlers/sql/execute.rs by delegating parsing to the canonical parser in kalamdb_sql::execute_as, reducing code duplication and improving maintainability.

Miscellaneous:

  • Added a note in Notes.md regarding the need to shorten subscription IDs for better usability and future-proofing.

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.
@jamals86 jamals86 merged commit 1f8674b into main Feb 18, 2026
1 of 4 checks passed
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.

1 participant