Skip to content

[Fix] IAM: Add XuserType and XuserID to users.CreateOpts#938

Open
TobiWo wants to merge 1 commit into
opentelekomcloud:develfrom
TobiWo:hotfix/extend-create-user-struct
Open

[Fix] IAM: Add XuserType and XuserID to users.CreateOpts#938
TobiWo wants to merge 1 commit into
opentelekomcloud:develfrom
TobiWo:hotfix/extend-create-user-struct

Conversation

@TobiWo
Copy link
Copy Markdown

@TobiWo TobiWo commented May 21, 2026

What this PR does / why we need it

Add XuserType and XuserID fields to CreateOpts in openstack/identity/v3.0/users/CreateUser.go.

The OTC IAM API (POST /v3.0/OS-USER/users) accepts xuser_type and xuser_id in the request body. Both fields are already present in the User response struct and in UpdateAdminOpts, but missing from CreateOpts. This forces callers to issue a second ModifyUserAdmin call after creation to set the external identity fields, which is non-atomic.

With this change, callers can set XuserType and XuserID in a single create call.

Which issue this PR fixes

fixes #937

Special notes for your reviewer

  • Both fields use omitempty so the request body is unchanged for existing
    callers that do not set these fields -> no breaking change.
  • Field names and json tags match the existing convention used in
    UpdateAdminOpts (xuser_type, xuser_id).

Note

A follow-up PR will be created for the terraform-provider itself so that resource opentelekomcloud_identity_user_v3 will make use of the updated struct.

@TobiWo
Copy link
Copy Markdown
Author

TobiWo commented May 22, 2026

Hi @anton-sidelnikov , this PR needs review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IAM] Add xuser_type and xuser_id fields to CreateOpts

1 participant