mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:57:33 +00:00
fix: some backend bugs (#1438)
* fix: fix setup * fix oidc app change * fix: fix migration and proto * fix: fix granted projects * setup1 apis instead of apps * fix: add object detail with creation date * fix user phone change * add localizer to AddOIDCAppResponse * fix test * fix domain test * fix: converter Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
@@ -79,7 +79,7 @@ func (s *Server) AddHumanUser(ctx context.Context, req *mgmt_pb.AddHumanUserRequ
|
||||
}
|
||||
return &mgmt_pb.AddHumanUserResponse{
|
||||
UserId: human.AggregateID,
|
||||
Details: obj_grpc.ToDetailsPb(
|
||||
Details: obj_grpc.AddToDetailsPb(
|
||||
human.Sequence,
|
||||
human.ChangeDate,
|
||||
human.ResourceOwner,
|
||||
@@ -94,7 +94,7 @@ func (s *Server) AddMachineUser(ctx context.Context, req *mgmt_pb.AddMachineUser
|
||||
}
|
||||
return &mgmt_pb.AddMachineUserResponse{
|
||||
UserId: machine.AggregateID,
|
||||
Details: obj_grpc.ToDetailsPb(
|
||||
Details: obj_grpc.AddToDetailsPb(
|
||||
machine.Sequence,
|
||||
machine.ChangeDate,
|
||||
machine.ResourceOwner,
|
||||
@@ -108,7 +108,7 @@ func (s *Server) DeactivateUser(ctx context.Context, req *mgmt_pb.DeactivateUser
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.DeactivateUserResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ func (s *Server) ReactivateUser(ctx context.Context, req *mgmt_pb.ReactivateUser
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ReactivateUserResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ func (s *Server) LockUser(ctx context.Context, req *mgmt_pb.LockUserRequest) (*m
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.LockUserResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -138,7 +138,7 @@ func (s *Server) UnlockUser(ctx context.Context, req *mgmt_pb.UnlockUserRequest)
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.UnlockUserResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ func (s *Server) RemoveUser(ctx context.Context, req *mgmt_pb.RemoveUserRequest)
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.RemoveUserResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ func (s *Server) UpdateUserName(ctx context.Context, req *mgmt_pb.UpdateUserName
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.UpdateUserNameResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ func (s *Server) UpdateHumanProfile(ctx context.Context, req *mgmt_pb.UpdateHuma
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.UpdateHumanProfileResponse{
|
||||
Details: obj_grpc.ToDetailsPb(
|
||||
Details: obj_grpc.ChangeToDetailsPb(
|
||||
profile.Sequence,
|
||||
profile.ChangeDate,
|
||||
profile.ResourceOwner,
|
||||
@@ -226,7 +226,7 @@ func (s *Server) UpdateHumanEmail(ctx context.Context, req *mgmt_pb.UpdateHumanE
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.UpdateHumanEmailResponse{
|
||||
Details: obj_grpc.ToDetailsPb(
|
||||
Details: obj_grpc.ChangeToDetailsPb(
|
||||
email.Sequence,
|
||||
email.ChangeDate,
|
||||
email.ResourceOwner,
|
||||
@@ -240,7 +240,7 @@ func (s *Server) ResendHumanInitialization(ctx context.Context, req *mgmt_pb.Res
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ResendHumanInitializationResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(details),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(details),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -250,7 +250,7 @@ func (s *Server) ResendHumanEmailVerification(ctx context.Context, req *mgmt_pb.
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ResendHumanEmailVerificationResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -271,12 +271,12 @@ func (s *Server) GetHumanPhone(ctx context.Context, req *mgmt_pb.GetHumanPhoneRe
|
||||
}
|
||||
|
||||
func (s *Server) UpdateHumanPhone(ctx context.Context, req *mgmt_pb.UpdateHumanPhoneRequest) (*mgmt_pb.UpdateHumanPhoneResponse, error) {
|
||||
phone, err := s.command.ChangeHumanPhone(ctx, UpdateHumanPhoneRequestToDomain(req))
|
||||
phone, err := s.command.ChangeHumanPhone(ctx, UpdateHumanPhoneRequestToDomain(req), authz.GetCtxData(ctx).OrgID)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.UpdateHumanPhoneResponse{
|
||||
Details: obj_grpc.ToDetailsPb(
|
||||
Details: obj_grpc.ChangeToDetailsPb(
|
||||
phone.Sequence,
|
||||
phone.ChangeDate,
|
||||
phone.ResourceOwner,
|
||||
@@ -290,7 +290,7 @@ func (s *Server) RemoveHumanPhone(ctx context.Context, req *mgmt_pb.RemoveHumanP
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.RemoveHumanPhoneResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -300,7 +300,7 @@ func (s *Server) ResendHumanPhoneVerification(ctx context.Context, req *mgmt_pb.
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.ResendHumanPhoneVerificationResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -310,7 +310,7 @@ func (s *Server) SetHumanInitialPassword(ctx context.Context, req *mgmt_pb.SetHu
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.SetHumanInitialPasswordResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -320,7 +320,7 @@ func (s *Server) SendHumanResetPasswordNotification(ctx context.Context, req *mg
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.SendHumanResetPasswordNotificationResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ func (s *Server) RemoveHumanAuthFactorOTP(ctx context.Context, req *mgmt_pb.Remo
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.RemoveHumanAuthFactorOTPResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ func (s *Server) RemoveHumanAuthFactorU2F(ctx context.Context, req *mgmt_pb.Remo
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.RemoveHumanAuthFactorU2FResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -370,7 +370,7 @@ func (s *Server) RemoveHumanPasswordless(ctx context.Context, req *mgmt_pb.Remov
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.RemoveHumanPasswordlessResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -380,7 +380,7 @@ func (s *Server) UpdateMachine(ctx context.Context, req *mgmt_pb.UpdateMachineRe
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.UpdateMachineResponse{
|
||||
Details: obj_grpc.ToDetailsPb(
|
||||
Details: obj_grpc.ChangeToDetailsPb(
|
||||
machine.Sequence,
|
||||
machine.ChangeDate,
|
||||
machine.ResourceOwner,
|
||||
@@ -425,7 +425,7 @@ func (s *Server) AddMachineKey(ctx context.Context, req *mgmt_pb.AddMachineKeyRe
|
||||
return &mgmt_pb.AddMachineKeyResponse{
|
||||
KeyId: key.KeyID,
|
||||
KeyDetails: keyDetails,
|
||||
Details: object.ToDetailsPb(
|
||||
Details: object.AddToDetailsPb(
|
||||
key.Sequence,
|
||||
key.ChangeDate,
|
||||
key.ResourceOwner,
|
||||
@@ -439,7 +439,7 @@ func (s *Server) RemoveMachineKey(ctx context.Context, req *mgmt_pb.RemoveMachin
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.RemoveMachineKeyResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -463,7 +463,7 @@ func (s *Server) RemoveHumanLinkedIDP(ctx context.Context, req *mgmt_pb.RemoveHu
|
||||
return nil, err
|
||||
}
|
||||
return &mgmt_pb.RemoveHumanLinkedIDPResponse{
|
||||
Details: obj_grpc.DomainToDetailsPb(objectDetails),
|
||||
Details: obj_grpc.DomainToChangeDetailsPb(objectDetails),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user