Skip to content

Commit

Permalink
PEP8: userManager -> user_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
brubbel authored and oroulet committed Nov 27, 2018
1 parent 53048e3 commit 5ccf372
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions opcua/server/internal_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def __init__(self, shelffile=None, parent=None):
self.setup_nodes()

@property
def userManager(self):
return self._parent.userManager
def user_manager(self):
return self._parent.user_manager

def setup_nodes(self):
"""
Expand Down Expand Up @@ -297,8 +297,8 @@ def __init__(self, internal_server, aspace, submgr, name, user=UserManager.User.
self._lock = Lock()

@property
def userManager(self):
return self.iserver.userManager
def user_manager(self):
return self.iserver.user_manager

def __str__(self):
return "InternalSession(name:{0}, user:{1}, id:{2}, auth_token:{3})".format(
Expand Down Expand Up @@ -338,7 +338,7 @@ def activate_session(self, params):
self.state = SessionState.Activated
id_token = params.UserIdentityToken
if isinstance(id_token, ua.UserNameIdentityToken):
if self.userManager.check_user_token(self, id_token) == False:
if self.user_manager.check_user_token(self, id_token) == False:
raise utils.ServiceError(ua.StatusCodes.BadUserAccessDenied)
self.logger.info("Activated internal session %s for user %s", self.name, self.user)
return result
Expand Down
4 changes: 2 additions & 2 deletions opcua/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def __init__(self, shelffile=None, iserver=None):
# enable all endpoints by default
self.certificate = None
self.private_key = None
self.userManager = UserManager(parent = self)
self.user_manager = UserManager(parent = self)
self._security_policy = [
ua.SecurityPolicyType.NoSecurity,
ua.SecurityPolicyType.Basic256Sha256_SignAndEncrypt,
Expand Down Expand Up @@ -207,7 +207,7 @@ def allow_remote_admin(self, allow):
"""
Enable or disable the builtin Admin user from network clients
"""
self.userManager.allow_remote_admin = allow
self.user_manager.allow_remote_admin = allow

def set_endpoint(self, url):
self.endpoint = urlparse(url)
Expand Down
4 changes: 2 additions & 2 deletions opcua/server/user_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def __init__(self, parent):
def private_key(self):
return self._parent.private_key

def default_user_manager(self, userManager, isession, userName, password):
def default_user_manager(self, isession, userName, password):
"""
Default user_manager, does nothing much but check for admin
"""
Expand Down Expand Up @@ -74,4 +74,4 @@ def check_user_token(self, isession, token):
return False

# call user_manager
return self.user_manager(self, isession, userName, passwd)
return self.user_manager(isession, userName, passwd)

0 comments on commit 5ccf372

Please sign in to comment.