mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:37:34 +00:00
feat: allow machine user id to be set during creation (#8265)
# Which Problems Are Solved Solves the problem described in #8264. # How the Problems Are Solved Added a UserID field which can be set during Machine User creation. # Additional Changes Added addition unit and integration tests to cover the cases where a UserID field is present. # Additional Context - Closes #8264 Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
This commit is contained in:
@@ -133,8 +133,14 @@ func ImportHumanUserRequestToDomain(req *mgmt_pb.ImportHumanUserRequest) (human
|
||||
}
|
||||
|
||||
func AddMachineUserRequestToCommand(req *mgmt_pb.AddMachineUserRequest, resourceowner string) *command.Machine {
|
||||
userId := ""
|
||||
if req.UserId != nil {
|
||||
userId = *req.UserId
|
||||
}
|
||||
|
||||
return &command.Machine{
|
||||
ObjectRoot: models.ObjectRoot{
|
||||
AggregateID: userId,
|
||||
ResourceOwner: resourceowner,
|
||||
},
|
||||
Username: req.UserName,
|
||||
|
Reference in New Issue
Block a user