fix: spelling of dbus_fast.auth.AuthAnnonymous to dbus_fast.auth.AuthAnonymous (#220)
This commit is contained in:
parent
0551f01154
commit
6c2412f4ca
@ -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
|
||||
|
||||
@ -99,8 +99,8 @@ class AuthExternal(Authenticator):
|
||||
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
|
||||
@ -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 @@ class AuthAnnonymous(Authenticator):
|
||||
raise AuthError(f"authentication failed: {response.value}: {args}")
|
||||
|
||||
return "BEGIN"
|
||||
|
||||
|
||||
# The following line provides backwards compatibility, remove at some point? --jrd
|
||||
AuthAnnonymous = AuthAnonymous
|
||||
|
||||
@ -3,10 +3,20 @@ import os
|
||||
|
||||
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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user