Skip to content

Commit 9010538

Browse files
committed
363_edit_server_res
Signed-off-by: RAKHI DUTTA <[email protected]>
1 parent cf7c7c2 commit 9010538

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

mcpgateway/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
from mcpgateway.services.prompt_service import PromptNotFoundError, PromptService
6363
from mcpgateway.services.resource_service import ResourceNotFoundError, ResourceService
6464
from mcpgateway.services.root_service import RootService
65-
from mcpgateway.services.server_service import ServerError, ServerNotFoundError, ServerService, ServerNameConflictError
65+
from mcpgateway.services.server_service import ServerError, ServerNameConflictError, ServerNotFoundError, ServerService
6666
from mcpgateway.services.tool_service import ToolError, ToolNotFoundError, ToolService
6767
from mcpgateway.utils.create_jwt_token import get_jwt_token
6868
from mcpgateway.utils.error_formatter import ErrorFormatter

mcpgateway/main.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -896,7 +896,7 @@ async def update_server(
896896
raise HTTPException(status_code=422, detail=ErrorFormatter.format_validation_error(e))
897897
except IntegrityError as e:
898898
logger.error(f"Integrity error while updating server {server_id}: {e}")
899-
raise HTTPException(status_code=409, detail=ErrorFormatter.format_database_error(e))
899+
raise HTTPException(status_code=409, detail=ErrorFormatter.format_database_error(e))
900900

901901

902902
@server_router.post("/{server_id}/toggle", response_model=ServerRead)
@@ -1435,8 +1435,10 @@ async def create_resource(
14351435
raise HTTPException(status_code=422, detail=ErrorFormatter.format_validation_error(e))
14361436
except IntegrityError as e:
14371437
logger.error(f"Integrity error while creating resource: {e}")
1438-
raise HTTPException(status_code=409, detail=ErrorFormatter.format_database_error(e))
1439-
@resource_router.get("/{uri:path}")
1438+
raise HTTPException(status_code=409, detail=ErrorFormatter.format_database_error(e))
1439+
1440+
1441+
@resource_router.get("/{uri:path}")
14401442
async def read_resource(uri: str, db: Session = Depends(get_db), user: str = Depends(require_auth)) -> ResourceContent:
14411443
"""
14421444
Read a resource by its URI.

mcpgateway/services/server_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ async def update_server(self, db: Session, server_id: str, server_update: Server
506506
except ServerNameConflictError as snce:
507507
db.rollback()
508508
logger.error(f"Server name conflict: {snce}")
509-
raise snce
509+
raise snce
510510
except Exception as e:
511511
db.rollback()
512512
raise ServerError(f"Failed to update server: {str(e)}")

mcpgateway/utils/verify_credentials.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ async def require_docs_basic_auth(auth_header: str) -> str:
471471
"""
472472
scheme, param = get_authorization_scheme_param(auth_header)
473473
if scheme.lower() == "basic" and param and settings.docs_allow_basic_auth:
474-
475474
try:
476475
data = b64decode(param).decode("ascii")
477476
username, separator, password = data.partition(":")

0 commit comments

Comments
 (0)