From d928b8ef34f115b2213088a89266eb9136ebc105 Mon Sep 17 00:00:00 2001 From: Mariusz Sabath Date: Wed, 1 Oct 2025 13:52:24 -0400 Subject: [PATCH 1/3] Read CLIENT_SECRET from a local file instead of Env. variable Signed-off-by: Mariusz Sabath --- a2a/slack_researcher/slack_researcher/config.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/a2a/slack_researcher/slack_researcher/config.py b/a2a/slack_researcher/slack_researcher/config.py index f2f562e1..17206798 100644 --- a/a2a/slack_researcher/slack_researcher/config.py +++ b/a2a/slack_researcher/slack_researcher/config.py @@ -9,6 +9,9 @@ class Settings(BaseSettings): + # static path for client secret file + secret_file_path: str = "/shared/secret.txt" + LOG_LEVEL: Literal['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL'] = Field( os.getenv("LOG_LEVEL", "DEBUG"), description="Application log level", @@ -60,7 +63,7 @@ class Settings(BaseSettings): description="Client ID to authenticate to OAuth server" ) CLIENT_SECRET: Optional[str] = Field( - os.getenv("CLIENT_SECRET", None), + None, description="Client secret to authenticate to OAuth server" ) TARGET_AUDIENCE: Optional[str] = Field( @@ -84,6 +87,15 @@ def validate_extra_headers(self) -> "Settings": except json.JSONDecodeError: raise ValueError("EXTRA_HEADERS must be a valid JSON string") + # --- Load CLIENT_SECRET from file --- + try: + with open(self.secret_file_path, "r") as f: + self.CLIENT_SECRET = f.read().strip() + except FileNotFoundError: + logging.warning("CLIENT_SECRET file not found at {self.secret_file_path}") + except Exception as e: + logging.error(f"Error reading CLIENT_SECRET: {e}") + return self settings = Settings() # type: ignore[call-arg] From 2a7f6928940f6e61493f47482055bdf5912f296c Mon Sep 17 00:00:00 2001 From: Mariusz Sabath Date: Mon, 6 Oct 2025 10:48:07 -0400 Subject: [PATCH 2/3] Update a2a/slack_researcher/slack_researcher/config.py Co-authored-by: Maia Iyer Signed-off-by: Mariusz Sabath --- a2a/slack_researcher/slack_researcher/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a2a/slack_researcher/slack_researcher/config.py b/a2a/slack_researcher/slack_researcher/config.py index 17206798..8959bcb5 100644 --- a/a2a/slack_researcher/slack_researcher/config.py +++ b/a2a/slack_researcher/slack_researcher/config.py @@ -94,7 +94,7 @@ def validate_extra_headers(self) -> "Settings": except FileNotFoundError: logging.warning("CLIENT_SECRET file not found at {self.secret_file_path}") except Exception as e: - logging.error(f"Error reading CLIENT_SECRET: {e}") + logging.error(f"Error reading CLIENT_SECRET file: {e}") return self From b8185e3a9c76e89cba141e841cb2185abc2f2df7 Mon Sep 17 00:00:00 2001 From: Mariusz Sabath Date: Mon, 6 Oct 2025 12:10:29 -0400 Subject: [PATCH 3/3] Update a2a/slack_researcher/slack_researcher/config.py Co-authored-by: Alan Cha < ac3805@columbia.edu> Co-authored-by: Alan Cha Signed-off-by: Mariusz Sabath --- a2a/slack_researcher/slack_researcher/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/a2a/slack_researcher/slack_researcher/config.py b/a2a/slack_researcher/slack_researcher/config.py index 8959bcb5..397bf991 100644 --- a/a2a/slack_researcher/slack_researcher/config.py +++ b/a2a/slack_researcher/slack_researcher/config.py @@ -92,7 +92,7 @@ def validate_extra_headers(self) -> "Settings": with open(self.secret_file_path, "r") as f: self.CLIENT_SECRET = f.read().strip() except FileNotFoundError: - logging.warning("CLIENT_SECRET file not found at {self.secret_file_path}") + logging.warning(f"CLIENT_SECRET file not found at {self.secret_file_path}") except Exception as e: logging.error(f"Error reading CLIENT_SECRET file: {e}")