Skip to content

Commit bb59e47

Browse files
rakduttarakdutta1
andauthored
pydantic error fix (#633)
Signed-off-by: RAKHI DUTTA <[email protected]> Co-authored-by: RAKHI DUTTA <[email protected]>
1 parent a5e04a7 commit bb59e47

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mcpgateway/schemas.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1882,13 +1882,12 @@ def _process_auth_fields(values: Dict[str, Any]) -> Optional[Dict[str, Any]]:
18821882
Raises:
18831883
ValueError: If auth type is invalid
18841884
"""
1885-
auth_type = values.get("auth_type")
1885+
auth_type = values.data.get("auth_type")
18861886

18871887
if auth_type == "basic":
18881888
# For basic authentication, both username and password must be present
1889-
username = values.get("auth_username")
1890-
password = values.get("auth_password")
1891-
1889+
username = values.data.get("auth_username")
1890+
password = values.data.get("auth_password")
18921891
if not username or not password:
18931892
raise ValueError("For 'basic' auth, both 'auth_username' and 'auth_password' must be provided.")
18941893

@@ -1897,7 +1896,7 @@ def _process_auth_fields(values: Dict[str, Any]) -> Optional[Dict[str, Any]]:
18971896

18981897
if auth_type == "bearer":
18991898
# For bearer authentication, only token is required
1900-
token = values.get("auth_token")
1899+
token = values.data.get("auth_token")
19011900

19021901
if not token:
19031902
raise ValueError("For 'bearer' auth, 'auth_token' must be provided.")
@@ -1906,8 +1905,8 @@ def _process_auth_fields(values: Dict[str, Any]) -> Optional[Dict[str, Any]]:
19061905

19071906
if auth_type == "authheaders":
19081907
# For headers authentication, both key and value must be present
1909-
header_key = values.get("auth_header_key")
1910-
header_value = values.get("auth_header_value")
1908+
header_key = values.data.get("auth_header_key")
1909+
header_value = values.data.get("auth_header_value")
19111910

19121911
if not header_key or not header_value:
19131912
raise ValueError("For 'headers' auth, both 'auth_header_key' and 'auth_header_value' must be provided.")

0 commit comments

Comments
 (0)