diff --git a/.gitignore b/.gitignore index 00b41c6..ed3c998 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ +.claude/ bin/ .DS_Store diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..7c3a823 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,110 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Trend Vision One MCP Server - A Go-based Model Context Protocol (MCP) server that bridges AI tooling (Claude, VSCode + GitHub Copilot) with Trend Vision One security platform APIs. Enables natural language interaction with security services like Workbench alerts, Cloud Posture, endpoint management, attack surface discovery, and AI security guardrails. + +## Build & Test Commands + +```bash +# Build +make mcpserver # Build to ./bin/v1-mcp-server +go build -o ./bin/v1-mcp-server ./cmd/v1-mcp-server/main.go + +# Test +go test -v ./... # Run all tests + +# Lint & Format +./script/check-gofmt # Check formatting +./script/lint # Run golangci-lint +gofmt -s -w ./ # Auto-format code + +# Run locally +./bin/v1-mcp-server -region us # Requires TREND_VISION_ONE_API_KEY env var +``` + +## Architecture + +``` +cmd/v1-mcp-server/main.go # Entry point, CLI flags, region validation +internal/v1mcp/server.go # MCP server setup, tool registration +internal/v1mcp/tools/*.go # Tool handlers (one file per domain) +internal/v1client/*.go # HTTP client, API endpoint methods +``` + +**Request Flow:** MCP Request → Tool Handler → Parameter Extraction → v1client API call → HTTP → Response → MCP Result + +## Key Conventions + +### Tool Implementation Pattern +Each tool is a factory function returning `mcpserver.ServerTool`: +```go +func toolDomainResourceAction(client *v1client.V1ApiClient) mcpserver.ServerTool { + return mcpserver.ServerTool{ + Tool: mcp.NewTool("domain_resource_action", + mcp.WithDescription("..."), + mcp.WithString("param", mcp.Description("...")), + mcp.WithToolAnnotation(mcp.ToolAnnotation{ReadOnlyHint: toPtr(true)}), + ), + Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { + // Extract parameters, call API, return result + }, + } +} +``` + +### Read-Only vs Write Tools +- Tools must be annotated with `ReadOnlyHint: toPtr(true/false)` +- Server validates annotations match toolset registration (panics on mismatch) +- Add read tools to `ToolsetsReadOnly{Domain}`, write tools to `ToolsetsWrite{Domain}` in respective `tools/*.go` files +- Register toolsets in `server.go` + +### API Paths +Paths must NOT start with `/`. The client's `Parse` method handles URL joining: +```go +// Correct +c.searchAndFilter("v3.0/iam/apiKeys", filter, params) +// Wrong +c.searchAndFilter("/v3.0/iam/apiKeys", filter, params) +``` + +### Parameter Helpers (tools/tools.go) +```go +requiredValue[T](property string, vals map[string]any) (T, error) +optionalValue[T](property string, vals map[string]any) (T, error) +optionalIntValue(property string, vals map[string]any) (int, error) +optionalTimeValue(property string, vals map[string]any) (time.Time, error) +handleStatusResponse(r *http.Response, err error, expectedStatusCode int, msg string) (*mcp.CallToolResult, error) +``` + +### Request Options (v1client/v1client.go) +```go +withHeader(name, value string) requestOptionFunc // Add custom headers to requests +``` +Used by domains requiring custom headers (e.g., AI Security uses `TMV1-Application-Name`, `TMV1-Request-Type`, `Prefer`). + +### Tool Naming Convention +`{domain}_{resource}_{action}` - e.g., `iam_api_keys_list`, `workbench_alert_detail_get` + +## Domain Organization + +| Domain | Client File | Tools File | API Prefix | +|--------|-------------|------------|------------| +| AI Security | `v1client/aisecurity.go` | `tools/aisecurity.go` | `v3.0/aiSecurity/` | +| IAM | `v1client/iam.go` | `tools/iam.go` | `v3.0/iam/` | +| Workbench | `v1client/workbench.go` | `tools/workbench.go` | `v3.0/workbench/` | +| OAT | `v1client/oat.go` | `tools/workbench.go` | `v3.0/oat/` | +| Cloud Posture | `v1client/cloudposture.go` | `tools/cloudposture.go` | `v3.0/asrm/` | +| CREM | `v1client/crem.go` | `tools/crem.go` | `v3.0/asrm/` | +| CAM | `v1client/cam.go` | `tools/cam.go` | `v3.0/cam/` | +| Email | `v1client/email.go` | `tools/email.go` | `v3.0/email/` | +| Container | `v1client/container.go` | `tools/container.go` | `v3.0/containerSecurity/` | +| Endpoint | `v1client/endpoint.go` | `tools/endpoint.go` | `v3.0/endpointSecurity/` | + +**Note:** OAT (Observed Attack Techniques) has its own client file but tools are registered under the Workbench toolset. + +## Contributing + +Follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for commit messages. diff --git a/README.md b/README.md index eebbe53..ffd7ce0 100644 --- a/README.md +++ b/README.md @@ -178,6 +178,12 @@ Alternatively, copy the following into your `settings.json`. | `endpoint_security_tasks_list` | Displays the tasks of your endpoints in a paginated list | `read` | | `endpoint_security_version_control_policies_list` | Displays your Endpoint Version Control policies | `read` | +### AI Security + +| Tool | Description | Mode | +| ---- | ----------- | ---- | +| `aisecurity_guardrails_apply` | Evaluates prompts against AI guard policies and returns the recommended action (Allow/Block) with reasons for any policy violations detected | `read` | + ## Architecture ![high-level architecture](./doc/images/trend-vision-one-mcp.png) diff --git a/go.mod b/go.mod index dd2c9bb..67f2f8b 100644 --- a/go.mod +++ b/go.mod @@ -3,16 +3,21 @@ module github.com/trendmicro/vision-one-mcp-server go 1.23.0 require ( - github.com/google/go-querystring v1.1.0 - github.com/mark3labs/mcp-go v0.27.0 + github.com/google/go-querystring v1.2.0 + github.com/mark3labs/mcp-go v0.43.2 github.com/stretchr/testify v1.9.0 ) require ( + github.com/bahlo/generic-list-go v0.2.0 // indirect + github.com/buger/jsonparser v1.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/uuid v1.6.0 // indirect + github.com/invopop/jsonschema v0.13.0 // indirect + github.com/mailru/easyjson v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/cast v1.10.0 // indirect + github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 6b48667..d2fdcfa 100644 --- a/go.sum +++ b/go.sum @@ -1,31 +1,39 @@ +github.com/bahlo/generic-list-go v0.2.0 h1:5sz/EEAK+ls5wF+NeqDpk5+iNdMDXrh3z3nPnH1Wvgk= +github.com/bahlo/generic-list-go v0.2.0/go.mod h1:2KvAjgMlE5NNynlg/5iLrrCCZ2+5xWbdbCW3pNTGyYg= +github.com/buger/jsonparser v1.1.1 h1:2PnMjfWD7wBILjqQbt530v576A/cAbQvEW9gGIpYMUs= +github.com/buger/jsonparser v1.1.1/go.mod h1:6RYKKt7H4d4+iWqouImQ9R2FZql3VbhNgx27UK13J/0= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= +github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/invopop/jsonschema v0.13.0 h1:KvpoAJWEjR3uD9Kbm2HWJmqsEaHt8lBUpd0qHcIi21E= +github.com/invopop/jsonschema v0.13.0/go.mod h1:ffZ5Km5SWWRAIN6wbDXItl95euhFz2uON45H2qjYt+0= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/mark3labs/mcp-go v0.27.0 h1:iok9kU4DUIU2/XVLgFS2Q9biIDqstC0jY4EQTK2Erzc= -github.com/mark3labs/mcp-go v0.27.0/go.mod h1:rXqOudj/djTORU/ThxYx8fqEVj/5pvTuuebQ2RC7uk4= +github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= +github.com/mailru/easyjson v0.9.1/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= +github.com/mark3labs/mcp-go v0.43.2 h1:21PUSlWWiSbUPQwXIJ5WKlETixpFpq+WBpbMGDSVy/I= +github.com/mark3labs/mcp-go v0.43.2/go.mod h1:YnJfOL382MIWDx1kMY+2zsRHU/q78dBg9aFb8W6Thdw= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= -github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= +github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc= +github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/internal/v1client/aisecurity.go b/internal/v1client/aisecurity.go new file mode 100644 index 0000000..8d91ad4 --- /dev/null +++ b/internal/v1client/aisecurity.go @@ -0,0 +1,88 @@ +package v1client + +import ( + "bytes" + "encoding/json" + "net/http" +) + +// AISecurityApplyGuardrailsInput represents the input for the applyGuardrails API. +// It supports three request types: +// - SimpleRequestGuard: just a prompt string +// - OpenAIChatCompletionRequestV1: OpenAI chat completion request format +// - OpenAIChatCompletionResponseV1: OpenAI chat completion response format +type AISecurityApplyGuardrailsInput struct { + // For SimpleRequestGuard + Prompt string `json:"prompt,omitempty"` + + // For OpenAIChatCompletionRequestV1 + Model string `json:"model,omitempty"` + Messages []AISecurityChatMessage `json:"messages,omitempty"` + + // For OpenAIChatCompletionResponseV1 + ID string `json:"id,omitempty"` + Object string `json:"object,omitempty"` + Created int64 `json:"created,omitempty"` + Choices []AISecurityChatChoice `json:"choices,omitempty"` + Usage *AISecurityUsage `json:"usage,omitempty"` +} + +// AISecurityChatMessage represents a message in the chat conversation. +type AISecurityChatMessage struct { + Role string `json:"role"` + Content string `json:"content"` +} + +// AISecurityChatChoice represents a choice in the OpenAI chat completion response. +type AISecurityChatChoice struct { + Index int `json:"index"` + Message AISecurityChoiceMessage `json:"message"` + FinishReason string `json:"finish_reason"` +} + +// AISecurityChoiceMessage represents a message in a chat choice. +type AISecurityChoiceMessage struct { + Role string `json:"role"` + Content string `json:"content"` + Refusal *string `json:"refusal,omitempty"` +} + +// AISecurityUsage represents token usage statistics. +type AISecurityUsage struct { + PromptTokens int `json:"prompt_tokens"` + CompletionTokens int `json:"completion_tokens"` + TotalTokens int `json:"total_tokens"` +} + +// AISecurityApplyGuardrailsOptions contains the optional headers for the applyGuardrails API. +type AISecurityApplyGuardrailsOptions struct { + // ApplicationName is required - the name of the AI application whose prompts are being evaluated + ApplicationName string + // RequestType is the type of request being evaluated (SimpleRequestGuard, OpenAIChatCompletionRequestV1, OpenAIChatCompletionResponseV1) + RequestType string + // Prefer controls response detail level (return=representation for detailed, return=minimal for short) + Prefer string +} + +// AISecurityApplyGuardrails evaluates prompts against AI guard policies. +func (c *V1ApiClient) AISecurityApplyGuardrails(input AISecurityApplyGuardrailsInput, opts AISecurityApplyGuardrailsOptions) (*http.Response, error) { + b, err := json.Marshal(&input) + if err != nil { + return nil, err + } + + r, err := c.newRequest( + http.MethodPost, + "v3.0/aiSecurity/applyGuardrails", + bytes.NewReader(b), + withContentTypeJSON(), + withHeader("TMV1-Application-Name", opts.ApplicationName), + withHeader("TMV1-Request-Type", opts.RequestType), + withHeader("Prefer", opts.Prefer), + ) + if err != nil { + return nil, err + } + + return c.client.Do(r) +} diff --git a/internal/v1client/v1client.go b/internal/v1client/v1client.go index 119316f..55182cf 100644 --- a/internal/v1client/v1client.go +++ b/internal/v1client/v1client.go @@ -142,6 +142,16 @@ func contentTypeJSON(r *http.Request) { r.Header.Add("content-type", "application/json") } +// withHeader adds a custom header to the request. +func withHeader(name, value string) requestOptionFunc { + return func(r *http.Request) { + if value == "" { + return + } + r.Header.Add(name, value) + } +} + func (c *V1ApiClient) searchAndFilter(path, filter string, queryParams any) (*http.Response, error) { p, err := query.Values(queryParams) if err != nil { diff --git a/internal/v1mcp/server.go b/internal/v1mcp/server.go index 6456bbf..3a53b41 100644 --- a/internal/v1mcp/server.go +++ b/internal/v1mcp/server.go @@ -45,6 +45,7 @@ func NewMcpServer(cfg ServerConfig) (*mcpserver.MCPServer, error) { addReadOnlyToolset(s, client, tools.ToolsetsReadOnlyEmail) addReadOnlyToolset(s, client, tools.ToolsetsReadOnlyContainer) addReadOnlyToolset(s, client, tools.ToolsetsReadOnlyEndpoint) + addReadOnlyToolset(s, client, tools.ToolsetsReadOnlyAISecurity) if !cfg.ReadOnly { addWriteToolset(s, client, tools.ToolsetsWriteCloudPosture) diff --git a/internal/v1mcp/tools/aisecurity.go b/internal/v1mcp/tools/aisecurity.go new file mode 100644 index 0000000..d430ee1 --- /dev/null +++ b/internal/v1mcp/tools/aisecurity.go @@ -0,0 +1,135 @@ +package tools + +import ( + "context" + "net/http" + + "github.com/mark3labs/mcp-go/mcp" + "github.com/trendmicro/vision-one-mcp-server/internal/v1client" + + mcpserver "github.com/mark3labs/mcp-go/server" +) + +var ToolsetsReadOnlyAISecurity = []func(*v1client.V1ApiClient) mcpserver.ServerTool{ + toolAISecurityApplyGuardrails, +} + +func toolAISecurityApplyGuardrails(client *v1client.V1ApiClient) mcpserver.ServerTool { + return mcpserver.ServerTool{ + Tool: mcp.NewTool( + "aisecurity_guardrails_apply", + mcp.WithDescription("Evaluates prompts against AI guard policies and returns the recommended action (Allow/Block) with reasons for any policy violations detected"), + mcp.WithToolAnnotation(mcp.ToolAnnotation{ + ReadOnlyHint: toPtr(true), + }), + mcp.WithString("applicationName", + mcp.Required(), + mcp.Description("The name of the AI application whose prompts are being evaluated (max 64 characters)"), + ), + mcp.WithString("prompt", + mcp.Description("A simple text prompt to evaluate (max 1024 characters). Use this for SimpleRequestGuard request type."), + ), + mcp.WithArray("messages", + mcp.Description("A list of chat messages for OpenAI chat completion format. Each message should have 'role' (system/user/assistant) and 'content' fields. Use this for OpenAIChatCompletionRequestV1 request type."), + mcp.Items(map[string]any{ + "type": "object", + "properties": map[string]any{ + "role": map[string]any{ + "type": "string", + "enum": []string{"system", "user", "assistant"}, + "description": "The role of the entity that creates the message", + }, + "content": map[string]any{ + "type": "string", + "description": "The text content of the message", + }, + }, + "required": []string{"role", "content"}, + }), + ), + mcp.WithString("model", + mcp.Description("The AI model identifier when using OpenAI chat completion format (e.g., 'us.meta.llama3-1-70b-instruct-v1:0')"), + ), + mcp.WithString("requestType", + mcp.Description("The type of request being evaluated"), + mcp.Enum("SimpleRequestGuard", "OpenAIChatCompletionRequestV1", "OpenAIChatCompletionResponseV1"), + ), + mcp.WithString("prefer", + mcp.Description("Controls response detail level. 'return=representation' for detailed evaluation including harmful content, sensitive information, and prompt attacks. 'return=minimal' for shorter response with just action and reasons."), + mcp.Enum("return=representation", "return=minimal"), + ), + ), + Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { + applicationName, err := requiredValue[string]("applicationName", request.GetArguments()) + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + + prompt, err := optionalValue[string]("prompt", request.GetArguments()) + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + + model, err := optionalValue[string]("model", request.GetArguments()) + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + + requestType, err := optionalValue[string]("requestType", request.GetArguments()) + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + + prefer, err := optionalValue[string]("prefer", request.GetArguments()) + if err != nil { + return mcp.NewToolResultError(err.Error()), nil + } + + // Parse messages if provided + var messages []v1client.AISecurityChatMessage + if rawMessages, ok := request.GetArguments()["messages"].([]any); ok && len(rawMessages) > 0 { + for _, rawMsg := range rawMessages { + msgMap, ok := rawMsg.(map[string]any) + if !ok { + return mcp.NewToolResultError("each message must be an object with 'role' and 'content' fields"), nil + } + + role, ok := msgMap["role"].(string) + if !ok { + return mcp.NewToolResultError("message 'role' must be a string"), nil + } + + content, ok := msgMap["content"].(string) + if !ok { + return mcp.NewToolResultError("message 'content' must be a string"), nil + } + + messages = append(messages, v1client.AISecurityChatMessage{ + Role: role, + Content: content, + }) + } + } + + // Validate that either prompt or messages is provided + if prompt == "" && len(messages) == 0 { + return mcp.NewToolResultError("either 'prompt' or 'messages' must be provided"), nil + } + + input := v1client.AISecurityApplyGuardrailsInput{ + Prompt: prompt, + Model: model, + Messages: messages, + } + + opts := v1client.AISecurityApplyGuardrailsOptions{ + ApplicationName: applicationName, + RequestType: requestType, + Prefer: prefer, + } + + resp, err := client.AISecurityApplyGuardrails(input, opts) + return handleStatusResponse(resp, err, http.StatusOK, "failed to apply guardrails") + }, + } +} diff --git a/internal/v1mcp/tools/cam.go b/internal/v1mcp/tools/cam.go index 284c114..7973b8c 100644 --- a/internal/v1mcp/tools/cam.go +++ b/internal/v1mcp/tools/cam.go @@ -35,17 +35,17 @@ func toolCAMAwsAccountsList(client *v1client.V1ApiClient) mcpserver.ServerTool { mcp.WithString("nextBatchToken", mcp.Description("Token used to retrieve the next page of results")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - nextBatchToken, err := optionalValue[string]("nextBatchToken", request.Params.Arguments) + nextBatchToken, err := optionalValue[string]("nextBatchToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -76,7 +76,7 @@ func toolCAMAwsAccountGet(client *v1client.V1ApiClient) mcpserver.ServerTool { mcp.WithString("accountId", mcp.Required()), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - accountId, err := requiredValue[string]("accountId", request.Params.Arguments) + accountId, err := requiredValue[string]("accountId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -102,17 +102,17 @@ func toolCAMGcpAccountsList(client *v1client.V1ApiClient) mcpserver.ServerTool { mcp.WithString("nextBatchToken", mcp.Description("Token used to retrieve the next page of results")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - nextBatchToken, err := optionalValue[string]("nextBatchToken", request.Params.Arguments) + nextBatchToken, err := optionalValue[string]("nextBatchToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -140,7 +140,7 @@ func toolCAMGcpAccountGet(client *v1client.V1ApiClient) mcpserver.ServerTool { mcp.WithString("accountId", mcp.Required()), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - accountId, err := requiredValue[string]("accountId", request.Params.Arguments) + accountId, err := requiredValue[string]("accountId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -167,17 +167,17 @@ func toolCAMAlibabaAccountsList(client *v1client.V1ApiClient) mcpserver.ServerTo mcp.WithString("nextBatchToken", mcp.Description("Token used to retrieve the next page of results")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - nextBatchToken, err := optionalValue[string]("nextBatchToken", request.Params.Arguments) + nextBatchToken, err := optionalValue[string]("nextBatchToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -204,7 +204,7 @@ func toolCAMAlibabaAccountGet(client *v1client.V1ApiClient) mcpserver.ServerTool mcp.WithString("accountId", mcp.Required()), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - accountId, err := requiredValue[string]("accountId", request.Params.Arguments) + accountId, err := requiredValue[string]("accountId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } diff --git a/internal/v1mcp/tools/cloudposture.go b/internal/v1mcp/tools/cloudposture.go index eb23e5a..9a0a554 100644 --- a/internal/v1mcp/tools/cloudposture.go +++ b/internal/v1mcp/tools/cloudposture.go @@ -39,12 +39,12 @@ func toolCloudPostureAccountsList(client *v1client.V1ApiClient) mcpserver.Server mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalIntValue("top", request.Params.Arguments) + top, err := optionalIntValue("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -85,27 +85,27 @@ func toolCloudPostureAccountChecksList(client *v1client.V1ApiClient) mcpserver.S mcp.WithString("endDateTime", mcp.Description("The end of the data retrieval range")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalIntValue("top", request.Params.Arguments) + top, err := optionalIntValue("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - startDate, err := optionalTimeValue("startDateTime", request.Params.Arguments) + startDate, err := optionalTimeValue("startDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - endDate, err := optionalTimeValue("endDateTime", request.Params.Arguments) + endDate, err := optionalTimeValue("endDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -140,11 +140,11 @@ func toolCloudPostureTemplateScannerRun(client *v1client.V1ApiClient) mcpserver. ), ), Handler: func(ctx context.Context, ctr mcp.CallToolRequest) (*mcp.CallToolResult, error) { - templateType, err := requiredValue[string]("type", ctr.Params.Arguments) + templateType, err := requiredValue[string]("type", ctr.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - content, err := requiredValue[string]("content", ctr.Params.Arguments) + content, err := requiredValue[string]("content", ctr.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -168,7 +168,7 @@ func toolCloudPostureAccountScanSettingsGet(client *v1client.V1ApiClient) mcpser ), ), Handler: func(ctx context.Context, ctr mcp.CallToolRequest) (*mcp.CallToolResult, error) { - accountId, err := requiredValue[string]("accountId", ctr.Params.Arguments) + accountId, err := requiredValue[string]("accountId", ctr.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -192,7 +192,7 @@ func toolCloudPostureAccountScan(client *v1client.V1ApiClient) mcpserver.ServerT ), ), Handler: func(ctx context.Context, ctr mcp.CallToolRequest) (*mcp.CallToolResult, error) { - accountId, err := requiredValue[string]("accountId", ctr.Params.Arguments) + accountId, err := requiredValue[string]("accountId", ctr.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -221,17 +221,17 @@ func toolCloudPostureAccountScanSettingsUpdate(client *v1client.V1ApiClient) mcp mcp.WithBoolean("enabled"), ), Handler: func(ctx context.Context, ctr mcp.CallToolRequest) (*mcp.CallToolResult, error) { - accountId, err := requiredValue[string]("accountId", ctr.Params.Arguments) + accountId, err := requiredValue[string]("accountId", ctr.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - interval, err := optionalIntValue("interval", ctr.Params.Arguments) + interval, err := optionalIntValue("interval", ctr.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - enabled, err := optionalPointerValue[bool]("enabled", ctr.Params.Arguments) + enabled, err := optionalPointerValue[bool]("enabled", ctr.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } diff --git a/internal/v1mcp/tools/container.go b/internal/v1mcp/tools/container.go index cdcb443..9accd1d 100644 --- a/internal/v1mcp/tools/container.go +++ b/internal/v1mcp/tools/container.go @@ -51,37 +51,37 @@ func toolContainerSecurityImageVulnerabilitiesList(client *v1client.V1ApiClient) mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - lastDetectedStartDateTime, err := optionalTimeValue("lastDetectedStartDateTime", request.Params.Arguments) + lastDetectedStartDateTime, err := optionalTimeValue("lastDetectedStartDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - lastDetectedEndDateTime, err := optionalTimeValue("lastDetectedEndDateTime", request.Params.Arguments) + lastDetectedEndDateTime, err := optionalTimeValue("lastDetectedEndDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - firstDetectedStartDateTime, err := optionalTimeValue("firstDetectedStartDateTime", request.Params.Arguments) + firstDetectedStartDateTime, err := optionalTimeValue("firstDetectedStartDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - firstDetectedEndDateTime, err := optionalTimeValue("firstDetectedEndDateTime", request.Params.Arguments) + firstDetectedEndDateTime, err := optionalTimeValue("firstDetectedEndDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -117,12 +117,12 @@ func toolContainerSecurityK8ClustersList(client *v1client.V1ApiClient) mcpserver mcp.WithString("filter", mcp.Description(tooldescriptions.FilterK8s)), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -148,7 +148,7 @@ func toolContainerSecurityK8ClusterGet(client *v1client.V1ApiClient) mcpserver.S ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - clusterID, err := requiredValue[string]("clusterID", request.Params.Arguments) + clusterID, err := requiredValue[string]("clusterID", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -175,12 +175,12 @@ func toolContainerSecurityECSClustersList(client *v1client.V1ApiClient) mcpserve mcp.WithString("filter", mcp.Description(tooldescriptions.FilterECS)), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -210,12 +210,12 @@ func toolContainerSecurityK8ImagesList(client *v1client.V1ApiClient) mcpserver.S mcp.WithString("filter", mcp.Description(tooldescriptions.FilterK8Images)), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } diff --git a/internal/v1mcp/tools/crem.go b/internal/v1mcp/tools/crem.go index 7e5c738..5b6ae01 100644 --- a/internal/v1mcp/tools/crem.go +++ b/internal/v1mcp/tools/crem.go @@ -67,42 +67,42 @@ func toolCREMAttackSurfaceDevicesList(client *v1client.V1ApiClient) mcpserver.Se mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - lastDetectedStartDateTime, err := optionalTimeValue("lastDetectedStartDateTime", request.Params.Arguments) + lastDetectedStartDateTime, err := optionalTimeValue("lastDetectedStartDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - lastDetectedEndDateTime, err := optionalTimeValue("lastDetectedEndDateTime", request.Params.Arguments) + lastDetectedEndDateTime, err := optionalTimeValue("lastDetectedEndDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - firstSeenStartDateTime, err := optionalTimeValue("firstSeenStartDateTime", request.Params.Arguments) + firstSeenStartDateTime, err := optionalTimeValue("firstSeenStartDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - firstSeenEndDateTime, err := optionalTimeValue("firstSeenEndDateTime", request.Params.Arguments) + firstSeenEndDateTime, err := optionalTimeValue("firstSeenEndDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -150,22 +150,22 @@ func toolCREMAttackSurfaceDomainAccountsList(client *v1client.V1ApiClient) mcpse mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -203,22 +203,22 @@ func toolCREMAttackSurfaceGlobalFQDNsList(client *v1client.V1ApiClient) mcpserve mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -256,22 +256,22 @@ func toolCREMAttackSurfacePublicIPsList(client *v1client.V1ApiClient) mcpserver. mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -321,42 +321,42 @@ func toolCREMAttackSurfaceCloudAssetsList(client *v1client.V1ApiClient) mcpserve mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - lastDetectedStartDateTime, err := optionalTimeValue("lastDetectedStartDateTime", request.Params.Arguments) + lastDetectedStartDateTime, err := optionalTimeValue("lastDetectedStartDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - lastDetectedEndDateTime, err := optionalTimeValue("lastDetectedEndDateTime", request.Params.Arguments) + lastDetectedEndDateTime, err := optionalTimeValue("lastDetectedEndDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - firstSeenStartDateTime, err := optionalTimeValue("firstSeenStartDateTime", request.Params.Arguments) + firstSeenStartDateTime, err := optionalTimeValue("firstSeenStartDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - firstSeenEndDateTime, err := optionalTimeValue("firstSeenEndDateTime", request.Params.Arguments) + firstSeenEndDateTime, err := optionalTimeValue("firstSeenEndDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -402,22 +402,22 @@ func toolCREMAttackSurfaceHighRiskUsersList(client *v1client.V1ApiClient) mcpser mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -457,17 +457,17 @@ func toolCREMAttackSurfaceServiceAccountsList(client *v1client.V1ApiClient) mcps ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -494,7 +494,7 @@ func toolCREMAttackSurfaceCloudAssetProfileGet(client *v1client.V1ApiClient) mcp mcp.WithString("cloudAssetId", mcp.Description("The ID of the cloud asset to retrieve.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - cloudAssetId, err := requiredValue[string]("cloudAssetId", request.Params.Arguments) + cloudAssetId, err := requiredValue[string]("cloudAssetId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -530,27 +530,27 @@ func toolCREMAttackSurfaceCloudAssetRiskIndicatorsList(client *v1client.V1ApiCli mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - cloudAssetId, err := requiredValue[string]("cloudAssetId", request.Params.Arguments) + cloudAssetId, err := requiredValue[string]("cloudAssetId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -595,22 +595,22 @@ func toolCREMAttackSurfaceLocalAppsList(client *v1client.V1ApiClient) mcpserver. mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -641,7 +641,7 @@ func toolCREMAttackSurfaceLocalAppProfileGet(client *v1client.V1ApiClient) mcpse ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - appID, err := requiredValue[string]("appID", request.Params.Arguments) + appID, err := requiredValue[string]("appID", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -677,27 +677,27 @@ func toolCREMAttackSurfaceLocalAppRiskIndicatorsList(client *v1client.V1ApiClien mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - appID, err := requiredValue[string]("appID", request.Params.Arguments) + appID, err := requiredValue[string]("appID", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -739,27 +739,27 @@ func toolCREMAttackSurfaceLocalAppDevicesList(client *v1client.V1ApiClient) mcps mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - appID, err := requiredValue[string]("appID", request.Params.Arguments) + appID, err := requiredValue[string]("appID", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -801,27 +801,27 @@ func toolCREMAttackSurfaceLocalAppExecutableFilesList(client *v1client.V1ApiClie mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - appID, err := requiredValue[string]("appID", request.Params.Arguments) + appID, err := requiredValue[string]("appID", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -859,22 +859,22 @@ func toolCREMAttackSurfaceCustomTagsList(client *v1client.V1ApiClient) mcpserver mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } diff --git a/internal/v1mcp/tools/email.go b/internal/v1mcp/tools/email.go index 683d74a..b15ff95 100644 --- a/internal/v1mcp/tools/email.go +++ b/internal/v1mcp/tools/email.go @@ -34,12 +34,12 @@ func toolEmailSecurityAccountsList(client *v1client.V1ApiClient) mcpserver.Serve mcp.WithString("filter", mcp.Description(tooldescriptions.FilterEmailAccounts)), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalIntValue("top", request.Params.Arguments) + top, err := optionalIntValue("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -69,7 +69,7 @@ func toolEmailSecurityDomainsList(client *v1client.V1ApiClient) mcpserver.Server ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalIntValue("top", request.Params.Arguments) + top, err := optionalIntValue("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -98,7 +98,7 @@ func toolEmailSecurityServersList(client *v1client.V1ApiClient) mcpserver.Server ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalIntValue("top", request.Params.Arguments) + top, err := optionalIntValue("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } diff --git a/internal/v1mcp/tools/endpoint.go b/internal/v1mcp/tools/endpoint.go index 36ff3b6..2205efd 100644 --- a/internal/v1mcp/tools/endpoint.go +++ b/internal/v1mcp/tools/endpoint.go @@ -42,17 +42,17 @@ func toolEndpointSecurityEndpointsList(client *v1client.V1ApiClient) mcpserver.S mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -77,7 +77,7 @@ func toolEndpointSecurityEndpointGet(client *v1client.V1ApiClient) mcpserver.Ser mcp.WithString("endpointID", mcp.Required()), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - endpointID, err := requiredValue[string]("endpointID", request.Params.Arguments) + endpointID, err := requiredValue[string]("endpointID", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -118,27 +118,27 @@ func toolEndpointSecurityTaskList(client *v1client.V1ApiClient) mcpserver.Server ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - startDateTime, err := optionalTimeValue("startDateTime", request.Params.Arguments) + startDateTime, err := optionalTimeValue("startDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - endDateTime, err := optionalTimeValue("endDateTime", request.Params.Arguments) + endDateTime, err := optionalTimeValue("endDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -165,7 +165,7 @@ func toolEndpointSecurityTaskGet(client *v1client.V1ApiClient) mcpserver.ServerT mcp.WithString("taskID", mcp.Required()), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - taskID, err := requiredValue[string]("taskID", request.Params.Arguments) + taskID, err := requiredValue[string]("taskID", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -184,12 +184,12 @@ func toolEndpointSecurityVersionControlPoliciesList(client *v1client.V1ApiClient mcp.WithReadOnlyHintAnnotation(true), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } diff --git a/internal/v1mcp/tools/iam.go b/internal/v1mcp/tools/iam.go index 94509fa..88350c0 100644 --- a/internal/v1mcp/tools/iam.go +++ b/internal/v1mcp/tools/iam.go @@ -53,22 +53,22 @@ func toolIamApiKeysList(client *v1client.V1ApiClient) mcpserver.ServerTool { mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - skipToken, err := optionalValue[string]("skipToken", request.Params.Arguments) + skipToken, err := optionalValue[string]("skipToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -105,7 +105,7 @@ func toolIamApiKeysDelete(client *v1client.V1ApiClient) mcpserver.ServerTool { ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { keysToDelete := []string{} - if keyIds, ok := request.Params.Arguments["apiKeyIds"].([]any); ok && len(keyIds) > 0 { + if keyIds, ok := request.GetArguments()["apiKeyIds"].([]any); ok && len(keyIds) > 0 { for _, id := range keyIds { keyId, ok := id.(string) if !ok { @@ -146,22 +146,22 @@ func toolIamAccountInvite(client *v1client.V1ApiClient) mcpserver.ServerTool { ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - email, err := requiredValue[string]("email", request.Params.Arguments) + email, err := requiredValue[string]("email", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - role, err := requiredValue[string]("role", request.Params.Arguments) + role, err := requiredValue[string]("role", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - authType, err := requiredValue[string]("authType", request.Params.Arguments) + authType, err := requiredValue[string]("authType", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - description, err := optionalValue[string]("description", request.Params.Arguments) + description, err := optionalValue[string]("description", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -195,12 +195,12 @@ func toolIamAccountsList(client *v1client.V1ApiClient) mcpserver.ServerTool { ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -239,22 +239,22 @@ func toolIamAccountUpdate(client *v1client.V1ApiClient) mcpserver.ServerTool { ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - accountId, err := requiredValue[string]("accountId", request.Params.Arguments) + accountId, err := requiredValue[string]("accountId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - role, err := optionalValue[string]("role", request.Params.Arguments) + role, err := optionalValue[string]("role", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - status, err := optionalValue[string]("status", request.Params.Arguments) + status, err := optionalValue[string]("status", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - description, err := optionalValue[string]("description", request.Params.Arguments) + description, err := optionalValue[string]("description", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -285,7 +285,7 @@ func toolIamAccountDelete(client *v1client.V1ApiClient) mcpserver.ServerTool { ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - accountId, err := requiredValue[string]("accountId", request.Params.Arguments) + accountId, err := requiredValue[string]("accountId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } diff --git a/internal/v1mcp/tools/workbench.go b/internal/v1mcp/tools/workbench.go index d7b0aad..7588ce6 100644 --- a/internal/v1mcp/tools/workbench.go +++ b/internal/v1mcp/tools/workbench.go @@ -47,22 +47,22 @@ func toolWorkbenchAlertsList(client *v1client.V1ApiClient) mcpserver.ServerTool mcp.WithString("endDateTime", mcp.Description("The end of the data retrieval range")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - startDate, err := optionalTimeValue("startDateTime", request.Params.Arguments) + startDate, err := optionalTimeValue("startDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - endDate, err := optionalTimeValue("endDateTime", request.Params.Arguments) + endDate, err := optionalTimeValue("endDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -92,7 +92,7 @@ func toolWorkbenchAlertDetailGet(client *v1client.V1ApiClient) mcpserver.ServerT ), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - alertId, err := requiredValue[string]("alertId", request.Params.Arguments) + alertId, err := requiredValue[string]("alertId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -139,32 +139,32 @@ func TookWorkbenchAlertNotesList(client *v1client.V1ApiClient) mcpserver.ServerT mcp.WithString("endDateTime", mcp.Description("The end of the data retrieval range")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - alertId, err := requiredValue[string]("alertId", request.Params.Arguments) + alertId, err := requiredValue[string]("alertId", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - orderBy, err := optionalValue[string]("orderBy", request.Params.Arguments) + orderBy, err := optionalValue[string]("orderBy", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - startDate, err := optionalTimeValue("startDateTime", request.Params.Arguments) + startDate, err := optionalTimeValue("startDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - endDate, err := optionalTimeValue("endDateTime", request.Params.Arguments) + endDate, err := optionalTimeValue("endDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } @@ -211,37 +211,37 @@ func toolObservedAttackTechniquesList(client *v1client.V1ApiClient) mcpserver.Se mcp.Description("The token use to paginate. Used to retrieve the next page of information.")), ), Handler: func(ctx context.Context, request mcp.CallToolRequest) (*mcp.CallToolResult, error) { - top, err := optionalStrInt("top", request.Params.Arguments) + top, err := optionalStrInt("top", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - filter, err := optionalValue[string]("filter", request.Params.Arguments) + filter, err := optionalValue[string]("filter", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - nextBatchToken, err := optionalValue[string]("nextBatchToken", request.Params.Arguments) + nextBatchToken, err := optionalValue[string]("nextBatchToken", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - detectedStartDate, err := optionalTimeValue("detectedStartDateTime", request.Params.Arguments) + detectedStartDate, err := optionalTimeValue("detectedStartDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - detectedEndDate, err := optionalTimeValue("detectedEndDateTime", request.Params.Arguments) + detectedEndDate, err := optionalTimeValue("detectedEndDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - ingestedStartDate, err := optionalTimeValue("ingestedStartDateTime", request.Params.Arguments) + ingestedStartDate, err := optionalTimeValue("ingestedStartDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } - ingestedEndDate, err := optionalTimeValue("ingestedEndDateTime", request.Params.Arguments) + ingestedEndDate, err := optionalTimeValue("ingestedEndDateTime", request.GetArguments()) if err != nil { return mcp.NewToolResultError(err.Error()), nil } diff --git a/third-party-licenses.darwin.md b/third-party-licenses.darwin.md index 9e109d5..642375c 100644 --- a/third-party-licenses.darwin.md +++ b/third-party-licenses.darwin.md @@ -7,11 +7,17 @@ The following open source dependencies are used to build the [trendmicro/trend-v Some packages may only be included on certain architectures or operating systems. - - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.1.0/LICENSE)) + - [github.com/bahlo/generic-list-go](https://pkg.go.dev/github.com/bahlo/generic-list-go) ([BSD-3-Clause](https://github.com/bahlo/generic-list-go/blob/v0.2.0/LICENSE)) + - [github.com/buger/jsonparser](https://pkg.go.dev/github.com/buger/jsonparser) ([MIT](https://github.com/buger/jsonparser/blob/v1.1.1/LICENSE)) + - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.2.0/LICENSE)) - [github.com/google/uuid](https://pkg.go.dev/github.com/google/uuid) ([BSD-3-Clause](https://github.com/google/uuid/blob/v1.6.0/LICENSE)) - - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.27.0/LICENSE)) - - [github.com/spf13/cast](https://pkg.go.dev/github.com/spf13/cast) ([MIT](https://github.com/spf13/cast/blob/v1.7.1/LICENSE)) + - [github.com/invopop/jsonschema](https://pkg.go.dev/github.com/invopop/jsonschema) ([MIT](https://github.com/invopop/jsonschema/blob/v0.13.0/COPYING)) + - [github.com/mailru/easyjson](https://pkg.go.dev/github.com/mailru/easyjson) ([MIT](https://github.com/mailru/easyjson/blob/v0.9.1/LICENSE)) + - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.43.2/LICENSE)) + - [github.com/spf13/cast](https://pkg.go.dev/github.com/spf13/cast) ([MIT](https://github.com/spf13/cast/blob/v1.10.0/LICENSE)) - [github.com/trendmicro/vision-one-mcp-server](https://pkg.go.dev/github.com/trendmicro/vision-one-mcp-server) ([MIT](https://github.com/trendmicro/vision-one-mcp-server/blob/HEAD/LICENSE)) + - [github.com/wk8/go-ordered-map/v2](https://pkg.go.dev/github.com/wk8/go-ordered-map/v2) ([Apache-2.0](https://github.com/wk8/go-ordered-map/blob/v2.1.8/LICENSE)) - [github.com/yosida95/uritemplate/v3](https://pkg.go.dev/github.com/yosida95/uritemplate/v3) ([BSD-3-Clause](https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE)) + - [gopkg.in/yaml.v3](https://pkg.go.dev/gopkg.in/yaml.v3) ([MIT](https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE)) [trendmicro/trend-vision-one-mcp-server]: https://github.com/trendmicro/trend-vision-one-mcp-server diff --git a/third-party-licenses.linux.md b/third-party-licenses.linux.md index 9e109d5..642375c 100644 --- a/third-party-licenses.linux.md +++ b/third-party-licenses.linux.md @@ -7,11 +7,17 @@ The following open source dependencies are used to build the [trendmicro/trend-v Some packages may only be included on certain architectures or operating systems. - - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.1.0/LICENSE)) + - [github.com/bahlo/generic-list-go](https://pkg.go.dev/github.com/bahlo/generic-list-go) ([BSD-3-Clause](https://github.com/bahlo/generic-list-go/blob/v0.2.0/LICENSE)) + - [github.com/buger/jsonparser](https://pkg.go.dev/github.com/buger/jsonparser) ([MIT](https://github.com/buger/jsonparser/blob/v1.1.1/LICENSE)) + - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.2.0/LICENSE)) - [github.com/google/uuid](https://pkg.go.dev/github.com/google/uuid) ([BSD-3-Clause](https://github.com/google/uuid/blob/v1.6.0/LICENSE)) - - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.27.0/LICENSE)) - - [github.com/spf13/cast](https://pkg.go.dev/github.com/spf13/cast) ([MIT](https://github.com/spf13/cast/blob/v1.7.1/LICENSE)) + - [github.com/invopop/jsonschema](https://pkg.go.dev/github.com/invopop/jsonschema) ([MIT](https://github.com/invopop/jsonschema/blob/v0.13.0/COPYING)) + - [github.com/mailru/easyjson](https://pkg.go.dev/github.com/mailru/easyjson) ([MIT](https://github.com/mailru/easyjson/blob/v0.9.1/LICENSE)) + - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.43.2/LICENSE)) + - [github.com/spf13/cast](https://pkg.go.dev/github.com/spf13/cast) ([MIT](https://github.com/spf13/cast/blob/v1.10.0/LICENSE)) - [github.com/trendmicro/vision-one-mcp-server](https://pkg.go.dev/github.com/trendmicro/vision-one-mcp-server) ([MIT](https://github.com/trendmicro/vision-one-mcp-server/blob/HEAD/LICENSE)) + - [github.com/wk8/go-ordered-map/v2](https://pkg.go.dev/github.com/wk8/go-ordered-map/v2) ([Apache-2.0](https://github.com/wk8/go-ordered-map/blob/v2.1.8/LICENSE)) - [github.com/yosida95/uritemplate/v3](https://pkg.go.dev/github.com/yosida95/uritemplate/v3) ([BSD-3-Clause](https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE)) + - [gopkg.in/yaml.v3](https://pkg.go.dev/gopkg.in/yaml.v3) ([MIT](https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE)) [trendmicro/trend-vision-one-mcp-server]: https://github.com/trendmicro/trend-vision-one-mcp-server diff --git a/third-party-licenses.windows.md b/third-party-licenses.windows.md index 9e109d5..642375c 100644 --- a/third-party-licenses.windows.md +++ b/third-party-licenses.windows.md @@ -7,11 +7,17 @@ The following open source dependencies are used to build the [trendmicro/trend-v Some packages may only be included on certain architectures or operating systems. - - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.1.0/LICENSE)) + - [github.com/bahlo/generic-list-go](https://pkg.go.dev/github.com/bahlo/generic-list-go) ([BSD-3-Clause](https://github.com/bahlo/generic-list-go/blob/v0.2.0/LICENSE)) + - [github.com/buger/jsonparser](https://pkg.go.dev/github.com/buger/jsonparser) ([MIT](https://github.com/buger/jsonparser/blob/v1.1.1/LICENSE)) + - [github.com/google/go-querystring/query](https://pkg.go.dev/github.com/google/go-querystring/query) ([BSD-3-Clause](https://github.com/google/go-querystring/blob/v1.2.0/LICENSE)) - [github.com/google/uuid](https://pkg.go.dev/github.com/google/uuid) ([BSD-3-Clause](https://github.com/google/uuid/blob/v1.6.0/LICENSE)) - - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.27.0/LICENSE)) - - [github.com/spf13/cast](https://pkg.go.dev/github.com/spf13/cast) ([MIT](https://github.com/spf13/cast/blob/v1.7.1/LICENSE)) + - [github.com/invopop/jsonschema](https://pkg.go.dev/github.com/invopop/jsonschema) ([MIT](https://github.com/invopop/jsonschema/blob/v0.13.0/COPYING)) + - [github.com/mailru/easyjson](https://pkg.go.dev/github.com/mailru/easyjson) ([MIT](https://github.com/mailru/easyjson/blob/v0.9.1/LICENSE)) + - [github.com/mark3labs/mcp-go](https://pkg.go.dev/github.com/mark3labs/mcp-go) ([MIT](https://github.com/mark3labs/mcp-go/blob/v0.43.2/LICENSE)) + - [github.com/spf13/cast](https://pkg.go.dev/github.com/spf13/cast) ([MIT](https://github.com/spf13/cast/blob/v1.10.0/LICENSE)) - [github.com/trendmicro/vision-one-mcp-server](https://pkg.go.dev/github.com/trendmicro/vision-one-mcp-server) ([MIT](https://github.com/trendmicro/vision-one-mcp-server/blob/HEAD/LICENSE)) + - [github.com/wk8/go-ordered-map/v2](https://pkg.go.dev/github.com/wk8/go-ordered-map/v2) ([Apache-2.0](https://github.com/wk8/go-ordered-map/blob/v2.1.8/LICENSE)) - [github.com/yosida95/uritemplate/v3](https://pkg.go.dev/github.com/yosida95/uritemplate/v3) ([BSD-3-Clause](https://github.com/yosida95/uritemplate/blob/v3.0.2/LICENSE)) + - [gopkg.in/yaml.v3](https://pkg.go.dev/gopkg.in/yaml.v3) ([MIT](https://github.com/go-yaml/yaml/blob/v3.0.1/LICENSE)) [trendmicro/trend-vision-one-mcp-server]: https://github.com/trendmicro/trend-vision-one-mcp-server diff --git a/third-party/github.com/bahlo/generic-list-go/LICENSE b/third-party/github.com/bahlo/generic-list-go/LICENSE new file mode 100644 index 0000000..6a66aea --- /dev/null +++ b/third-party/github.com/bahlo/generic-list-go/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2009 The Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/third-party/github.com/buger/jsonparser/LICENSE b/third-party/github.com/buger/jsonparser/LICENSE new file mode 100644 index 0000000..ac25aeb --- /dev/null +++ b/third-party/github.com/buger/jsonparser/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2016 Leonid Bugaev + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/third-party/github.com/invopop/jsonschema/COPYING b/third-party/github.com/invopop/jsonschema/COPYING new file mode 100644 index 0000000..2993ec0 --- /dev/null +++ b/third-party/github.com/invopop/jsonschema/COPYING @@ -0,0 +1,19 @@ +Copyright (C) 2014 Alec Thomas + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/third-party/github.com/mailru/easyjson/LICENSE b/third-party/github.com/mailru/easyjson/LICENSE new file mode 100644 index 0000000..fbff658 --- /dev/null +++ b/third-party/github.com/mailru/easyjson/LICENSE @@ -0,0 +1,7 @@ +Copyright (c) 2016 Mail.Ru Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/third-party/github.com/wk8/go-ordered-map/v2/LICENSE b/third-party/github.com/wk8/go-ordered-map/v2/LICENSE new file mode 100644 index 0000000..8dada3e --- /dev/null +++ b/third-party/github.com/wk8/go-ordered-map/v2/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/third-party/gopkg.in/yaml.v3/LICENSE b/third-party/gopkg.in/yaml.v3/LICENSE new file mode 100644 index 0000000..2683e4b --- /dev/null +++ b/third-party/gopkg.in/yaml.v3/LICENSE @@ -0,0 +1,50 @@ + +This project is covered by two different licenses: MIT and Apache. + +#### MIT License #### + +The following files were ported to Go from C files of libyaml, and thus +are still covered by their original MIT license, with the additional +copyright staring in 2011 when the project was ported over: + + apic.go emitterc.go parserc.go readerc.go scannerc.go + writerc.go yamlh.go yamlprivateh.go + +Copyright (c) 2006-2010 Kirill Simonov +Copyright (c) 2006-2011 Kirill Simonov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +### Apache License ### + +All the remaining project files are covered by the Apache license: + +Copyright (c) 2011-2019 Canonical Ltd + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/third-party/gopkg.in/yaml.v3/NOTICE b/third-party/gopkg.in/yaml.v3/NOTICE new file mode 100644 index 0000000..866d74a --- /dev/null +++ b/third-party/gopkg.in/yaml.v3/NOTICE @@ -0,0 +1,13 @@ +Copyright 2011-2016 Canonical Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License.