Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
"""
Get the rest client to send a http request with secured connections
:param endpoint: See select command in this file
:param cert: See select command in this file
:param key: See select command in this file
:param pem: See select command in this file
:param ca: See select command in this file
:param aad: See select command in this file
:param no_verify: See select command in this file
:return: ServiceClient from msrest
"""
if aad:
new_token, new_cache = get_aad_token(endpoint, no_verify)
set_aad_cache(new_token, new_cache)
return ServiceClient(AdalAuthentication(no_verify), Configuration(endpoint))
# If the code reaches here, it is not AAD
return ServiceClient(
_get_client_cert_auth(pem, cert, key, ca, no_verify),
Configuration(endpoint)
)