feat(/internal): Add User Resource Owner (#9168)

Update the  ../proto/zitadel/member.proto to
include the UserResourceOwner as part of member.

Update the queries to include UserResourceOwner
for the following :
zitadel/internal/query/iam_member.go
zitadel/internal/query/org_member.go
zitadel/internal/query/project_member.go
zitadel/internal/query/project_grant_member.go

Non Breaking Changes

# Which Problems Are Solved

https://github.com/zitadel/zitadel/issues/5062

# How the Problems Are Solved

- Updated the member.proto file to include user_resource_owner. I have
compiled using` make compile` command .
- Changed the queries to include the userResourceOwner as part of
Member.
- Then, updated the converter to map the userResourceOwner.

# Additional Changes

Replace this example text with a concise list of additional changes that
this PR introduces, that are not directly solving the initial problem
but are related.
For example:
- The docs explicitly describe that the property XY is mandatory
- Adds missing translations for validations.

# Additional Context


- Closes #5062 
-
https://discordapp.com/channels/927474939156643850/1326245856193544232/1326476710752948316
This commit is contained in:
MAHANTH-wq
2025-01-15 14:10:30 +05:30
committed by GitHub
parent d01d003a03
commit b664ffe993
11 changed files with 78 additions and 5 deletions

View File

@@ -18,6 +18,7 @@ var (
", members.change_date" +
", members.sequence" +
", members.resource_owner" +
", members.user_resource_owner" +
", members.user_id" +
", members.roles" +
", projections.login_names3.login_name" +
@@ -49,6 +50,7 @@ var (
"change_date",
"sequence",
"resource_owner",
"user_resource_owner",
"user_id",
"roles",
"login_name",
@@ -101,6 +103,7 @@ func Test_ProjectMemberPrepares(t *testing.T) {
testNow,
uint64(20211206),
"ro",
"uro",
"user-id",
database.TextArray[string]{"role-1", "role-2"},
"gigi@caos-ag.zitadel.ch",
@@ -125,6 +128,7 @@ func Test_ProjectMemberPrepares(t *testing.T) {
ChangeDate: testNow,
Sequence: 20211206,
ResourceOwner: "ro",
UserResourceOwner: "uro",
UserID: "user-id",
Roles: database.TextArray[string]{"role-1", "role-2"},
PreferredLoginName: "gigi@caos-ag.zitadel.ch",
@@ -151,6 +155,7 @@ func Test_ProjectMemberPrepares(t *testing.T) {
testNow,
uint64(20211206),
"ro",
"uro",
"user-id",
database.TextArray[string]{"role-1", "role-2"},
"machine@caos-ag.zitadel.ch",
@@ -175,6 +180,7 @@ func Test_ProjectMemberPrepares(t *testing.T) {
ChangeDate: testNow,
Sequence: 20211206,
ResourceOwner: "ro",
UserResourceOwner: "uro",
UserID: "user-id",
Roles: database.TextArray[string]{"role-1", "role-2"},
PreferredLoginName: "machine@caos-ag.zitadel.ch",
@@ -201,6 +207,7 @@ func Test_ProjectMemberPrepares(t *testing.T) {
testNow,
uint64(20211206),
"ro",
"uro",
"user-id-1",
database.TextArray[string]{"role-1", "role-2"},
"gigi@caos-ag.zitadel.ch",
@@ -217,6 +224,7 @@ func Test_ProjectMemberPrepares(t *testing.T) {
testNow,
uint64(20211206),
"ro",
"uro",
"user-id-2",
database.TextArray[string]{"role-1", "role-2"},
"machine@caos-ag.zitadel.ch",
@@ -241,6 +249,7 @@ func Test_ProjectMemberPrepares(t *testing.T) {
ChangeDate: testNow,
Sequence: 20211206,
ResourceOwner: "ro",
UserResourceOwner: "uro",
UserID: "user-id-1",
Roles: database.TextArray[string]{"role-1", "role-2"},
PreferredLoginName: "gigi@caos-ag.zitadel.ch",
@@ -256,6 +265,7 @@ func Test_ProjectMemberPrepares(t *testing.T) {
ChangeDate: testNow,
Sequence: 20211206,
ResourceOwner: "ro",
UserResourceOwner: "uro",
UserID: "user-id-2",
Roles: database.TextArray[string]{"role-1", "role-2"},
PreferredLoginName: "machine@caos-ag.zitadel.ch",