fix: 后台登录审计查询按字符串返回用户ID
This commit is contained in:
@@ -100,6 +100,20 @@ func TestGroupMessageQuerySupportsOperationalFilters(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoginAuditQuerySpecsExposeUserIDAsString(t *testing.T) {
|
||||
for label, spec := range map[string]*internalQuerySpec{
|
||||
"user-login-logs": internalTenantResourceSpecs["user-login-logs"],
|
||||
"login-failure-logs": internalTenantResourceSpecs["login-failure-logs"],
|
||||
} {
|
||||
if spec == nil {
|
||||
t.Fatalf("%s query spec missing", label)
|
||||
}
|
||||
if !strings.Contains(spec.Select, "CAST(user_id AS CHAR) AS user_id") {
|
||||
t.Fatalf("%s query must expose 64-bit user IDs as strings: %s", label, spec.Select)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestUserQuerySupportsKeywordAndUserIDs(t *testing.T) {
|
||||
req := httptest.NewRequest("GET", "/?keyword=alice&user_ids=101,202&account_no=1000", nil)
|
||||
query, countQuery, args, _, _, err := buildInternalAdminListQuery(req, usersInternalQuerySpec(), "")
|
||||
|
||||
Reference in New Issue
Block a user