Repository navigation
feat: Hot Rod URI support — RemoteCache::fromUri (issue #9) - #11
Merged
Merged
Conversation
rigazilla
force-pushed
the
feat/hotrod-uri
branch
2 times, most recently
from
October 9, 2026 15:48
1f0c828 to
580161e
Compare
rigazilla
force-pushed
the
feat/hotrod-uri
branch
from
October 19, 2026 09:26
580161e to
f996bc6
Compare
Add a connection-string entry point requested in issue #9: RemoteCache::fromUri("hotrod://[user:pass@]host1[:port1][,host2...][?k=v&...]") Parsing lives in a pure, header-only HotRodURI::parse (include/hotrod/HotRodURI.h, following the ServerSelection.h / AuthCodec.h precedent); the factory applies the existing flat setters and returns a configured, not-yet-connected unique_ptr<RemoteCache> (RemoteCache owns a mutex, so it is non-movable). Behaviour follows the Java client HotRodURI (AGENTS.md source order), not the .NET docs the issue links — notably protocol_version uses Java's "4.0"/"4.1" form. v1 scope: hotrod:// only; first host seeds the topology; credentials enable SCRAM; query whitelist sasl_mechanism / client_intelligence / protocol_version. Anything unsupported (hotrods:// / TLS, unknown params, AUTO/3.x versions) throws a HotRodClientException; deferred features tracked in issue #10. Userinfo and query values are percent-decoded (RFC 3986), matching the Java client's java.net.URI parsing, so a reserved character in a password (e.g. an '@' written %40) reaches SCRAM as its real bytes instead of failing auth. Malformed escapes throw; decoding happens after the raw user:pass split so an encoded ':' in the password is preserved. Tests: +27 unit (HotRodURITest), full suite 250/250, Release -Werror clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
rigazilla
force-pushed
the
feat/hotrod-uri
branch
from
October 19, 2026 09:48
f996bc6 to
c6e0323
Compare
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.
Closes #9.
What this adds
A connection-string entry point:
Parsing lives in a pure, header-only
HotRodURI::parse(include/hotrod/HotRodURI.h, following theServerSelection.h/AuthCodec.hprecedent). The factory applies the existing flat setters and returns a configured, not-yet-connectedstd::unique_ptr<RemoteCache>(RemoteCache owns a mutex, so it is non-movable).Behaviour follows the Java client
HotRodURI(authoritative perAGENTS.md), not the .NET docs linked from the issue — notablyprotocol_versionuses Java's"4.0"/"4.1"form, notversion40.Scope — this PR is focused on URI parsing only
It parses the whole URI but wires up only what the client supports today, and throws a clear
HotRodClientExceptionfor anything else:Supported (v1):
hotrod://scheme;[user:password@]; comma-separatedhost[:port](first host seeds the topology, discovery finds the rest); query whitelistsasl_mechanism,client_intelligence(case-insensitive),protocol_version(4.0/4.1).Rejected with an explicit error (not silently ignored):
hotrods:///TLS, unknown params (connect_timeout,socket_timeout,use_ssl,token, …),protocol_version=AUTO/3.x.The missing pieces are intentionally out of scope and all tracked as follow-up issues — see #10 (TLS/
hotrods://, timeouts, multi-server seed failover, non-SCRAM SASL,AUTO/3.x versions). Each will drop its "unsupported" throw as the underlying capability lands.Tests
HotRodURITest): grammar, multi-host, userinfo, the typed query whitelist, and explicit rejection of the deferred features. Full unit suite 243/243; Release-Werrorbuild clean. Parsing is pure, so this is the exhaustive coverage.FromUriIntegrationTest(plainhotrod://round-trip; a?protocol_version=4.0client flows the param through to a working client) andAuthIntegrationTest.FromUriWithCredentialsAuthenticates(credentials +?sasl_mechanismin the URI authenticate end-to-end). These prove the parse→setter→connect→op chain.client_intelligence=hash_distribution_awareis deliberately not integration-tested on the single-server fixture (the Dockerized single node advertises internal container addresses, so hash-aware routing is covered only by the multi-server suites). The single-server URI test uses the routing-neutralprotocol_versioninstead.Docs updated alongside the code (STATUS.md / DECISIONS.md / README.md).
🤖 Generated with Claude Code