mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 08:27:38 +00:00
user: implement ListUsersByMetadata endpoint
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"connectrpc.com/connect"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/filter/v2"
|
||||
object "github.com/zitadel/zitadel/internal/api/grpc/object/v2beta"
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/user/v2beta/convert"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
@@ -42,5 +43,20 @@ func (s *Server) ListUsers(ctx context.Context, req *connect.Request[user.ListUs
|
||||
}
|
||||
|
||||
func (s *Server) ListUsersByMetadata(ctx context.Context, req *connect.Request[user.ListUsersByMetadataRequest]) (*connect.Response[user.ListUsersByMetadataResponse], error) {
|
||||
return nil, nil
|
||||
queries, err := convert.ListUsersByMetadataRequestToModel(req.Msg, s.systemDefaults)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
res, err := s.query.SearchUsersByMetadata(ctx, queries, s.checkPermission)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &connect.Response[user.ListUsersByMetadataResponse]{
|
||||
Msg: &user.ListUsersByMetadataResponse{
|
||||
Users: convert.UsersByMetadataModelToGRPC(res.UsersByMeta, s.assetAPIPrefix(ctx)),
|
||||
Pagination: filter.QueryToPaginationPb(queries.SearchRequest, res.SearchResponse),
|
||||
},
|
||||
}, nil
|
||||
}
|
||||
|
@@ -10,6 +10,7 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/api/authz"
|
||||
"github.com/zitadel/zitadel/internal/api/grpc/server"
|
||||
"github.com/zitadel/zitadel/internal/command"
|
||||
"github.com/zitadel/zitadel/internal/config/systemdefaults"
|
||||
"github.com/zitadel/zitadel/internal/crypto"
|
||||
"github.com/zitadel/zitadel/internal/domain"
|
||||
"github.com/zitadel/zitadel/internal/query"
|
||||
@@ -30,6 +31,8 @@ type Server struct {
|
||||
assetAPIPrefix func(context.Context) string
|
||||
|
||||
checkPermission domain.PermissionCheck
|
||||
|
||||
systemDefaults systemdefaults.SystemDefaults
|
||||
}
|
||||
|
||||
type Config struct{}
|
||||
|
Reference in New Issue
Block a user