Skip to content

Commit e27559d

Browse files
Improve validation for owner and repo inputs
Enhance input validation by disallowing '.' and '..' as owner and repo values. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 6e7546a commit e27559d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎pkg/github/automation_tags.go‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ func ListAutomationTags(t translations.TranslationHelperFunc) inventory.ServerTo
5151
},
5252
scopes.RequireAll(scopes.Repo),
5353
func(ctx context.Context, deps ToolDependencies, _ *mcp.CallToolRequest, input RepositoryListInput) (*mcp.CallToolResult, *ListAutomationTagsResponse, error) {
54-
if input.Owner == "." {
55-
return utils.NewToolResultError(`owner must not be "."`), nil, nil
54+
if input.Owner == "." || input.Owner == ".." {
55+
return utils.NewToolResultError(fmt.Sprintf("owner must not be %q", input.Owner)), nil, nil
5656
}
57-
if input.Repo == "." {
58-
return utils.NewToolResultError(`repo must not be "."`), nil, nil
57+
if input.Repo == "." || input.Repo == ".." {
58+
return utils.NewToolResultError(fmt.Sprintf("repo must not be %q", input.Repo)), nil, nil
5959
}
6060
pagination := PaginationParams{Page: 1, PerPage: 30}
6161
if input.Page != nil {

0 commit comments

Comments
 (0)