Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thobbs/pure-sasl
A pure python SASL client
https://github.com/thobbs/pure-sasl
kerberos python python3 sasl
Last synced: 7 days ago
JSON representation
A pure python SASL client
- Host: GitHub
- URL: https://github.com/thobbs/pure-sasl
- Owner: thobbs
- License: mit
- Created: 2012-09-21T00:58:28.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2023-06-25T06:59:40.000Z (over 1 year ago)
- Last Synced: 2025-01-11T05:57:01.568Z (7 days ago)
- Topics: kerberos, python, python3, sasl
- Language: Python
- Size: 110 KB
- Stars: 37
- Watchers: 9
- Forks: 33
- Open Issues: 11
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
pure-sasl
=========.. image:: https://travis-ci.org/thobbs/pure-sasl.png?branch=master
:target: https://travis-ci.org/thobbs/pure-saslpure-sasl is a pure python client-side SASL implementation.
At the moment, it supports the following mechanisms: ANONYMOUS, PLAIN, EXTERNAL,
CRAM-MD5, DIGEST-MD5, and GSSAPI. Support for other mechanisms may be added in the
future. Only GSSAPI supports a QOP higher than auth. Always use TLS!Both Python 2 and Python 3 are supported.
Example Usage
-------------.. code-block:: python
from puresasl.client import SASLClient
sasl = SASLClient('somehost2', 'customprotocol')
conn = get_connection_to('somehost2')
available_mechs = conn.get_mechanisms()
sasl.choose_mechanism(available_mechs, allow_anonymous=False)
while True:
status, challenge = conn.get_challenge()
if status == 'COMPLETE':
break
elif status == 'OK':
response = sasl.process(challenge)
conn.send_response(response)
else:
raise Exception(status)if not sasl.complete:
raise Exception("SASL negotiation did not complete")# begin normal communication
encoded = conn.fetch_data()
decoded = sasl.unwrap(encoded)
response = process_data(decoded)
conn.send_data(sasl.wrap(response))License
-------
Some of the mechanisms and utility functions are based on work done
by David Alan Cridland and Lance Stout in Suelta: https://github.com/dwd/Sueltapure-sasl is open source under the
`MIT license `_.