Skip to content

Harden input validation for string fields (empty/whitespace/invalid forms) #4

Description

@rawkode

Problem

Some constructors validate inputs, but several request string fields can still be empty/whitespace/invalid (for example permission, relation, resource_type, subject_type).

Impact

Invalid request values can propagate deeper into execution and fail later with less actionable errors. This increases debugging cost and can produce inconsistent API behavior.

Proposed change

  • Add consistent validation for required string fields across request builders/constructors.
  • Reject empty, whitespace-only, and structurally invalid values.
  • Fail fast with Error::InvalidArgument and field-specific error messages.
  • Add test coverage for valid and invalid inputs across affected request types.

Acceptance criteria

  • All required string request fields are validated consistently.
  • Empty/whitespace/invalid forms return Error::InvalidArgument before request dispatch.
  • Tests verify both rejection cases and valid pass-through behavior.

Activity

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions