fix(security): redact integration secrets from viewer-accessible endpoints

Prevent low-privileged tenant members from reading raw API keys and
infrastructure credentials via tenant profile, KV config, model/MCP/web
search listings, and KB initialization config responses.
This commit is contained in:
wizardchen
2026-07-02 12:31:57 +08:00
committed by lyingbug
parent 8325dac738
commit 0b73080bb8
18 changed files with 649 additions and 61 deletions
+4 -4
View File
@@ -85,7 +85,7 @@ func (h *MCPServiceHandler) CreateMCPService(c *gin.Context) {
// construction — no runtime redaction needed.
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": dto.NewMCPServiceResponse(&service),
"data": dto.NewMCPServiceResponse(ctx,&service),
})
}
@@ -119,7 +119,7 @@ func (h *MCPServiceHandler) ListMCPServices(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": dto.NewMCPServiceResponses(services),
"data": dto.NewMCPServiceResponses(ctx, services),
})
}
@@ -158,7 +158,7 @@ func (h *MCPServiceHandler) GetMCPService(c *gin.Context) {
// so the cross-tenant builtin list does not leak per-tenant config.
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": dto.NewMCPServiceResponse(service),
"data": dto.NewMCPServiceResponse(ctx,service),
})
}
@@ -351,7 +351,7 @@ func (h *MCPServiceHandler) UpdateMCPService(c *gin.Context) {
}
c.JSON(http.StatusOK, gin.H{
"success": true,
"data": dto.NewMCPServiceResponse(stored),
"data": dto.NewMCPServiceResponse(ctx,stored),
})
}