From 698718aa8d2f8767914af840eeb434e310870de4 Mon Sep 17 00:00:00 2001 From: pablohashescobar <118773738+pablohashescobar@users.noreply.github.com> Date: Wed, 22 Mar 2023 01:33:06 +0530 Subject: [PATCH] chore: rename analytics env variable keys (#455) --- apiserver/plane/api/views/authentication.py | 24 ++++++++++----------- apiserver/plane/api/views/oauth.py | 12 +++++------ apiserver/plane/settings/local.py | 4 ++-- apiserver/plane/settings/production.py | 4 ++-- apiserver/plane/settings/staging.py | 4 ++-- 5 files changed, 24 insertions(+), 24 deletions(-) diff --git a/apiserver/plane/api/views/authentication.py b/apiserver/plane/api/views/authentication.py index d6a9cdac3..f5ec8aa08 100644 --- a/apiserver/plane/api/views/authentication.py +++ b/apiserver/plane/api/views/authentication.py @@ -87,12 +87,12 @@ class SignInEndpoint(BaseAPIView): } # Send event to Jitsu for tracking - if settings.JITSU_BASE_API: + if settings.ANALYTICS_BASE_API: _ = requests.post( - settings.JITSU_BASE_API, + settings.ANALYTICS_BASE_API, headers={ "Content-Type": "application/json", - "X-Auth-Token": settings.JITSU_SECRET_KEY, + "X-Auth-Token": settings.ANALYTICS_SECRET_KEY, }, json={ "event_id": uuid.uuid4().hex, @@ -138,12 +138,12 @@ class SignInEndpoint(BaseAPIView): access_token, refresh_token = get_tokens_for_user(user) # Send event to Jitsu for tracking - if settings.JITSU_BASE_API: + if settings.ANALYTICS_BASE_API: _ = requests.post( - settings.JITSU_BASE_API, + settings.ANALYTICS_BASE_API, headers={ "Content-Type": "application/json", - "X-Auth-Token": settings.JITSU_SECRET_KEY, + "X-Auth-Token": settings.ANALYTICS_SECRET_KEY, }, json={ "event_id": uuid.uuid4().hex, @@ -312,12 +312,12 @@ class MagicSignInEndpoint(BaseAPIView): if User.objects.filter(email=email).exists(): user = User.objects.get(email=email) # Send event to Jitsu for tracking - if settings.JITSU_BASE_API: + if settings.ANALYTICS_BASE_API: _ = requests.post( - settings.JITSU_BASE_API, + settings.ANALYTICS_BASE_API, headers={ "Content-Type": "application/json", - "X-Auth-Token": settings.JITSU_SECRET_KEY, + "X-Auth-Token": settings.ANALYTICS_SECRET_KEY, }, json={ "event_id": uuid.uuid4().hex, @@ -342,12 +342,12 @@ class MagicSignInEndpoint(BaseAPIView): is_password_autoset=True, ) # Send event to Jitsu for tracking - if settings.JITSU_BASE_API: + if settings.ANALYTICS_BASE_API: _ = requests.post( - settings.JITSU_BASE_API, + settings.ANALYTICS_BASE_API, headers={ "Content-Type": "application/json", - "X-Auth-Token": settings.JITSU_SECRET_KEY, + "X-Auth-Token": settings.ANALYTICS_SECRET_KEY, }, json={ "event_id": uuid.uuid4().hex, diff --git a/apiserver/plane/api/views/oauth.py b/apiserver/plane/api/views/oauth.py index 1c35b5989..13bf15e4d 100644 --- a/apiserver/plane/api/views/oauth.py +++ b/apiserver/plane/api/views/oauth.py @@ -205,12 +205,12 @@ class OauthEndpoint(BaseAPIView): "last_login_at": timezone.now(), }, ) - if settings.JITSU_BASE_API: + if settings.ANALYTICS_BASE_API: _ = requests.post( - settings.JITSU_BASE_API, + settings.ANALYTICS_BASE_API, headers={ "Content-Type": "application/json", - "X-Auth-Token": settings.JITSU_SECRET_KEY, + "X-Auth-Token": settings.ANALYTICS_SECRET_KEY, }, json={ "event_id": uuid.uuid4().hex, @@ -273,12 +273,12 @@ class OauthEndpoint(BaseAPIView): "user": serialized_user, "permissions": [], } - if settings.JITSU_BASE_API: + if settings.ANALYTICS_BASE_API: _ = requests.post( - settings.JITSU_BASE_API, + settings.ANALYTICS_BASE_API, headers={ "Content-Type": "application/json", - "X-Auth-Token": settings.JITSU_SECRET_KEY, + "X-Auth-Token": settings.ANALYTICS_SECRET_KEY, }, json={ "event_id": uuid.uuid4().hex, diff --git a/apiserver/plane/settings/local.py b/apiserver/plane/settings/local.py index 9ec5aee85..f8839bdb4 100644 --- a/apiserver/plane/settings/local.py +++ b/apiserver/plane/settings/local.py @@ -79,5 +79,5 @@ if DOCKERIZED: WEB_URL = os.environ.get("WEB_URL", "localhost:3000") PROXY_BASE_URL = os.environ.get("PROXY_BASE_URL", False) -JITSU_SECRET_KEY = os.environ.get("JITSU_SECRET_KEY", False) -JITSU_BASE_API = os.environ.get("JITSU_BASE_API", False) +ANALYTICS_SECRET_KEY = os.environ.get("ANALYTICS_SECRET_KEY", False) +ANALYTICS_BASE_API = os.environ.get("ANALYTICS_BASE_API", False) diff --git a/apiserver/plane/settings/production.py b/apiserver/plane/settings/production.py index 93d5eca14..31b5bba89 100644 --- a/apiserver/plane/settings/production.py +++ b/apiserver/plane/settings/production.py @@ -227,5 +227,5 @@ WEB_URL = os.environ.get("WEB_URL") PROXY_BASE_URL = os.environ.get("PROXY_BASE_URL", False) -JITSU_SECRET_KEY = os.environ.get("JITSU_SECRET_KEY", False) -JITSU_BASE_API = os.environ.get("JITSU_BASE_API", False) +ANALYTICS_SECRET_KEY = os.environ.get("ANALYTICS_SECRET_KEY", False) +ANALYTICS_BASE_API = os.environ.get("ANALYTICS_BASE_API", False) diff --git a/apiserver/plane/settings/staging.py b/apiserver/plane/settings/staging.py index e5d26f652..55c50bc6e 100644 --- a/apiserver/plane/settings/staging.py +++ b/apiserver/plane/settings/staging.py @@ -188,5 +188,5 @@ WEB_URL = os.environ.get("WEB_URL") PROXY_BASE_URL = os.environ.get("PROXY_BASE_URL", False) -JITSU_SECRET_KEY = os.environ.get("JITSU_SECRET_KEY", False) -JITSU_BASE_API = os.environ.get("JITSU_BASE_API", False) +ANALYTICS_SECRET_KEY = os.environ.get("ANALYTICS_SECRET_KEY", False) +ANALYTICS_BASE_API = os.environ.get("ANALYTICS_BASE_API", False)