diff --git a/docs/source/authentication.rst b/docs/source/authentication.rst index 39f667e4..bca14c2e 100644 --- a/docs/source/authentication.rst +++ b/docs/source/authentication.rst @@ -6,4 +6,4 @@ Classes for the DBus `authentication protocol str: raise AuthError(f"authentication failed: {response.value}: {args}") -class AuthAnnonymous(Authenticator): - """An authenticator class for the annonymous auth protocol for use with the +class AuthAnonymous(Authenticator): + """An authenticator class for the anonymous auth protocol for use with the :class:`MessageBus `. :sealso: https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol @@ -109,7 +109,7 @@ class AuthAnnonymous(Authenticator): def _authentication_start(self, negotiate_unix_fd: bool = False) -> str: if negotiate_unix_fd: raise AuthError( - "annonymous authentication does not support negotiating unix fds right now" + "anonymous authentication does not support negotiating unix fds right now" ) return "AUTH ANONYMOUS" @@ -121,3 +121,7 @@ def _receive_line(self, line: str) -> str: raise AuthError(f"authentication failed: {response.value}: {args}") return "BEGIN" + + +# The following line provides backwards compatibility, remove at some point? --jrd +AuthAnnonymous = AuthAnonymous diff --git a/tests/test_auth.py b/tests/test_auth.py index 8c86056d..bc8a90c4 100644 --- a/tests/test_auth.py +++ b/tests/test_auth.py @@ -3,10 +3,20 @@ import pytest -from dbus_fast.auth import UID_NOT_SPECIFIED, AuthExternal +from dbus_fast.auth import ( + UID_NOT_SPECIFIED, + AuthAnnonymous, + AuthAnonymous, + AuthExternal, +) from dbus_fast.errors import AuthError +def test_annonymous_backcompat(): + auth = AuthAnnonymous() + assert isinstance(auth, AuthAnonymous) + + def test_uid_is_set(): auth = AuthExternal(uid=999) assert auth._authentication_start() == "AUTH EXTERNAL 393939"