Follow-up to #36. The mid-path // guard in the gitea client catches most empty-segment cases, but a call that omits the repo identifier entirely (e.g. repo_get{owner} with no name/repo) builds a trailing empty segment /api/v1/repos/{owner}/ and still leaks gitea's plain 404 page not found instead of a clean CodeValidation.
The client guard cannot blanket-reject trailing slashes — legit roots like /contents/ end that way — so the fix belongs at the tool layer: reject empty required string fields (owner, name, …) in parseArgs/per-tool before calling the client, returning CodeValidation with the missing field name.
Low priority: name is schema-required so a compliant caller never hits this, and the result is now a benign 404, not the misleading swagger-404. Defense-in-depth + clearer error.
Follow-up to #36. The mid-path `//` guard in the gitea client catches most empty-segment cases, but a call that omits the repo identifier *entirely* (e.g. `repo_get{owner}` with no `name`/`repo`) builds a **trailing** empty segment `/api/v1/repos/{owner}/` and still leaks gitea's plain `404 page not found` instead of a clean `CodeValidation`.
The client guard cannot blanket-reject trailing slashes — legit roots like `/contents/` end that way — so the fix belongs at the tool layer: reject empty required string fields (`owner`, `name`, …) in `parseArgs`/per-tool before calling the client, returning `CodeValidation` with the missing field name.
Low priority: `name` is schema-required so a compliant caller never hits this, and the result is now a benign 404, not the misleading swagger-404. Defense-in-depth + clearer error.
parseArgs now validates, via reflection, that repo/name string args are non-empty and returns a typed ErrValidation naming the field — before the client builds a trailing-empty /api/v1/repos/{owner}/ segment. Optional identifiers opt out with ,omitempty (only code_search's owner-wide fan-out repo today). owner was already enforced by allowlist.Check (returns "owner required" on empty).
Test TestEmptyRepoRejectedAsValidation: empty repo on an identifier tool and empty name on a create tool both return ErrValidation. task check green.
Done in v0.4.2 (commit on `main`).
`parseArgs` now validates, via reflection, that `repo`/`name` string args are non-empty and returns a typed `ErrValidation` naming the field — before the client builds a trailing-empty `/api/v1/repos/{owner}/` segment. Optional identifiers opt out with `,omitempty` (only `code_search`'s owner-wide fan-out `repo` today). `owner` was already enforced by `allowlist.Check` (returns "owner required" on empty).
Test `TestEmptyRepoRejectedAsValidation`: empty `repo` on an identifier tool and empty `name` on a create tool both return `ErrValidation`. `task check` green.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Follow-up to #36. The mid-path
//guard in the gitea client catches most empty-segment cases, but a call that omits the repo identifier entirely (e.g.repo_get{owner}with noname/repo) builds a trailing empty segment/api/v1/repos/{owner}/and still leaks gitea's plain404 page not foundinstead of a cleanCodeValidation.The client guard cannot blanket-reject trailing slashes — legit roots like
/contents/end that way — so the fix belongs at the tool layer: reject empty required string fields (owner,name, …) inparseArgs/per-tool before calling the client, returningCodeValidationwith the missing field name.Low priority:
nameis schema-required so a compliant caller never hits this, and the result is now a benign 404, not the misleading swagger-404. Defense-in-depth + clearer error.Done in v0.4.2 (commit on
main).parseArgsnow validates, via reflection, thatrepo/namestring args are non-empty and returns a typedErrValidationnaming the field — before the client builds a trailing-empty/api/v1/repos/{owner}/segment. Optional identifiers opt out with,omitempty(onlycode_search's owner-wide fan-outrepotoday).ownerwas already enforced byallowlist.Check(returns "owner required" on empty).Test
TestEmptyRepoRejectedAsValidation: emptyrepoon an identifier tool and emptynameon a create tool both returnErrValidation.task checkgreen.