From 4043dedeea6301c37b4ee75f9c1babac8b65740e Mon Sep 17 00:00:00 2001 From: asimurka Date: Mon, 15 Dec 2025 17:21:20 +0100 Subject: [PATCH] fix: correctly unwrap provider data api_key from secret string (#4380) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # What does this PR do? Fix provider header API key handling by correctly unwrapping `SecretStr` values for provider data API keys. Previously the validator cast header keys to `SecretStr` but the value wasn’t unwrapped before use, causing authentication failures with providers like Azure. Closes https://github.com/llamastack/llama-stack/issues/4370 --- src/llama_stack/providers/remote/inference/azure/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llama_stack/providers/remote/inference/azure/config.py b/src/llama_stack/providers/remote/inference/azure/config.py index f6407a183..8f78f9288 100644 --- a/src/llama_stack/providers/remote/inference/azure/config.py +++ b/src/llama_stack/providers/remote/inference/azure/config.py @@ -7,14 +7,14 @@ import os from typing import Any -from pydantic import BaseModel, Field, HttpUrl, SecretStr +from pydantic import BaseModel, Field, HttpUrl from llama_stack.providers.utils.inference.model_registry import RemoteInferenceProviderConfig from llama_stack_api import json_schema_type class AzureProviderDataValidator(BaseModel): - azure_api_key: SecretStr = Field( + azure_api_key: str = Field( description="Azure API key for Azure", ) azure_api_base: HttpUrl = Field(