From 8f92e2f74db3a965f608b578d014250f5a70d2f9 Mon Sep 17 00:00:00 2001 From: Duda Nogueira Date: Wed, 9 Sep 2026 18:49:45 -0300 Subject: [PATCH] fix(rbac): spell the group user type db_env_user, as the server does 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) Claude-Session: https://claude.ai/code/session_01HNeKV7TAYZGDyT9agqJwUf --- .../io/weaviate/client6/v1/api/rbac/groups/UserType.java | 2 +- .../java/io/weaviate/client6/v1/internal/json/JSONTest.java | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/weaviate/client6/v1/api/rbac/groups/UserType.java b/src/main/java/io/weaviate/client6/v1/api/rbac/groups/UserType.java index 7a490415d..2058a0f67 100644 --- a/src/main/java/io/weaviate/client6/v1/api/rbac/groups/UserType.java +++ b/src/main/java/io/weaviate/client6/v1/api/rbac/groups/UserType.java @@ -5,7 +5,7 @@ public enum UserType { @SerializedName("db_user") DB_USER, - @SerializedName("db_end_user") + @SerializedName("db_env_user") DB_ENV_USER, @SerializedName("oidc") OIDC diff --git a/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java b/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java index e7c0d6203..ee7cec95d 100644 --- a/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java +++ b/src/test/java/io/weaviate/client6/v1/internal/json/JSONTest.java @@ -2269,6 +2269,12 @@ public static Object[][] testCases() { } """ }, + // groups/UserType: the server's value is "db_env_user" -- see #623 + { + io.weaviate.client6.v1.api.rbac.groups.UserType.class, + io.weaviate.client6.v1.api.rbac.groups.UserType.DB_ENV_USER, + "\"db_env_user\"" + }, }; }