mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-04-09 03:02:26 -04:00
fix cloud sql test
This commit is contained in:
@@ -278,8 +278,9 @@ func toolInvokeHandler(s *Server, w http.ResponseWriter, r *http.Request) {
|
||||
case util.CategoryAgent:
|
||||
// Agent Errors -> 200 OK
|
||||
s.logger.DebugContext(ctx, fmt.Sprintf("Tool invocation agent error: %v", err))
|
||||
_ = render.Render(w, r, newErrResponse(err, http.StatusOK))
|
||||
return
|
||||
res = map[string]string{
|
||||
"error": err.Error(),
|
||||
}
|
||||
|
||||
case util.CategoryServer:
|
||||
// Server Errors -> Check the specific code inside
|
||||
|
||||
@@ -144,6 +144,10 @@ func (t Tool) Invoke(ctx context.Context, resourceMgr tools.SourceProvider, para
|
||||
|
||||
iamUser, _ := paramsMap["iamUser"].(bool)
|
||||
password, _ := paramsMap["password"].(string)
|
||||
if !iamUser && password == "" {
|
||||
return nil, util.NewAgentError("missing 'password' parameter for non-IAM user", nil)
|
||||
}
|
||||
|
||||
resp, err := source.CreateUsers(ctx, project, instance, name, password, iamUser, string(accessToken))
|
||||
if err != nil {
|
||||
return nil, util.ProcessGcpError(err)
|
||||
|
||||
Reference in New Issue
Block a user