Repository navigation
fix(rbac): spell the group user type db_env_user, as the server does - #624
Open
dudanogueira wants to merge 2 commits into
Open
dudanogueira wants to merge 2 commits into
dudanogueira wants to merge 2 commits into
Conversation
groups/UserType declared its middle value as "db_end_user" -- end, not env. The server's enumeration is ["db_user","db_env_user"] (entities/models/d_b_user_info.go:142), so the constant could never be produced by a read and writing it would emit a value the server rejects. The constant is named DB_ENV_USER, so only the string was wrong. The typo survived because nothing uses this enum: grep across src/main, src/test and src/it finds every reference resolving to rbac/users/UserType, and none to this one. GroupType, in the same package, is used -- the package is not dead, this enum is. That raises whether the right change is deletion rather than correction, since this is an unreferenced duplicate of a type that already handles the value correctly. Left as a correction here because removing a public type is the more invasive call; see #623 for the argument either way. Closes #623 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HNeKV7TAYZGDyT9agqJwUf
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
Collaborator
|
Please remove all comments from this PR and trim the PR description to what is strictly relevant. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the RBAC wire-value correction.
No open issues 🎉
What changed in this PR
Corrects the RBAC groups UserType.DB_ENV_USER wire value to match the server’s db_env_user, addressing #623 while preserving the public enum constant.
Changes:
- Fixes the serialized value from
db_end_usertodb_env_user. - Adds a JSON round-trip test case for
DB_ENV_USER.
| File | Description |
|---|---|
src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java |
Adds round-trip coverage for the corrected wire value. |
src/main/java/io/weaviate/client6/v1/api/rbac/groups/UserType.java |
Corrects the DB_ENV_USER serialization annotation. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
rbac/groups/UserType.DB_ENV_USERmaps to the wire valuedb_end_user, but the server's value isdb_env_user. Reading it givesnull, and writing it sends a value the server rejects.Fix
@SerializedNametodb_env_user. The enum is kept.JSONTestround-trip row.Breaking changes
None. The constant name is unchanged.
Closes #623