mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 04:57:33 +00:00
fix(user fields): missing creationDate in details (#9250)
# Which Problems Are Solved The `creationDate` property on user search V2 endpoint was missing # How the Problems Are Solved Added property in v2 `object.proto` and in the function creating the details on each call # Additional Changes - none # Additional Context closes #8552 --------- Co-authored-by: Stefan Benz <46600784+stebenz@users.noreply.github.com>
This commit is contained in:
@@ -150,6 +150,7 @@ func TestServer_GetUserByID(t *testing.T) {
|
||||
},
|
||||
Details: &object.Details{
|
||||
ChangeDate: timestamppb.Now(),
|
||||
CreationDate: timestamppb.Now(),
|
||||
ResourceOwner: orgResp.OrganizationId,
|
||||
},
|
||||
},
|
||||
@@ -195,6 +196,7 @@ func TestServer_GetUserByID(t *testing.T) {
|
||||
},
|
||||
Details: &object.Details{
|
||||
ChangeDate: timestamppb.Now(),
|
||||
CreationDate: timestamppb.Now(),
|
||||
ResourceOwner: orgResp.OrganizationId,
|
||||
},
|
||||
},
|
||||
@@ -282,6 +284,7 @@ func TestServer_GetUserByID_Permission(t *testing.T) {
|
||||
},
|
||||
Details: &object.Details{
|
||||
ChangeDate: timestamppb.Now(),
|
||||
CreationDate: timestamppb.Now(),
|
||||
ResourceOwner: newOrg.GetOrganizationId(),
|
||||
},
|
||||
},
|
||||
@@ -320,6 +323,7 @@ func TestServer_GetUserByID_Permission(t *testing.T) {
|
||||
},
|
||||
Details: &object.Details{
|
||||
ChangeDate: timestamppb.Now(),
|
||||
CreationDate: timestamppb.Now(),
|
||||
ResourceOwner: newOrg.GetOrganizationId(),
|
||||
},
|
||||
},
|
||||
@@ -415,6 +419,8 @@ func createUser(ctx context.Context, orgID string, passwordChangeRequired bool)
|
||||
phone := "+41" + gofakeit.Phone()
|
||||
resp := Instance.CreateHumanUserVerified(ctx, orgID, username, phone)
|
||||
info := userAttr{resp.GetUserId(), username, phone, nil, resp.GetDetails()}
|
||||
// as the change date of the creation is the creation date
|
||||
resp.Details.CreationDate = resp.GetDetails().GetChangeDate()
|
||||
if passwordChangeRequired {
|
||||
details := Instance.SetUserPassword(ctx, resp.GetUserId(), integration.UserPassword, true)
|
||||
info.Changed = details.GetChangeDate()
|
||||
|
Reference in New Issue
Block a user