fix: validate UUID in user Enable and Disable RPCs by whoAbhishekSah · Pull Request #1439 · raystack/frontier

@whoAbhishekSah @claude

The Enable and Disable methods in the user service were passing the
user ID directly to the repository without validating it is a valid
UUID. This caused invalid IDs to reach PostgreSQL and return confusing
"not found" errors instead of proper "invalid ID" errors.

Add UUID validation using utils.IsValidUUID() at the start of both
methods, consistent with how GetByID and Update already validate.
The handlers already map ErrInvalidID to CodeInvalidArgument, so
callers now correctly receive a 400 Bad Request for invalid UUIDs.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@whoAbhishekSah whoAbhishekSah changed the title fix: validate UUID in user Enable and Disable APIs fix: validate UUID in user Enable and Disable RPCs

Mar 5, 2026

rohilsurana