Skip to content

--severity, --category, --domain and --status filters (risks and controls) accept any text and a typo returns an empty list #53

Closed

Description

@d0ubl3g

Measured

  • crates/hodeishield-cli/src/cli.rs:164,196,225,228,260: those filters are String.
  • In the contract they are string with no enum (openapi/v1.json: /v1/alerts → severity, /v1/vendors → category, /v1/risks → domain and status, /v1/compliance/controls → status). The filters that do have an enum in the contract are already validated in the CLI.

Why it matters

Any user: --severity High instead of high returns empty without any warning, and it looks like there is no data.

Acceptance criteria

  • The accepted values are validated in the CLI and appear in --help.
  • An unknown value exits with code 2 and lists the options.

Depends on

A change in the public /v1 API: declare an enum for those parameters.

Activity

  1. d0ubl3g commented on Oct 12, 2026

    @d0ubl3g
    ContributorAuthor

    Done in 0.4.0 (https://github.com/Hodeitek/hodeishield-cli/releases/tag/v0.4.0), by #138 (and the earlier #93, #95, #97), on main at 3405f04. The CLI now follows version 2026-10-16 of the
    API document. The alerts --severity filter lists its values in --help (critical, high, medium, low, info) and warns on
    standard error about a value the API does not list, with a hint when only the case differs. For the deprecated values (critico,
    alto, medio, bajo, accepted until 2027-01-14) it names the replacement. On the second criterion: the API document declares
    these filters as open vocabularies (known values, not an enum), so an unlisted value may still be valid. The CLI therefore warns
    and sends it as typed, instead of refusing it with exit code 2. category, domain and the risk and control status filters
    have no published list yet; they will be checked the same way as soon as the document lists their values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ux-designDesign or user experience

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions