2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-25 11:01:09 +00:00

Allow custom auth file to define valid roles

This commit is contained in:
Jarrod Johnson 2023-07-26 16:37:55 -04:00
parent ad25c31d3f
commit 987587aaf8
2 changed files with 4 additions and 1 deletions

View File

@ -125,6 +125,9 @@ def add_roles(_allowed,_denied):
loaded_file = yaml.safe_load(stream)
try:
allowed_loaded = loaded_file["allowedbyrole"]
for role in allowed_loaded:
if role not in configmanager._validroles:
configmanager._validroles.append(role)
except:
pass
try:

View File

@ -127,7 +127,7 @@ _attraliases = {
'bmcpass': 'secret.hardwaremanagementpassword',
'switchpass': 'secret.hardwaremanagementpassword',
}
_validroles = ('Administrator', 'Operator', 'Monitor', 'Stub')
_validroles = ['Administrator', 'Operator', 'Monitor', 'Stub']
membership_callback = None