# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code
+# TODO: remove racially insensitive terms when this becomes fixed: https://github.com/PyCQA/pylint/issues/3669
extension-pkg-whitelist=rados,rbd,math,cephfs
-# Add files or directories to the blacklist. They should be base names, not
+# Add files or directories to the blocklist. They should be base names, not
# paths.
ignore=CVS
-# Add files or directories matching the regex patterns to the blacklist. The
+# Add files or directories matching the regex patterns to the blocklist. The
# regex matches against base names, not paths.
ignore-patterns=
def logout(self):
logger.debug('Logout successful')
token = JwtManager.get_token_from_header()
- JwtManager.blacklist_token(token)
+ JwtManager.blocklist_token(token)
redirect_url = '#/login'
if mgr.SSO_DB.protocol == 'saml2':
redirect_url = 'auth/saml2/slo'
providedIn: 'root'
})
export class ModuleStatusGuardService implements CanActivate, CanActivateChild {
- // TODO: Hotfix - remove WHITELIST'ing when a generic ErrorComponent is implemented
- static readonly WHITELIST: string[] = ['501'];
+ // TODO: Hotfix - remove ALLOWLIST'ing when a generic ErrorComponent is implemented
+ static readonly ALLOWLIST: string[] = ['501'];
constructor(private http: HttpClient, private router: Router) {}
}
private doCheck(route: ActivatedRouteSnapshot) {
- if (route.url.length > 0 && ModuleStatusGuardService.WHITELIST.includes(route.url[0].path)) {
+ if (route.url.length > 0 && ModuleStatusGuardService.ALLOWLIST.includes(route.url[0].path)) {
return observableOf(true);
}
const config = route.data['moduleStatusGuardConfig'];
class JwtManager(object):
- JWT_TOKEN_BLACKLIST_KEY = "jwt_token_black_list"
+ JWT_TOKEN_BLOCKLIST_KEY = "jwt_token_block_list"
JWT_TOKEN_TTL = 28800 # default 8 hours
JWT_ALGORITHM = 'HS256'
_secret = None
def get_user(cls, token):
try:
dtoken = JwtManager.decode_token(token)
- if not JwtManager.is_blacklisted(dtoken['jti']):
+ if not JwtManager.is_blocklisted(dtoken['jti']):
user = AuthManager.get_user(dtoken['username'])
if user.last_update <= dtoken['iat']:
return user
dtoken['iat'], user.last_update
)
else:
- cls.logger.debug('Token is black-listed') # type: ignore
+ cls.logger.debug('Token is block-listed') # type: ignore
except jwt.ExpiredSignatureError:
cls.logger.debug("Token has expired") # type: ignore
except jwt.InvalidTokenError:
return None
@classmethod
- def blacklist_token(cls, token):
+ def blocklist_token(cls, token):
token = jwt.decode(token, verify=False)
- blacklist_json = mgr.get_store(cls.JWT_TOKEN_BLACKLIST_KEY)
- if not blacklist_json:
- blacklist_json = "{}"
- bl_dict = json.loads(blacklist_json)
+ blocklist_json = mgr.get_store(cls.JWT_TOKEN_BLOCKLIST_KEY)
+ if not blocklist_json:
+ blocklist_json = "{}"
+ bl_dict = json.loads(blocklist_json)
now = time.time()
# remove expired tokens
del bl_dict[jti]
bl_dict[token['jti']] = token['exp']
- mgr.set_store(cls.JWT_TOKEN_BLACKLIST_KEY, json.dumps(bl_dict))
+ mgr.set_store(cls.JWT_TOKEN_BLOCKLIST_KEY, json.dumps(bl_dict))
@classmethod
- def is_blacklisted(cls, jti):
- blacklist_json = mgr.get_store(cls.JWT_TOKEN_BLACKLIST_KEY)
- if not blacklist_json:
- blacklist_json = "{}"
- bl_dict = json.loads(blacklist_json)
+ def is_blocklisted(cls, jti):
+ blocklist_json = mgr.get_store(cls.JWT_TOKEN_BLOCKLIST_KEY)
+ if not blocklist_json:
+ blocklist_json = "{}"
+ bl_dict = json.loads(blocklist_json)
return jti in bl_dict
# -*- coding: utf-8 -*-
-# pylint: disable=blacklisted-name
import time
time.sleep(TaskTest.sleep_time)
@Task('task/foo', ['{param}'])
- @RESTController.Collection('POST')
- def foo(self, param):
+ @RESTController.Collection('POST', path='/foo')
+ def foo_post(self, param):
return {'my_param': param}
@Task('task/bar', ['{key}', '{param}'])
- @RESTController.Resource('PUT')
- def bar(self, key, param=None):
+ @RESTController.Resource('PUT', path='/bar')
+ def bar_put(self, key, param=None):
return {'my_param': param, 'key': key}
@Task('task/query', ['{param}'])
raise cherrypy.NotFound()
-# pylint: disable=blacklisted-name
class Root(object):
- foo = FooResource()
+ foo_resource = FooResource()
fooargs = FooArgs()
{[base]deps}
{[base-test]deps}
{[base-lint]deps}
+# TODO: replace with allowlist_external tox=>16.1 (https://github.com/tox-dev/tox/pull/1601)
whitelist_externals = *
commands = {posargs}