mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-09 15:38:08 -05:00
fix(tools/looker): add isAuthorized call to all Looker tools (#1091)
This commit is contained in:
@@ -45,13 +45,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -161,7 +158,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -44,13 +44,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -164,7 +161,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -45,13 +45,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -161,7 +158,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -44,13 +44,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -187,7 +184,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -45,13 +45,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -161,7 +158,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -44,13 +44,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -161,7 +158,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -45,13 +45,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -161,7 +158,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -46,13 +46,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -158,7 +155,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -45,13 +45,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -149,7 +146,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -45,13 +45,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -162,7 +159,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
@@ -45,13 +45,10 @@ func newConfig(ctx context.Context, name string, decoder *yaml.Decoder) (tools.T
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
// AuthRequired specifies the authentication services required for this tool.
|
||||
// Currently, this field is not actively used for authorization checks within the tool itself,
|
||||
// as the Authorized method always returns true. It is included for potential future extensibility.
|
||||
Name string `yaml:"name" validate:"required"`
|
||||
Kind string `yaml:"kind" validate:"required"`
|
||||
Source string `yaml:"source" validate:"required"`
|
||||
Description string `yaml:"description" validate:"required"`
|
||||
AuthRequired []string `yaml:"authRequired"`
|
||||
}
|
||||
|
||||
@@ -166,7 +163,5 @@ func (t Tool) McpManifest() tools.McpManifest {
|
||||
}
|
||||
|
||||
func (t Tool) Authorized(verifiedAuthServices []string) bool {
|
||||
// Currently, all Looker tools are considered authorized if the source is correctly configured.
|
||||
// The AuthRequired field in the Config struct is reserved for future, more granular authorization.
|
||||
return true
|
||||
return tools.IsAuthorized(t.AuthRequired, verifiedAuthServices)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user