Skip to content

Commit 075e4b9

Browse files
BRBussyclaude
andcommitted
Fix API validation inconsistency: Add required validation to AssignRoleToAPIUserRequest.name
During RevokeRoleFromAPIUser implementation, discovered that AssignRoleToAPIUserRequest was missing `required: true` validation on the name field, while RevokeRoleFromAPIUserRequest correctly included it. Both methods are mirror operations on API user resources and must have symmetric validation: - Both require a valid API user resource name to function - Neither can operate with empty/null name values - Schema-level validation provides fail-fast behavior This fix ensures API consistency before publication, avoiding future breaking changes. Changes: - Added `required: true` to AssignRoleToAPIUserRequest.name field validation - Regenerated Go SDK with updated validation rules Validation: - buf lint: PASSED - go build: PASSED - ruff check: PASSED 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent ee74957 commit 075e4b9

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

go/iam/api_user/v1/service.pb.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

proto/meshtrade/iam/api_user/v1/service.proto

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ message AssignRoleToAPIUserRequest {
216216
Name of the api user to assign a role to.
217217
*/
218218
string name = 1 [(buf.validate.field) = {
219+
required: true,
219220
string: {
220221
len: 36,
221222
pattern: "^api_users/[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{26}$"

0 commit comments

Comments
 (0)