Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: remove the type filter for user api (#19307)

ecmadao2d2e70b37028
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yaml
index e25e522a0d..63b4eabd52 100644
--- a/backend/api/mcp/gen/openapi.yaml
+++ b/backend/api/mcp/gen/openapi.yaml
@@ -12600,7 +12600,6 @@ components:
Supported filter:
- name: the user name, support "==" and ".matches()" operator.
- email: the user email, support "==" and ".matches()" operator.
- - user_type: the type, check UserType enum for values, support "USER", "SERVICE_ACCOUNT", or "WORKLOAD_IDENTITY" value, support "==" and "in [xx]" operator.
- state: check State enum for values, support "==" operator.
- project: the project full name in "projects/{id}" format, support "==" operator.
@@ -12609,8 +12608,6 @@ components:
name.matches("ed")
email == "[email protected]"
email.matches("ed")
- user_type == "USER"
- user_type in ["SERVICE_ACCOUNT", "USER"]
state == "DELETED"
project == "projects/sample-project"
You can combine filter conditions like:
diff --git a/backend/api/v1/user_service.go b/backend/api/v1/user_service.go
index 248edba5ab..62e3f5b1f1 100644
--- a/backend/api/v1/user_service.go
+++ b/backend/api/v1/user_service.go
@@ -143,7 +143,6 @@ func (s *UserService) ListUsers(ctx context.Context, request *connect.Request[v1
}
find.FilterQ = filterResult.Query
find.ProjectID = filterResult.ProjectID
- find.UserTypes = &filterResult.UserTypes
if v := find.ProjectID; v != nil {
user, ok := GetUserFromContext(ctx)
@@ -159,7 +158,7 @@ func (s *UserService) ListUsers(ctx context.Context, request *connect.Request[v1
}
}
- users, err := s.store.ListUsers(ctx, find)
+ users, err := s.store.ListEndUsers(ctx, find)
if err != nil {
return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to list user"))
}
diff --git a/backend/generated-go/v1/user_service.pb.go b/backend/generated-go/v1/user_service.pb.go
index 6be562fd74..9d5fec3da6 100644
--- a/backend/generated-go/v1/user_service.pb.go
+++ b/backend/generated-go/v1/user_service.pb.go
@@ -290,7 +290,6 @@ type ListUsersRequest struct {
// Supported filter:
// - name: the user name, support "==" and ".matches()" operator.
// - email: the user email, support "==" and ".matches()" operator.
- // - user_type: the type, check UserType enum for values, support "USER", "SERVICE_ACCOUNT", or "WORKLOAD_IDENTITY" value, support "==" and "in [xx]" operator.
// - state: check State enum for values, support "==" operator.
// - project: the project full name in "projects/{id}" format, support "==" operator.
//
@@ -299,8 +298,6 @@ type ListUsersRequest struct {
// name.matches("ed")
// email == "[email protected]"
// email.matches("ed")
- // user_type == "USER"
- // user_type in ["SERVICE_ACCOUNT", "USER"]
// state == "DELETED"
// project == "projects/sample-project"
// You can combine filter conditions like:
diff --git a/backend/store/principal_end_user.go b/backend/store/principal_end_user.go
index 1f4ac64fdc..e02a62feec 100644
--- a/backend/store/principal_end_user.go
+++ b/backend/store/principal_end_user.go
@@ -11,18 +11,6 @@ import (
storepb "github.com/bytebase/bytebase/backend/generated-go/store"
)
-// FindEndUserMessage is the message for finding end users.
-type FindEndUserMessage struct {
- ID *int
- Email *string
- ShowDeleted bool
- Limit *int
- Offset *int
- FilterQ *qb.Query
- // ProjectID is used for IAM policy JOIN filtering (finds users "referenced in" a project's IAM).
- ProjectID *string
-}
-
// GetEndUserByEmail gets an end user by email.
func (s *Store) GetEndUserByEmail(ctx context.Context, email string) (*UserMessage, error) {
if v, ok := s.userEmailCache.Get(email); ok && s.enableCache {
@@ -32,7 +20,7 @@ func (s *Store) GetEndUserByEmail(ctx context.Context, email string) (*UserMessa
return nil, nil
}
- users, err := s.listEndUsers(ctx, &FindEndUserMessage{Email: &email, ShowDeleted: true})
+ users, err := s.ListEndUsers(ctx, &FindUserMessage{Email: &email, ShowDeleted: true})
if err != nil {
return nil, err
}
@@ -43,21 +31,12 @@ func (s *Store) GetEndUserByEmail(ctx context.Context, email string) (*UserMessa
}
// listEndUsers lists end users.
-func (s *Store) listEndUsers(ctx context.Context, find *FindEndUserMessage) ([]*UserMessage, error) {
+func (s *Store) ListEndUsers(ctx context.Context, find *FindUserMessage) ([]*UserMessage, error) {
userTypes := []storepb.PrincipalType{
storepb.PrincipalType_END_USER,
}
- findUser := &FindUserMessage{
- ID: find.ID,
- Email: find.Email,
- ShowDeleted: find.ShowDeleted,
- Limit: find.Limit,
- Offset: find.Offset,
- FilterQ: find.FilterQ,
- ProjectID: find.ProjectID,
- UserTypes: &userTypes,
- }
- return s.ListUsers(ctx, findUser)
+ find.UserTypes = &userTypes
+ return s.ListUsers(ctx, find)
}
// CreateEndUser creates an end user.
diff --git a/backend/store/principal_filter.go b/backend/store/principal_filter.go
index 5211992046..d8c52546e7 100644
--- a/backend/store/principal_filter.go
+++ b/backend/store/principal_filter.go
@@ -11,7 +11,6 @@ import (
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/common/qb"
- storepb "github.com/bytebase/bytebase/backend/generated-go/store"
v1pb "github.com/bytebase/bytebase/backend/generated-go/v1"
)
@@ -19,7 +18,6 @@ import (
type GetListUserFilterResult struct {
Query *qb.Query
ProjectID *string
- UserTypes []storepb.PrincipalType
}
// GetAccountListFilterResult contains the filter query for service accounts and workload identities.
@@ -30,11 +28,7 @@ type GetAccountListFilterResult struct {
// GetListUserFilter parses a CEL filter string and returns a query for filtering users.
func GetListUserFilter(filter string) (*GetListUserFilterResult, error) {
if filter == "" {
- return &GetListUserFilterResult{
- UserTypes: []storepb.PrincipalType{
- storepb.PrincipalType_END_USER,
- },
- }, nil
+ return &GetListUserFilterResult{}, nil
}
e, err := cel.NewEnv()
@@ -48,20 +42,6 @@ func GetListUserFilter(filter string) (*GetListUserFilterResult, error) {
var getFilter func(expr celast.Expr) (*qb.Query, error)
var projectID *string
- userTypes := []storepb.PrincipalType{}
-
- convertToPrincipalType := func(v1UserType v1pb.UserType) (storepb.PrincipalType, error) {
- switch v1UserType {
- case v1pb.UserType_USER:
- return storepb.PrincipalType_END_USER, nil
- case v1pb.UserType_SERVICE_ACCOUNT:
- return storepb.PrincipalType_SERVICE_ACCOUNT, nil
- case v1pb.UserType_WORKLOAD_IDENTITY:
- return storepb.PrincipalType_WORKLOAD_IDENTITY, nil
- default:
- return storepb.PrincipalType_END_USER, errors.Errorf("invalid user type %s", v1UserType)
- }
- }
parseToSQL := func(variable, value any) (*qb.Query, error) {
switch variable {
@@ -69,17 +49,6 @@ func GetListUserFilter(filter string) (*GetListUserFilterResult, error) {
return qb.Q().Space("principal.email = ?", value.(string)), nil
case "name":
return qb.Q().Space("principal.name = ?", value.(string)), nil
- case "user_type":
- v1UserType, ok := v1pb.UserType_value[value.(string)]
- if !ok {
- return nil, errors.Errorf("invalid user type filter %q", value)
- }
- principalType, err := convertToPrincipalType(v1pb.UserType(v1UserType))
- if err != nil {
- return nil, errors.Errorf("failed to parse the user type %q with error: %v", v1UserType, err)
- }
- userTypes = append(userTypes, principalType)
- return qb.Q().Space("TRUE"), nil
case "state":
stateStr, ok := value.(string)
if !ok {
@@ -110,35 +79,6 @@ func GetListUserFilter(filter string) (*GetListUserFilterResult, error) {
}
}
- parseToUserTypeSQL := func(expr celast.Expr) (*qb.Query, error) {
- variable, value := getVariableAndValueFromExpr(expr)
- if variable != "user_type" {
- return nil, errors.Errorf(`only "user_type" support "user_type in [xx]"/"!(user_type in [xx])" operator`)
- }
-
- rawTypeList, ok := value.([]any)
- if !ok {
- return nil, errors.Errorf("invalid user_type value %q", value)
- }
- if len(rawTypeList) == 0 {
- return nil, errors.Errorf("empty user_type filter")
- }
-
- for _, rawType := range rawTypeList {
- v1UserType, ok := v1pb.UserType_value[rawType.(string)]
- if !ok {
- return nil, errors.Errorf("invalid user type filter %q", rawType)
- }
- principalType, err := convertToPrincipalType(v1pb.UserType(v1UserType))
- if err != nil {
- return nil, errors.Errorf("failed to parse the user type %q with error: %v", v1UserType, err)
- }
- userTypes = append(userTypes, principalType)
- }
-
- return qb.Q().Space("TRUE"), nil
- }
-
getFilter = func(expr celast.Expr) (*qb.Query, error) {
q := qb.Q()
switch expr.Kind() {
@@ -181,8 +121,6 @@ func GetListUserFilter(filter string) (*GetListUserFilterResult, error) {
return nil, errors.Errorf("expect string, got %T, hint: filter literals should be string", value)
}
return qb.Q().Space("LOWER(principal."+variable+") LIKE ?", "%"+strings.ToLower(strValue)+"%"), nil
- case celoperators.In:
- return parseToUserTypeSQL(expr)
default:
return nil, errors.Errorf("unexpected function %v", functionName)
}
@@ -196,18 +134,9 @@ func GetListUserFilter(filter string) (*GetListUserFilterResult, error) {
return nil, err
}
- if len(userTypes) == 0 {
- // Force to query end users only.
- userTypes = append(
- userTypes,
- storepb.PrincipalType_END_USER,
- )
- }
-
return &GetListUserFilterResult{
Query: qb.Q().Space("(?)", q),
ProjectID: projectID,
- UserTypes: userTypes,
}, nil
}
diff --git a/backend/store/principal_filter_test.go b/backend/store/principal_filter_test.go
index 64fa6f72d2..dbb4438d0a 100644
--- a/backend/store/principal_filter_test.go
+++ b/backend/store/principal_filter_test.go
@@ -4,20 +4,17 @@ import (
"testing"
"github.com/stretchr/testify/require"
-
- storepb "github.com/bytebase/bytebase/backend/generated-go/store"
)
func TestGetListUserFilter(t *testing.T) {
tests := []struct {
- name string
- filter string
- wantSQL string
- wantArgs []any
- wantProject *string
- wantUserTypes []storepb.PrincipalType
- wantErr bool
- errContains string
+ name string
+ filter string
+ wantSQL string
+ wantArgs []any
+ wantProject *string
+ wantErr bool
+ errContains string
}{
{
name: "empty filter",
@@ -25,9 +22,6 @@ func TestGetListUserFilter(t *testing.T) {
wantSQL: "",
wantArgs: nil,
wantErr: false,
- wantUserTypes: []storepb.PrincipalType{
- storepb.PrincipalType_END_USER,
- },
},
{
name: "name filter",
@@ -57,54 +51,6 @@ func TestGetListUserFilter(t *testing.T) {
wantArgs: []any{"%test%"},
wantErr: false,
},
- {
- name: "user_type filter - SERVICE_ACCOUNT",
- filter: `user_type == "SERVICE_ACCOUNT"`,
- wantSQL: "(TRUE)",
- wantArgs: []any{},
- wantErr: false,
- wantUserTypes: []storepb.PrincipalType{
- storepb.PrincipalType_SERVICE_ACCOUNT,
- },
- },
- {
- name: "user_type filter - USER",
- filter: `user_type == "USER"`,
- wantSQL: "(TRUE)",
- wantArgs: []any{},
- wantErr: false,
- wantUserTypes: []storepb.PrincipalType{
- storepb.PrincipalType_END_USER,
- },
- },
- {
- name: "user_type filter - USER and WORKLOAD_IDENTITY",
- filter: `user_type in ["WORKLOAD_IDENTITY", "USER"]`,
- wantSQL: "(TRUE)",
- wantArgs: []any{},
- wantErr: false,
- wantUserTypes: []storepb.PrincipalType{
- storepb.PrincipalType_WORKLOAD_IDENTITY,
- storepb.PrincipalType_END_USER,
- },
- },
- {
- name: "user_type in list",
- filter: `user_type in ["SERVICE_ACCOUNT", "USER"]`,
- wantSQL: "(TRUE)",
- wantArgs: []any{},
- wantErr: false,
- wantUserTypes: []storepb.PrincipalType{
- storepb.PrincipalType_SERVICE_ACCOUNT,
- storepb.PrincipalType_END_USER,
- },
- },
- {
- name: "user_type not in list",
- filter: `!(user_type in ["SERVICE_ACCOUNT"])`,
- wantErr: true,
- errContains: "unexpected function",
- },
{
name: "state filter - STATE_ACTIVE",
filter: `state == "STATE_ACTIVE"`,
@@ -143,13 +89,10 @@ func TestGetListUserFilter(t *testing.T) {
},
{
name: "complex nested condition",
- filter: `(name == "ed" || name == "alice") && user_type == "USER"`,
- wantSQL: "(((principal.name = $1 OR principal.name = $2) AND TRUE))",
+ filter: `(name == "ed" || name == "alice")`,
+ wantSQL: "((principal.name = $1 OR principal.name = $2))",
wantArgs: []any{"ed", "alice"},
wantErr: false,
- wantUserTypes: []storepb.PrincipalType{
- storepb.PrincipalType_END_USER,
- },
},
{
name: "unsupported variable",
@@ -163,12 +106,6 @@ func TestGetListUserFilter(t *testing.T) {
wantErr: true,
errContains: "failed to parse filter",
},
- {
- name: "invalid user type",
- filter: `user_type == "INVALID_TYPE"`,
- wantErr: true,
- errContains: "invalid user type filter",
- },
{
name: "invalid state",
filter: `state == "INVALID_STATE"`,
@@ -199,10 +136,6 @@ func TestGetListUserFilter(t *testing.T) {
require.Nil(t, result.ProjectID)
}
- if len(tt.wantUserTypes) > 0 {
- require.Equal(t, tt.wantUserTypes, result.UserTypes)
- }
-
if query := result.Query; query != nil {
sql, args, err := query.ToSQL()
require.NoError(t, err)
diff --git a/frontend/src/components/AuditLog/AuditLogSearch/AuditLogSearch.vue b/frontend/src/components/AuditLog/AuditLogSearch/AuditLogSearch.vue
index 3c28d82691..e1ef49fd15 100644
--- a/frontend/src/components/AuditLog/AuditLogSearch/AuditLogSearch.vue
+++ b/frontend/src/components/AuditLog/AuditLogSearch/AuditLogSearch.vue
@@ -28,7 +28,6 @@ import { UserNameCell } from "@/components/v2/Model/cells";
import { ALL_METHODS_WITH_AUDIT } from "@/connect/methods";
import { useProjectV1Store, useUserStore } from "@/store";
import { AuditLog_Severity } from "@/types/proto-es/v1/audit_log_service_pb";
-import { UserType } from "@/types/proto-es/v1/user_service_pb";
import {
extractProjectResourceName,
getDefaultPagination,
@@ -110,7 +109,6 @@ const scopeOptions = computed((): ScopeOption[] => {
pageSize: getDefaultPagination(),
showDeleted: true,
filter: {
- types: [UserType.USER],
query: keyword,
},
})
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/Status.vue b/frontend/src/components/IssueV1/components/IssueSearch/Status.vue
index 4f174bda23..7ae11c5bb6 100644
--- a/frontend/src/components/IssueV1/components/IssueSearch/Status.vue
+++ b/frontend/src/components/IssueV1/components/IssueSearch/Status.vue
@@ -17,7 +17,11 @@
import { NTab, NTabs } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
-import { IssueStatus } from "@/types/proto-es/v1/issue_service_pb";
+import { useCurrentUserV1 } from "@/store";
+import {
+ Issue_ApprovalStatus,
+ IssueStatus,
+} from "@/types/proto-es/v1/issue_service_pb";
import type { SearchParams, SearchScope } from "@/utils";
import { getValuesFromSearchParams, upsertScope } from "@/utils";
@@ -30,6 +34,7 @@ const emit = defineEmits<{
}>();
const { t } = useI18n();
+const me = useCurrentUserV1();
const tabItemList = computed(() => {
return [
@@ -72,10 +77,21 @@ const updateStatus = (value: IssueStatus) => {
const scopes: SearchScope[] = [];
let allowMultiple = false;
if (value === IssueStatus.OPEN) {
- scopes.push({
- id: "status",
- value: IssueStatus[IssueStatus.OPEN],
- });
+ scopes.push(
+ {
+ id: "status",
+ value: IssueStatus[IssueStatus.OPEN],
+ },
+ // inject approver/approval filter
+ {
+ id: "current-approver",
+ value: me.value.email,
+ },
+ {
+ id: "approval",
+ value: Issue_ApprovalStatus[Issue_ApprovalStatus.PENDING],
+ }
+ );
} else {
scopes.push(
{
@@ -85,6 +101,15 @@ const updateStatus = (value: IssueStatus) => {
{
id: "status",
value: IssueStatus[IssueStatus.CANCELED],
+ },
+ // clear approver/approval filter
+ {
+ id: "current-approver",
+ value: "",
+ },
+ {
+ id: "approval",
+ value: "",
}
);
allowMultiple = true;
diff --git a/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts b/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts
index 77dc24d263..7cf44bf1c7 100644
--- a/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts
+++ b/frontend/src/components/IssueV1/components/IssueSearch/useIssueSearchScopeOptions.ts
@@ -16,7 +16,6 @@ import {
IssueStatus,
} from "@/types/proto-es/v1/issue_service_pb";
import { type Label } from "@/types/proto-es/v1/project_service_pb";
-import { UserType } from "@/types/proto-es/v1/user_service_pb";
import type { SearchParams, SearchScopeId } from "@/utils";
import { getDefaultPagination } from "@/utils";
@@ -63,7 +62,7 @@ export const useIssueSearchScopeOptions = (
const commonScopeOptions = useCommonSearchScopeOptions(supportOptionIdList);
- const searchPrincipalSearchValueOptions = (userTypes: UserType[]) => {
+ const searchPrincipalSearchValueOptions = () => {
return ({
keyword,
nextPageToken,
@@ -76,7 +75,6 @@ export const useIssueSearchScopeOptions = (
pageToken: nextPageToken,
pageSize: getDefaultPagination(),
filter: {
- types: userTypes,
query: keyword,
},
})
@@ -160,11 +158,7 @@ export const useIssueSearchScopeOptions = (
id: "creator",
title: t("issue.advanced-search.scope.creator.title"),
description: t("issue.advanced-search.scope.creator.description"),
- search: searchPrincipalSearchValueOptions([
- UserType.USER,
- UserType.SERVICE_ACCOUNT,
- UserType.WORKLOAD_IDENTITY,
- ]),
+ search: searchPrincipalSearchValueOptions(),
},
{
id: "current-approver",
@@ -172,10 +166,7 @@ export const useIssueSearchScopeOptions = (
description: t(
"issue.advanced-search.scope.current-approver.description"
),
- search: searchPrincipalSearchValueOptions([
- UserType.USER,
- UserType.SERVICE_ACCOUNT,
- ]),
+ search: searchPrincipalSearchValueOptions(),
},
{
id: "issue-label",
diff --git a/frontend/src/components/v2/Select/AccountSelect.vue b/frontend/src/components/v2/Select/AccountSelect.vue
index 8846671d80..b4f8baac36 100644
--- a/frontend/src/components/v2/Select/AccountSelect.vue
+++ b/frontend/src/components/v2/Select/AccountSelect.vue
@@ -383,7 +383,6 @@ const handleSearchUser = async (params: {
filter: {
query: params.search,
project: props.projectName,
- types: [UserType.USER],
},
pageToken: params.pageToken,
pageSize: params.pageSize,
diff --git a/frontend/src/components/v2/Select/UserSelect.vue b/frontend/src/components/v2/Select/UserSelect.vue
index 6e4c0cdf4a..7f18b6ea46 100644
--- a/frontend/src/components/v2/Select/UserSelect.vue
+++ b/frontend/src/components/v2/Select/UserSelect.vue
@@ -22,7 +22,7 @@ import { computed } from "vue";
import { HighlightLabelText } from "@/components/v2";
import { UserNameCell } from "@/components/v2/Model/cells";
import { getUserFullNameByType, useUserStore } from "@/store";
-import { type User, UserType } from "@/types/proto-es/v1/user_service_pb";
+import { type User } from "@/types/proto-es/v1/user_service_pb";
import { hasWorkspacePermissionV2 } from "@/utils";
import RemoteResourceSelector from "./RemoteResourceSelector/index.vue";
import type {
@@ -91,7 +91,6 @@ const handleSearch = async (params: {
filter: {
query: params.search,
project: props.projectName,
- types: [UserType.USER],
},
pageToken: params.pageToken,
pageSize: params.pageSize,
diff --git a/frontend/src/store/modules/user.ts b/frontend/src/store/modules/user.ts
index ea47671a11..508391375b 100644
--- a/frontend/src/store/modules/user.ts
+++ b/frontend/src/store/modules/user.ts
@@ -34,7 +34,6 @@ import { usePermissionStore } from "./v1/permission";
export interface UserFilter {
query?: string;
- types?: UserType[];
project?: string;
state?: State;
}
@@ -45,11 +44,6 @@ const getListUserFilter = (params: UserFilter) => {
if (search) {
filter.push(`(name.matches("${search}") || email.matches("${search}"))`);
}
- if (params.types) {
- filter.push(
- `user_type in [${params.types.map((t) => `"${UserType[t]}"`).join(", ")}]`
- );
- }
if (isValidProjectName(params.project)) {
filter.push(`project == "${params.project}"`);
}
diff --git a/frontend/src/types/proto-es/v1/user_service_pb.d.ts b/frontend/src/types/proto-es/v1/user_service_pb.d.ts
index db515140c1..95d1a1c2d0 100644
--- a/frontend/src/types/proto-es/v1/user_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/user_service_pb.d.ts
@@ -107,7 +107,6 @@ export declare type ListUsersRequest = Message<"bytebase.v1.ListUsersRequest"> &
* Supported filter:
* - name: the user name, support "==" and ".matches()" operator.
* - email: the user email, support "==" and ".matches()" operator.
- * - user_type: the type, check UserType enum for values, support "USER", "SERVICE_ACCOUNT", or "WORKLOAD_IDENTITY" value, support "==" and "in [xx]" operator.
* - state: check State enum for values, support "==" operator.
* - project: the project full name in "projects/{id}" format, support "==" operator.
*
@@ -116,8 +115,6 @@ export declare type ListUsersRequest = Message<"bytebase.v1.ListUsersRequest"> &
* name.matches("ed")
* email == "[email protected]"
* email.matches("ed")
- * user_type == "USER"
- * user_type in ["SERVICE_ACCOUNT", "USER"]
* state == "DELETED"
* project == "projects/sample-project"
* You can combine filter conditions like:
diff --git a/frontend/src/views/SettingWorkspaceUsers.vue b/frontend/src/views/SettingWorkspaceUsers.vue
index b4a3202512..f34b02da30 100644
--- a/frontend/src/views/SettingWorkspaceUsers.vue
+++ b/frontend/src/views/SettingWorkspaceUsers.vue
@@ -396,7 +396,6 @@ const fetchUserList = async ({
pageSize,
filter: {
query: state.activeUserFilterText,
- types: [UserType.USER],
},
});
return { list: users, nextPageToken };
@@ -415,7 +414,6 @@ const fetchInactiveUserList = async ({
filter: {
query: state.inactiveUserFilterText,
state: State.DELETED,
- types: [UserType.USER],
},
});
return { list: users, nextPageToken };
diff --git a/frontend/src/views/project/ProjectPlanDashboard.vue b/frontend/src/views/project/ProjectPlanDashboard.vue
index 788587c702..5a6a68e009 100644
--- a/frontend/src/views/project/ProjectPlanDashboard.vue
+++ b/frontend/src/views/project/ProjectPlanDashboard.vue
@@ -93,7 +93,6 @@ import {
} from "@/store/modules/v1/plan";
import { isValidDatabaseGroupName } from "@/types";
import { type Plan, type Plan_Spec } from "@/types/proto-es/v1/plan_service_pb";
-import { UserType } from "@/types/proto-es/v1/user_service_pb";
import {
extractDatabaseGroupName,
extractDatabaseResourceName,
@@ -168,7 +167,7 @@ const scopeOptions = computed((): ScopeOption[] => {
const renderSpan = (text: string) => h("span", text);
- const searchPrincipalSearchValueOptions = (userTypes: UserType[]) => {
+ const searchPrincipalSearchValueOptions = () => {
return ({
keyword,
nextPageToken,
@@ -181,7 +180,6 @@ const scopeOptions = computed((): ScopeOption[] => {
pageToken: nextPageToken,
pageSize: getDefaultPagination(),
filter: {
- types: userTypes,
query: keyword,
},
})
@@ -214,11 +212,7 @@ const scopeOptions = computed((): ScopeOption[] => {
id: "creator",
title: t("issue.advanced-search.scope.creator.title"),
description: t("issue.advanced-search.scope.creator.description"),
- search: searchPrincipalSearchValueOptions([
- UserType.USER,
- UserType.SERVICE_ACCOUNT,
- UserType.WORKLOAD_IDENTITY,
- ]),
+ search: searchPrincipalSearchValueOptions(),
};
const stateOption: ScopeOption = {
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index f6673ba3c5..3710e2ed5a 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -13522,7 +13522,6 @@ paths:
Supported filter:
- name: the user name, support "==" and ".matches()" operator.
- email: the user email, support "==" and ".matches()" operator.
- - user_type: the type, check UserType enum for values, support "USER", "SERVICE_ACCOUNT", or "WORKLOAD_IDENTITY" value, support "==" and "in [xx]" operator.
- state: check State enum for values, support "==" operator.
- project: the project full name in "projects/{id}" format, support "==" operator.
@@ -13531,8 +13530,6 @@ paths:
name.matches("ed")
email == "[email protected]"
email.matches("ed")
- user_type == "USER"
- user_type in ["SERVICE_ACCOUNT", "USER"]
state == "DELETED"
project == "projects/sample-project"
You can combine filter conditions like:
@@ -13548,7 +13545,6 @@ paths:
Supported filter:
- name: the user name, support "==" and ".matches()" operator.
- email: the user email, support "==" and ".matches()" operator.
- - user_type: the type, check UserType enum for values, support "USER", "SERVICE_ACCOUNT", or "WORKLOAD_IDENTITY" value, support "==" and "in [xx]" operator.
- state: check State enum for values, support "==" operator.
- project: the project full name in "projects/{id}" format, support "==" operator.
@@ -13557,8 +13553,6 @@ paths:
name.matches("ed")
email == "[email protected]"
email.matches("ed")
- user_type == "USER"
- user_type in ["SERVICE_ACCOUNT", "USER"]
state == "DELETED"
project == "projects/sample-project"
You can combine filter conditions like:
@@ -21813,7 +21807,6 @@ components:
Supported filter:
- name: the user name, support "==" and ".matches()" operator.
- email: the user email, support "==" and ".matches()" operator.
- - user_type: the type, check UserType enum for values, support "USER", "SERVICE_ACCOUNT", or "WORKLOAD_IDENTITY" value, support "==" and "in [xx]" operator.
- state: check State enum for values, support "==" operator.
- project: the project full name in "projects/{id}" format, support "==" operator.
@@ -21822,8 +21815,6 @@ components:
name.matches("ed")
email == "[email protected]"
email.matches("ed")
- user_type == "USER"
- user_type in ["SERVICE_ACCOUNT", "USER"]
state == "DELETED"
project == "projects/sample-project"
You can combine filter conditions like:
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index d85101e9ed..5058a3d864 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -2387,9 +2387,9 @@ When paginating, all other parameters provided to `ListUsers` must match the cal
| show_deleted | [bool](#bool) | | Show deleted users if specified. |
| filter | [string](#string) | | Filter is used to filter users returned in the list. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec
-Supported filter: - name: the user name, support &#34;==&#34; and &#34;.matches()&#34; operator. - email: the user email, support &#34;==&#34; and &#34;.matches()&#34; operator. - user_type: the type, check UserType enum for values, support &#34;USER&#34;, &#34;SERVICE_ACCOUNT&#34;, or &#34;WORKLOAD_IDENTITY&#34; value, support &#34;==&#34; and &#34;in [xx]&#34; operator. - state: check State enum for values, support &#34;==&#34; operator. - project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
+Supported filter: - name: the user name, support &#34;==&#34; and &#34;.matches()&#34; operator. - email: the user email, support &#34;==&#34; and &#34;.matches()&#34; operator. - state: check State enum for values, support &#34;==&#34; operator. - project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
-For example: name == &#34;ed&#34; name.matches(&#34;ed&#34;) email == &#34;[email protected]&#34; email.matches(&#34;ed&#34;) user_type == &#34;USER&#34; user_type in [&#34;SERVICE_ACCOUNT&#34;, &#34;USER&#34;] state == &#34;DELETED&#34; project == &#34;projects/sample-project&#34; You can combine filter conditions like: name.matches(&#34;ed&#34;) &amp;&amp; project == &#34;projects/sample-project&#34; (name == &#34;ed&#34; || email == &#34;[email protected]&#34;) &amp;&amp; project == &#34;projects/sample-project&#34; |
+For example: name == &#34;ed&#34; name.matches(&#34;ed&#34;) email == &#34;[email protected]&#34; email.matches(&#34;ed&#34;) state == &#34;DELETED&#34; project == &#34;projects/sample-project&#34; You can combine filter conditions like: name.matches(&#34;ed&#34;) &amp;&amp; project == &#34;projects/sample-project&#34; (name == &#34;ed&#34; || email == &#34;[email protected]&#34;) &amp;&amp; project == &#34;projects/sample-project&#34; |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 21dd9386e4..02dc35e000 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -7210,7 +7210,6 @@ The syntax and semantics of CEL are documented at https://github.com/google/cel-
Supported filter:
- name: the user name, support &#34;==&#34; and &#34;.matches()&#34; operator.
- email: the user email, support &#34;==&#34; and &#34;.matches()&#34; operator.
-- user_type: the type, check UserType enum for values, support &#34;USER&#34;, &#34;SERVICE_ACCOUNT&#34;, or &#34;WORKLOAD_IDENTITY&#34; value, support &#34;==&#34; and &#34;in [xx]&#34; operator.
- state: check State enum for values, support &#34;==&#34; operator.
- project: the project full name in &#34;projects/{id}&#34; format, support &#34;==&#34; operator.
@@ -7219,8 +7218,6 @@ name == &#34;ed&#34;
name.matches(&#34;ed&#34;)
email == &#34;[email protected]&#34;
email.matches(&#34;ed&#34;)
-user_type == &#34;USER&#34;
-user_type in [&#34;SERVICE_ACCOUNT&#34;, &#34;USER&#34;]
state == &#34;DELETED&#34;
project == &#34;projects/sample-project&#34;
You can combine filter conditions like:
diff --git a/proto/v1/v1/user_service.proto b/proto/v1/v1/user_service.proto
index 8ae71192c2..34cd28f819 100644
--- a/proto/v1/v1/user_service.proto
+++ b/proto/v1/v1/user_service.proto
@@ -160,7 +160,6 @@ message ListUsersRequest {
// Supported filter:
// - name: the user name, support "==" and ".matches()" operator.
// - email: the user email, support "==" and ".matches()" operator.
- // - user_type: the type, check UserType enum for values, support "USER", "SERVICE_ACCOUNT", or "WORKLOAD_IDENTITY" value, support "==" and "in [xx]" operator.
// - state: check State enum for values, support "==" operator.
// - project: the project full name in "projects/{id}" format, support "==" operator.
//
@@ -169,8 +168,6 @@ message ListUsersRequest {
// name.matches("ed")
// email == "[email protected]"
// email.matches("ed")
- // user_type == "USER"
- // user_type in ["SERVICE_ACCOUNT", "USER"]
// state == "DELETED"
// project == "projects/sample-project"
// You can combine filter conditions like: