You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Running the code environ.get('username') in the Windows environment will retrieve the default Windows environment username variable ,and it will accidentally replace accessToken in security field with username,which is not what I want
def get_env_variables():
env_variables = {
'host': environ.get('host'),
'port': int(environ.get('port')) if environ.get('port') else None,
'accessToken': environ.get('accessToken'),
'caCert': environ.get('caCert'),
'privateKey': environ.get('privateKey'),
'cert': environ.get('cert'),
'clientId': environ.get('clientId'),
'username': environ.get('username'),
'password': environ.get('password')
}
if environ.get('TB_GW_HOST'):
env_variables['host'] = environ.get('TB_GW_HOST')
if environ.get('TB_GW_PORT'):
env_variables['port'] = int(environ.get('TB_GW_PORT'))
if environ.get('TB_GW_ACCESS_TOKEN'):
env_variables['accessToken'] = environ.get('TB_GW_ACCESS_TOKEN')
if environ.get('TB_GW_CA_CERT'):
env_variables['caCert'] = environ.get('TB_GW_CA_CERT')
if environ.get('TB_GW_PRIVATE_KEY'):
env_variables['privateKey'] = environ.get('TB_GW_PRIVATE_KEY')
if environ.get('TB_GW_CERT'):
env_variables['cert'] = environ.get('TB_GW_CERT')
if environ.get('TB_GW_CLIENT_ID'):
env_variables['clientId'] = environ.get('TB_GW_CLIENT_ID')
if environ.get('TB_GW_USERNAME'):
env_variables['username'] = environ.get('TB_GW_USERNAME')
if environ.get('TB_GW_PASSWORD'):
env_variables['password'] = environ.get('TB_GW_PASSWORD')
if environ.get('TB_GW_RATE_LIMITS'):
env_variables['rateLimits'] = environ.get('TB_GW_RATE_LIMITS')
converted_env_variables = {}
for (key, value) in env_variables.items():
if value is not None:
if key in SECURITY_VAR:
if not converted_env_variables.get('security'):
converted_env_variables['security'] = {}
converted_env_variables['security'][key] = value
else:
converted_env_variables[key] = value
return converted_env_variables
Versions (please complete the following information):
OS: win11
3.5
Python version[e.g. 3.11]
The text was updated successfully, but these errors were encountered:
Describe the bug
Running the code environ.get('username') in the Windows environment will retrieve the default Windows environment username variable ,and it will accidentally replace accessToken in security field with username,which is not what I want
Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: