From ef92234e6575aca212b0d46c9a0ffa29810fc5b3 Mon Sep 17 00:00:00 2001 From: Compunautics <41558985+compunautics@users.noreply.github.com> Date: Sat, 9 Feb 2019 13:50:48 -0600 Subject: [PATCH] Allow user lookup by apikey This plugin breaks the GCode Viewer as is. When using this plugin and accessing the GCode Viewer, one gets this error in the log: TypeError: findUser() got an unexpected keyword argument 'apikey' This commit ensures that the findUser function knows how to handle the 'apikey' parameter from ~/octoprint/server/util/__init__.py if submitted. --- octoprint_auth_ldap/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/octoprint_auth_ldap/__init__.py b/octoprint_auth_ldap/__init__.py index 7f6db02..3f434df 100644 --- a/octoprint_auth_ldap/__init__.py +++ b/octoprint_auth_ldap/__init__.py @@ -50,8 +50,8 @@ class LDAPUserManager(FilebasedUserManager, if FilebasedUserManager.findUser(self, username) is not None: return FilebasedUserManager.changeUserPassword(self, username, password) - def findUser(self, userid=None, session=None): - local_user = FilebasedUserManager.findUser(self, userid, session) + def findUser(self, userid=None, apikey=None, session=None): + local_user = FilebasedUserManager.findUser(self, userid, apikey, session) #If user not exists in local database, search it on LDAP if userid and not local_user: if(self.findLDAPUser(userid)):