From 84f6dc8dc7abd14b52d381b96e337bd21d83c2a5 Mon Sep 17 00:00:00 2001 From: Bastian Krause Date: Thu, 22 Jun 2023 13:20:14 +0200 Subject: [PATCH 1/2] remote/authenticator: drop obsolete ticket authenticator Now that #1079 and #1136 are merged, the coordinator no longer supports ticket authentication. Drop the corresponding authenticator class, do not advertise ticket auth anymore. Exporters and clients might still talk to older coordinator versions, so leave ticket authentication for these components enabled. Signed-off-by: Bastian Krause --- labgrid/remote/authenticator.py | 20 -------------------- labgrid/remote/coordinator.py | 5 +---- pyproject.toml | 3 --- 3 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 labgrid/remote/authenticator.py diff --git a/labgrid/remote/authenticator.py b/labgrid/remote/authenticator.py deleted file mode 100644 index a31321947..000000000 --- a/labgrid/remote/authenticator.py +++ /dev/null @@ -1,20 +0,0 @@ -import logging -from pprint import pprint -from twisted.internet.defer import inlineCallbacks -from autobahn.twisted.wamp import ApplicationSession - - -class AuthenticatorSession(ApplicationSession): - @inlineCallbacks - def onJoin(self, details): - def authenticate(realm, authid, details): # pylint: disable=unused-argument - logging.warning("%s still uses deprecated ticket authentication. Please update.", authid) - pprint(details) - principal = {'role': 'public', 'extra': {}} - return principal - - import warnings - warnings.warn("Ticket authentication is deprecated. Please switch to anonymous authentication once all your exporters/clients support it: .crossbar/config-anonymous.yaml", - DeprecationWarning) - - yield self.register(authenticate, 'org.labgrid.authenticate') diff --git a/labgrid/remote/coordinator.py b/labgrid/remote/coordinator.py index 6fc230302..cfd86ea0f 100644 --- a/labgrid/remote/coordinator.py +++ b/labgrid/remote/coordinator.py @@ -133,14 +133,11 @@ async def onConnect(self): enable_tcp_nodelay(self) self.join( self.config.realm, - authmethods=["anonymous", "ticket"], + authmethods=["anonymous"], authid="coordinator", authextra={"authid": "coordinator"}, ) - def onChallenge(self, challenge): - return "dummy-ticket" - @locked async def onJoin(self, details): await self.subscribe(self.on_session_join, 'wamp.session.on_join') diff --git a/pyproject.toml b/pyproject.toml index 1e1195694..42eed529a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -157,9 +157,6 @@ testpaths = [ ] addopts = "-p no:labgrid" -[tool.pylint.MASTER] -ignore-paths = ["labgrid/remote/authenticator.py"] - [tool.pylint.imports] ignored-modules = ["gi"] From 94400ccdd8d11934c090a2d2780a79f7577defb9 Mon Sep 17 00:00:00 2001 From: Bastian Krause Date: Thu, 22 Jun 2023 15:37:33 +0200 Subject: [PATCH 2/2] CHANGES: document dropped ticket authentication in v23.1 Signed-off-by: Bastian Krause --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index a10bcddab..36e8caf19 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -28,6 +28,9 @@ Bug fixes in 23.1 Breaking changes in 23.1 ~~~~~~~~~~~~~~~~~~~~~~~~~ +- Support for the legacy ticket authentication was dropped: If the coordinator + logs ModuleNotFoundError on startup, switch the crossbar config to anonymous + authentication (see ``.crossbar/config-anonymous.yaml`` for an example). - The Debian package (``debian/``) no longer contains crossbar. Use the `coordinator container `_ or install it into a separate local venv as desribed in the