mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-09 15:38:08 -05:00
feat: Add AuthRequired to Tool Manifest (#433)
Add `AuthRequired` to Tool Manifest so SDK could throw an error early for unauthorized Tool invocations. SDK changes: https://github.com/googleapis/mcp-toolbox-sdk-python/pull/72/files Also added `authRequired` to Neo4j and dgraph tools.
This commit is contained in:
@@ -316,6 +316,11 @@ func (c *ToolConfigs) UnmarshalYAML(ctx context.Context, unmarshal func(interfac
|
||||
return fmt.Errorf("unable to unmarshal %q: %w", name, err)
|
||||
}
|
||||
|
||||
// Make `authRequired` an empty list instead of nil for Tool manifest
|
||||
if v["authRequired"] == nil {
|
||||
v["authRequired"] = []string{}
|
||||
}
|
||||
|
||||
kind, ok := v["kind"]
|
||||
if !ok {
|
||||
return fmt.Errorf("missing 'kind' field for %q", name)
|
||||
|
||||
Reference in New Issue
Block a user