Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: spelling of dbus_fast.auth.AuthAnnonymous to dbus_fast.auth.AuthAnonymous #220

Merged
merged 3 commits into from
Aug 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/authentication.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ Classes for the DBus `authentication protocol <https://dbus.freedesktop.org/doc/
.. autoclass:: dbus_fast.auth.Authenticator

.. autoclass:: dbus_fast.auth.AuthExternal
.. autoclass:: dbus_fast.auth.AuthAnnonymous
.. autoclass:: dbus_fast.auth.AuthAnonymous
10 changes: 7 additions & 3 deletions src/dbus_fast/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ def _receive_line(self, line: str) -> 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 <dbus_fast.message_bus.BaseMessageBus>`.

:sealso: https://dbus.freedesktop.org/doc/dbus-specification.html#auth-protocol
Expand All @@ -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"
Expand All @@ -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
12 changes: 11 additions & 1 deletion tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down