def authenticate(uid, passwd):
aafUser = None
username = CONF.conductor_api.username
- password = cipherUtils.AESCipher.get_instance().decrypt(CONF.conductor_api.password)
+ password = CONF.conductor_api.password
if username == uid and password == passwd:
aafUser = CONF.aaf_api.aaf_conductor_user
else:
userType = userPerm["type"]
userInstance = userPerm["instance"]
userAction = userPerm["action"]
- if userType == permType and userInstance == permInstance and \
- (userAction == permAction or userAction == "*"):
+ if userType == permType and (userInstance == permInstance or permInstance == "*") and \
+ (userAction == permAction or permAction == "*"):
# FS - trace
LOG.info("User has valid permissions ")
return True
Return the perms
"""
def get_aaf_permissions(aafUser):
- key = base64.b64encode("{}".format(aafUser), "ascii")
+ key = base64.b64encode("{}".format(aafUser).encode())
time_delta = timedelta(hours = CONF.aaf_api.aaf_cache_expiry_hrs)
perms = perm_cache.get(key)
"server_url": server_url,
"retries": CONF.aaf_api.aaf_retries,
"username": CONF.aaf_api.username,
- "password": cipherUtils.AESCipher.get_instance().decrypt(CONF.aaf_api.password),
+ "password": CONF.aaf_api.password,
"log_debug": LOG.debug,
"read_timeout": CONF.aaf_api.aaf_timeout,
"cert_file": CONF.aaf_api.aaf_cert_file,
plan = False
auth_str = pecan.request.headers['Authorization']
user_pw = auth_str.split(' ')[1]
- decode_user_pw = base64.b64decode(user_pw)
+ decode_user_pw = base64.b64decode(user_pw.encode()).decode()
list_id_pw = decode_user_pw.split(':')
LOG.error("Incorrect username={} / password={}".format(list_id_pw[0], list_id_pw[1]))
except:
}
self.rest = rest.REST(**kwargs)
- music_pwd = cipherUtils.AESCipher.get_instance().decrypt(CONF.music_api.aafpass)
+ music_pwd = CONF.music_api.aafpass
# Set one parameter for connection mode
# Currently depend on music version
if CONF.music_api.enable_https_mode:
config = CONF
secret_dict = retrieve_secrets()
config.set_override('username', secret_dict['aai']['username'], 'aai')
- config.set_override('password', secret_dict['aai']['password'], 'aai')
+ config.set_override('password', decrypt_pass(secret_dict['aai']['password']), 'aai')
config.set_override('username', secret_dict['conductor_api']['username'], 'conductor_api')
config.set_override('password', decrypt_pass(secret_dict['conductor_api']['password']), 'conductor_api')
config.set_override('aafuser', secret_dict['music_api']['aafuser'], 'music_api')
- config.set_override('aafpass', secret_dict['music_api']['aafpass'], 'music_api')
+ config.set_override('aafpass', decrypt_pass(secret_dict['music_api']['aafpass']), 'music_api')
config.set_override('aafns', secret_dict['music_api']['aafns'], 'music_api')
config.set_override('username', secret_dict['sdnc']['username'], 'sdnc')
- config.set_override('password', secret_dict['sdnc']['password'], 'sdnc')
+ config.set_override('password', decrypt_pass(secret_dict['sdnc']['password']), 'sdnc')
config.set_override('username', secret_dict['aaf_api']['username'], 'aaf_api')
- config.set_override('password', secret_dict['aaf_api']['password'], 'aaf_api')
+ config.set_override('password', decrypt_pass(secret_dict['aaf_api']['password']), 'aaf_api')
config.set_override('aaf_conductor_user', secret_dict['aaf_api']['aaf_conductor_user'], 'aaf_api')
self.timeout = self.conf.aai.aai_rest_timeout
self.retries = self.conf.aai.aai_retries
self.username = self.conf.aai.username
- self.password = cipherUtils.AESCipher.get_instance().decrypt(self.conf.aai.password)
+ self.password = self.conf.aai.password
self.triage_translator=TraigeTranslator()
# Cache is initially empty
self.conf = CONF
self.base = self.conf.sdnc.server_url.rstrip('/')
- self.password = cipherUtils.AESCipher.get_instance().decrypt(self.conf.sdnc.password)
+ self.password = self.conf.sdnc.password
self.timeout = self.conf.sdnc.sdnc_rest_timeout
self.verify = False
self.retries = self.conf.sdnc.sdnc_retries