Skip to content

Conversation

@dkropachev
Copy link
Collaborator

@dkropachev dkropachev commented Feb 2, 2026

Summary

  • Replace the unmaintained pure-sasl dependency with an internal SASL client implementation
  • Add comprehensive unit tests for the new SASL module
  • Update documentation to remove references to pure-sasl

Fixes #666

Background

The pure-sasl package has been unmaintained since 2019. While it currently works, depending on an unmaintained library poses risks for future Python version compatibility and security issues.

Changes

  • New cassandra/sasl.py module: Internal SASL client implementation based on pure-sasl (MIT licensed) with full support for:

    • PLAIN mechanism for username/password authentication
    • GSSAPI mechanism for Kerberos authentication with QOP negotiation
    • Platform-aware kerberos library selection (kerberos on Unix, winkerberos on Windows)
  • Updated cassandra/auth.py:

    • Import SASLClient from internal module instead of puresasl
    • Remove _have_puresasl checks (SASL is now always available)
    • Update docstrings to reference cassandra.sasl.QOP instead of puresasl.QOP
  • Updated pyproject.toml: Removed pure-sasl from dev dependencies

  • Updated docs/security.rst: Removed references to pure-sasl package

  • Updated tests:

    • Removed pure-sasl skip check from integration tests
    • Added comprehensive unit tests for the new SASL implementation

Test plan

  • Unit tests pass: pytest tests/unit/test_auth.py -v
  • Integration tests with authentication enabled
  • Verify GSSAPI mechanism works with Kerberos environment

@dkropachev dkropachev force-pushed the remove-pure-sasl-dependency branch 2 times, most recently from 0dece76 to 6029c30 Compare February 3, 2026 23:09
This change eliminates the external pure-sasl dependency which has been
unmaintained since 2019 (addresses #666). The implementation provides:

- Internal SASL client in cassandra/sasl.py based on pure-sasl (MIT licensed)
- Full PLAIN mechanism support for username/password authentication
- Full GSSAPI mechanism support for Kerberos authentication with QOP negotiation
- Platform-aware kerberos library selection (kerberos/winkerberos)

The internal implementation maintains API compatibility with existing code
while removing the risk of depending on an unmaintained external library.
@dkropachev dkropachev force-pushed the remove-pure-sasl-dependency branch from 6029c30 to fb19b65 Compare February 3, 2026 23:09
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.

Monitor pure-sasl dependency

2 participants