mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-12 05:02:33 +01:00
PyLinkNCWUtils: remove check_authenticated() (#422)
This commit is contained in:
parent
ed5d46e28a
commit
18f108c328
16
classes.py
16
classes.py
@ -12,7 +12,6 @@ import time
|
||||
import socket
|
||||
import ssl
|
||||
import hashlib
|
||||
import inspect
|
||||
import ipaddress
|
||||
import queue
|
||||
import functools
|
||||
@ -1261,21 +1260,6 @@ class PyLinkNetworkCoreWithUtils(PyLinkNetworkCore):
|
||||
return True
|
||||
return False
|
||||
|
||||
def check_authenticated(self, uid, allowAuthed=True, allowOper=True):
|
||||
"""
|
||||
Checks whether the given user has operator status on PyLink, raising
|
||||
NotAuthorizedError and logging the access denial if not.
|
||||
"""
|
||||
log.warning("(%s) check_authenticated() is deprecated as of PyLink 1.2 and may be "
|
||||
"removed in a future relase. Consider migrating to the PyLink Permissions API.",
|
||||
self.name)
|
||||
lastfunc = inspect.stack()[1][3]
|
||||
if not self.is_oper(uid, allowAuthed=allowAuthed, allowOper=allowOper):
|
||||
log.warning('(%s) Access denied for %s calling %r', self.name,
|
||||
self.get_hostmask(uid), lastfunc)
|
||||
raise utils.NotAuthorizedError("You are not authenticated!")
|
||||
return True
|
||||
|
||||
def match_host(self, glob, target, ip=True, realhost=True):
|
||||
"""
|
||||
Checks whether the given host, or given UID's hostmask matches the given nick!user@host
|
||||
|
Loading…
Reference in New Issue
Block a user