New Integrations: Python and Buildbot

2024/08/06

It’s now easier than ever to write an application that interfaces with NetAuth in Python, using the new NetAuth Python library. Integrating NetAuth authentication into a Python application can be as simple as:

import netauth
conn = netauth.NetAuth("netauth.example.org")
def auth(username: str, password: str) -> bool:
    try:
        conn.auth_entity(username, password)
        # success!
        return True
    except netauth.error.UnauthenticatedError:
        # failure :(
        return False
    except netauth.error.NetAuthRpcError as e:
        # uh oh
        print(f"Request failed: {e}")
        return False

Buildbot is a highly-extensible continuous integration framework written in Python. Void Linux uses Buildbot to build its packages for delivery to users. To make it easier for Void’s developers to interact with the Buildbot, the NetAuth Python library was used to write an authentication and authorization plugin for Buildbot. This plugin handles authentication, passes user information from NetAuth to Buildbot, and allows setting ACLs based on NetAuth groups.

The source code for the Python library and Buildbot plugin are on Github.

>> Home