From 29cbd9d9ce780050f702dffeb04920b38579c82d Mon Sep 17 00:00:00 2001 From: Nimish Date: Fri, 28 Mar 2025 17:59:31 +0530 Subject: [PATCH 1/2] feat: add validation for app_secret in Phase class --- src/phase/utils/phase_io.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/phase/utils/phase_io.py b/src/phase/utils/phase_io.py index ccd5d6e..199e2cf 100644 --- a/src/phase/utils/phase_io.py +++ b/src/phase/utils/phase_io.py @@ -49,6 +49,10 @@ def __init__(self, init=True, pss=None, host=None): app_secret = pss self._api_host = host + # Check if app_secret is None + if app_secret is None: + raise ValueError("Phase token (pss) cannot be None") + # Determine the type of the token (service token or user token) self.is_service_token = pss_service_pattern.match(app_secret) is not None self.is_user_token = pss_user_pattern.match(app_secret) is not None From fea48867e1e948ad4a074bea075f69fc5c657eac Mon Sep 17 00:00:00 2001 From: Nimish <85357445+nimish-ks@users.noreply.github.com> Date: Sun, 6 Apr 2025 15:43:25 +0530 Subject: [PATCH 2/2] Update src/phase/utils/phase_io.py Co-authored-by: Rohan Chaturvedi --- src/phase/utils/phase_io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/phase/utils/phase_io.py b/src/phase/utils/phase_io.py index af3c1e5..12e11ed 100644 --- a/src/phase/utils/phase_io.py +++ b/src/phase/utils/phase_io.py @@ -51,7 +51,7 @@ def __init__(self, init=True, pss=None, host=None): # Check if app_secret is None if app_secret is None: - raise ValueError("Phase token (pss) cannot be None") + raise ValueError("Phase token (pss) is missing") # Determine the type of the token (service token or user token) self.is_service_token = pss_service_pattern.match(app_secret) is not None