mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-21 12:28:46 +00:00
fix(api): correctly handle organization_id on creation (#11396)
# Which Problems Are Solved While moving the some requests from the v2beta organization service to v2, the `org_id` property of the `AddOrganization` request was deprecated in favor of `organization_id`. However, the internal logic was adjusted, resulting in a ingored `organization_id`. # How the Problems Are Solved - properly favor `organization_id` over `org_id` and added a note to the proto. # Additional Changes none # Additional Context - closes #11269 - requires backport to v4.x
This commit is contained in:
@@ -54,6 +54,37 @@ func Test_addOrganizationRequestToCommand(t *testing.T) {
|
||||
OrgID: "org-ID",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "custom organization ID",
|
||||
args: args{
|
||||
request: &org.AddOrganizationRequest{
|
||||
Name: "custom org ID",
|
||||
OrganizationId: gu.Ptr("organization-ID"),
|
||||
},
|
||||
},
|
||||
want: &command.OrgSetup{
|
||||
Name: "custom org ID",
|
||||
CustomDomain: "",
|
||||
Admins: []*command.OrgSetupAdmin{},
|
||||
OrgID: "organization-ID",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "custom organization ID (precedence over org ID)",
|
||||
args: args{
|
||||
request: &org.AddOrganizationRequest{
|
||||
Name: "custom org ID",
|
||||
OrganizationId: gu.Ptr("organization-ID"),
|
||||
OrgId: gu.Ptr("org-ID"), // will be ignored in favor of OrganizationId
|
||||
},
|
||||
},
|
||||
want: &command.OrgSetup{
|
||||
Name: "custom org ID",
|
||||
CustomDomain: "",
|
||||
Admins: []*command.OrgSetupAdmin{},
|
||||
OrgID: "organization-ID",
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "user ID",
|
||||
args: args{
|
||||
|
||||
Reference in New Issue
Block a user