From 5138aa78f6257fb4f308de5624eaf280c0009035 Mon Sep 17 00:00:00 2001 From: blaise-muhirwa Date: Wed, 18 Oct 2023 21:34:21 -0700 Subject: [PATCH] addressing more feedback --- src/groundlight/client.py | 9 +++++---- src/groundlight/config.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/groundlight/client.py b/src/groundlight/client.py index f590f936..a3c4e31e 100644 --- a/src/groundlight/client.py +++ b/src/groundlight/client.py @@ -84,7 +84,7 @@ def __init__( :param disable_tls_verification: Set this to `True` to skip verifying SSL/TLS certificates when calling API from https server. If unset, the fallback will check - the environment variable "TLS_VERIFY" for `1` or `0`. By default, + the environment variable "DISABLE_TLS_VERIFY" for `1` or `0`. By default, certificates are verified. Disable verification if using a self-signed TLS certificate with a Groundlight @@ -112,9 +112,10 @@ def __init__( ), ) from e - should_disable_tls_verification = disable_tls_verification or bool( - int(os.environ.get(DISABLE_TLS_VARIABLE_NAME, 0)) - ) + should_disable_tls_verification = disable_tls_verification + + if should_disable_tls_verification is None: + should_disable_tls_verification = bool(int(os.environ.get(DISABLE_TLS_VARIABLE_NAME, 0))) if should_disable_tls_verification: logger.warning( diff --git a/src/groundlight/config.py b/src/groundlight/config.py index b52bfd22..c0440a67 100644 --- a/src/groundlight/config.py +++ b/src/groundlight/config.py @@ -2,7 +2,7 @@ API_TOKEN_VARIABLE_NAME = "GROUNDLIGHT_API_TOKEN" DEFAULT_ENDPOINT = "https://api.groundlight.ai/" -DISABLE_TLS_VARIABLE_NAME = "TLS_VERIFY" +DISABLE_TLS_VARIABLE_NAME = "DISABLE_TLS_VERIFY" __all__ = ["API_TOKEN_WEB_URL", "API_TOKEN_VARIABLE_NAME", "DEFAULT_ENDPOINT", "DISABLE_TLS_VARIABLE_NAME"]