pythongssapi / python-gssapi

A Python interface to RFC 2743/2744 (plus common extensions)
ISC License
103 stars 45 forks source link
cython gssapi kerberos krb5 python python-library python3 python3-library

============= Python-GSSAPI

.. role:: python(code) :language: python

.. role:: bash(code) :language: bash

.. image:: https://badge.fury.io/gh/pythongssapi%2Fpython-gssapi.svg :target: http://badge.fury.io/gh/pythongssapi%2Fpython-gssapi

.. image:: https://badge.fury.io/py/gssapi.svg :target: http://badge.fury.io/py/gssapi

Python-GSSAPI provides both low-level and high level wrappers around the GSSAPI C libraries. While it focuses on the Kerberos mechanism, it should also be useable with other GSSAPI mechanisms.

Documentation can be found at https://pythongssapi.github.io/python-gssapi/ <https://pythongssapi.github.io/python-gssapi/>_.

Requirements

Basic

Compiling from Scratch

To compile from scratch, you will need Cython >= 0.29.29 which is automatically installed by pip in an isolated build virtual environment.

For Running the Tests

To install test dependencies using pip:

.. code-block:: bash

$ pip install -r test-requirements.txt # Optional, for running test suite

Installation

Easy Way

.. code-block:: bash

$ pip install gssapi

From the Git Repo

After being sure to install all the requirements,

.. code-block:: bash

$ git clone https://github.com/pythongssapi/python-gssapi.git
$ pip install .

Tests

The tests for for Python-GSSAPI live in gssapi.tests. In order to run the tests, you must have an MIT Kerberos installation (including the KDC). The tests create a self-contained Kerberos setup, so running the tests will not interfere with any existing Kerberos installations.

Structure

Python-GSSAPI is composed of two parts: a low-level C-style API which thinly wraps the underlying RFC 2744 methods, and a high-level, Pythonic API (which is itself a wrapper around the low-level API). Examples may be found in the examples directory.

Low-Level API

The low-level API lives in gssapi.raw. The methods contained therein are designed to match closely with the original GSSAPI C methods. All relevant methods and classes may be imported directly from gssapi.raw. Extension methods will only be imported if they are present. The low-level API follows the given format:

High-Level API

The high-level API lives directly under :python:gssapi. The classes contained in each file are designed to provide a more Pythonic, Object-Oriented view of GSSAPI. The exceptions from the low-level API, plus several additional exceptions, live in gssapi.exceptions. The rest of the classes may be imported directly from gssapi. Only classes are exported by gssapi -- all functions are methods of classes in the high-level API.

Please note that QoP is not supported in the high-level API, since it has been deprecated.

Extensions

In addition to RFC 2743/2744, Python-GSSAPI also has support for:

The Team

(GitHub usernames in parentheses)

Get Involved

We welcome new contributions in the form of Issues and Pull Requests on Github. If you would like to join our discussions, you can find us on libera.chat <https://libera.chat/> IRC, channel #python-gssapi <irc://libera.chat/python-gssapi>.