{"library":"sasl","title":"sasl","description":"The `sasl` library provides Python bindings for the Cyrus SASL library. It allows Python applications to interact with SASL for authentication and security layer negotiation, typically serving as a low-level component for other protocol implementations. The current version is `0.3.1`, released in June 2021. The project appears to be in a maintenance state with infrequent updates, and known compatibility issues exist with newer Python versions.","language":"python","status":"maintenance","last_verified":"Fri May 15","install":{"commands":["pip install sasl"],"cli":null},"imports":["import sasl\nclient = sasl.Client(...)"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import sasl\nimport os\n\n# Note: This is a conceptual example for a SASL client.\n# The 'sasl' library is a binding to Cyrus SASL, \n# requiring system-level Cyrus SASL installation and configuration.\n# A functional quickstart requires a full SASL server setup.\n# For a pure-Python, more easily runnable SASL client/server, consider 'pysasl'.\n\ndef my_sasl_interact(challenge):\n    # In a real application, this would prompt the user or retrieve credentials\n    # For this example, we return a placeholder response\n    if challenge:\n        print(f\"SASL Challenge: {challenge.decode()}\")\n    username = os.environ.get('SASL_USERNAME', 'testuser')\n    password = os.environ.get('SASL_PASSWORD', 'testpass')\n    return f'\\0{username}\\0{password}'.encode()\n\ntry:\n    # Initialize a SASL client instance\n    # This assumes a 'myservice' SASL service is configured on the system\n    # and that the client can connect to a SASL server.\n    client = sasl.Client(\n        service='myservice',\n        host='localhost',\n        sasl_callback=my_sasl_interact # Callback to handle challenges\n    )\n\n    # Attempt to start authentication using PLAIN mechanism\n    # In a real scenario, this would involve sending/receiving data over a network socket.\n    # For illustration, we just attempt to start the process.\n    initial_response = client.start('PLAIN')\n    print(f\"Initial SASL response: {initial_response.decode() if initial_response else 'No initial response'}\")\n\n    # Acknowledge the conceptual nature of this example for direct execution.\n    print(\"\\nNote: A fully runnable example requires a configured Cyrus SASL server and network communication.\")\n\nexcept sasl.SASLError as e:\n    print(f\"SASL Error during client initialization or start: {e}\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")\n","lang":"python","description":"This conceptual quickstart illustrates the basic initialization of a `sasl.Client` instance. As `sasl` is a C binding to the Cyrus SASL library, a truly runnable example requires a pre-configured Cyrus SASL installation on the system and a SASL server to interact with. The `sasl_callback` function is a placeholder for handling authentication challenges. For simpler, pure-Python SASL client/server implementations with clear examples, consider libraries like `pysasl` or `pure-sasl`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-15","installed_version":null,"pypi_latest":"0.3.1","is_stale":null,"summary":{"python_range":"3.10–3.9","success_rate":0,"avg_install_s":null,"avg_import_s":null,"wheel_type":null},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.4,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.1,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":3.1,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.8,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":null,"import_time_s":null,"mem_mb":null,"disk_size":null},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"sasl","exit_code":1,"wheel_type":null,"failure_reason":"build_error","import_side_effects":null,"install_time_s":2.7,"import_time_s":null,"mem_mb":null,"disk_size":null}]}}