fix(tools/looker): add isAuthorized call to all Looker tools (#1091)

This commit is contained in:
Dr. Strangelove
2025-08-06 16:15:05 +00:00
committed by GitHub
parent 1cac9b5b37
commit 3b1cce72e7
11 changed files with 55 additions and 110 deletions

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}

View File

@@ -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)
}