feat: user query (#3075)

* user queries

* user query

* user query

* user tests

* remove old code

* user metadata

* cleanup

* fix merge

* cleanup

* cleanup

* fixes
This commit is contained in:
Livio Amstutz
2022-01-20 15:40:25 +01:00
committed by GitHub
parent 087ef8d31c
commit 44d78df4d4
62 changed files with 2597 additions and 2392 deletions

View File

@@ -3,18 +3,19 @@ package auth
import (
"context"
"github.com/caos/zitadel/internal/api/authz"
object_grpc "github.com/caos/zitadel/internal/api/grpc/object"
user_grpc "github.com/caos/zitadel/internal/api/grpc/user"
auth_pb "github.com/caos/zitadel/pkg/grpc/auth"
)
func (s *Server) GetMyProfile(ctx context.Context, req *auth_pb.GetMyProfileRequest) (*auth_pb.GetMyProfileResponse, error) {
profile, err := s.repo.MyProfile(ctx)
profile, err := s.query.GetHumanProfile(ctx, authz.GetCtxData(ctx).UserID)
if err != nil {
return nil, err
}
return &auth_pb.GetMyProfileResponse{
Profile: user_grpc.ProfileToPb(profile),
Profile: user_grpc.ProfileToPb(profile, s.assetsAPIDomain),
Details: object_grpc.ToViewDetailsPb(
profile.Sequence,
profile.CreationDate,