Skip to content

feat(auth): non-SCRAM SASL — PLAIN, EXTERNAL, OAUTHBEARER (#10) - #22

Merged
rigazilla merged 1 commit into
infinispan:mainfrom
rigazilla:feat/non-scram-sasl
Nov 13, 2026
Merged

rigazilla merged 1 commit into
infinispan:mainfrom
rigazilla:feat/non-scram-sasl

Conversation

@rigazilla

@rigazilla rigazilla commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Generalizes the SASL driver beyond the SCRAM family to three single-message mechanisms. The wire layer (AuthCodec / SaslTransport) was already mechanism-agnostic — it carries a mechanism name + opaque token bytes — so only SaslAuthenticator needed generalizing (classify mechanism → SCRAM multi-turn vs single-message path; the well-tested SCRAM flow is untouched).

Mechanisms

  • PLAIN (RFC 4616) — username/password; requires a username. Use over TLS.
  • EXTERNAL (RFC 4422) — identity from the mutual-TLS client certificate; no credentials. (Unblocked by TLS transport: server-authenticated TLS (PEM) for hotrods:// #18.)
  • OAUTHBEARER (RFC 7628) — bearer token, incl. the RFC's failure-continuation turn.

GSSAPI/GS2-KRB5 (Kerberos) and DIGEST-MD5 remain unsupported and throw at connect().

API / config

  • Authentication gains a token field; new RemoteCache::setAuthentication(const Authentication&) overload for token/cert mechanisms.
  • HotRodURI parses token; fromUri enables auth on any auth signal (mechanism, credentials, or token) — EXTERNAL/OAUTHBEARER have no username.
  • Pure, unit-testable initial-response builders in new include/hotrod/SaslMechanisms.h.

Tests

  • 284 unit tests pass (+18): 7 pure-builder cases + 9 driver-flow cases (success, bad creds, missing username/token, mechanism-not-offered, OAUTHBEARER failure continuation) + 3 URI cases. Clean under -Werror, Debug and Release.

Notes

  • Integration coverage is unit-only (fake servers) — end-to-end needs server SASL realms / a token issuer / a cert→identity mapping; tracked in the STATUS backlog alongside the mutual-TLS integration gap.
  • SASL names are matched case-sensitively against the server's offered list (canonical upper-case).

Docs updated: STATUS.md, DECISIONS.md, security.adoc, README.md.

🤖 Generated with Claude Code

Closes #23.

)

Generalize the SASL driver beyond SCRAM to three single-message mechanisms.
The wire layer (AuthCodec/SaslTransport) was already mechanism-agnostic; only
SaslAuthenticator was SCRAM-specific.

Mechanisms:
- PLAIN (RFC 4616): username/password; requires a username. Use over TLS.
- EXTERNAL (RFC 4422): identity from the mutual-TLS client cert; no creds.
- OAUTHBEARER (RFC 7628): bearer token, incl. the failure-continuation turn.
GSSAPI/GS2-KRB5 and DIGEST-MD5 remain unsupported (throw at connect()).

API/config:
- Authentication gains a `token` field; new
  RemoteCache::setAuthentication(const Authentication&) overload for
  token/cert mechanisms.
- HotRodURI parses `token`; fromUri enables auth on any signal (mechanism,
  creds, or token) since EXTERNAL/OAUTHBEARER need no username.
- Pure, unit-testable initial-response builders in SaslMechanisms.h.

Tests (+18): pure builders + driver flows against fake servers (success,
bad creds, missing username/token, mechanism-not-offered, OAUTHBEARER
failure continuation) + URI cases. 284 unit tests pass.

Integration coverage is unit-only (needs server realms/token issuer) —
tracked in STATUS backlog.

Docs: STATUS.md, DECISIONS.md, security.adoc, README.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@rigazilla
rigazilla merged commit 6e72e91 into infinispan:main Nov 13, 2026
3 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.

SASL: non-SCRAM mechanisms (PLAIN, EXTERNAL, OAUTHBEARER)

1 participant