Skip to content

Keystone: User CreateOpts for password field#709

Open
dlaw4608 wants to merge 1 commit intok-orc:mainfrom
dlaw4608:user_password
Open

Keystone: User CreateOpts for password field#709
dlaw4608 wants to merge 1 commit intok-orc:mainfrom
dlaw4608:user_password

Conversation

@dlaw4608
Copy link
Contributor

@dlaw4608 dlaw4608 commented Mar 12, 2026

Fixes: #703

Follow up for User Controller PR that was recently merged #657,
Current Progress:

  • User CreateOpts included for password field works fine (E2E tests passing, password when created will be stored as a SecretRef.

@github-actions github-actions bot added the semver:minor Backwards-compatible change label Mar 12, 2026
@dlaw4608 dlaw4608 changed the title Keystone: User CreateOpts and UpdateOpts for password field Keystone: User CreateOpts for password field Mar 16, 2026
…password as a secret, also included passwordExpiresAt field to user.status.resource

Signed-off-by: Daniel Lawton <dlawton@redhat.com>
@dlaw4608 dlaw4608 marked this pull request as ready for review March 16, 2026 22:09
Copy link
Contributor

@winiciusallan winiciusallan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dlaw4608, thanks for adding this, a very important field for the user controller. I would like to highlight a few things:

  • I believe we need to change the logic to reconcile the password. Testing locally on my environment, I was not able to change the user password by simply changing the value of the password key in the secret. We need to identify a change in the secret upfront and then perform a PATCH operation[1] to properly update the password. We may want to add a new reconciler to the resource. Does it make sense?
  • From a user perspective, I believe it would be good to give the user the ability to pass the password encoded with base64. Testing locally, I chose to use the data key instead of stringData, and the password wasn't changed as expected. Not sure if this is a real requirement, but I would like to highlight this.

[1] https://docs.openstack.org/api-ref/identity/v3/index.html#update-user

edit: I just realized you intended to add only the Create option for passwords. If so, you can ignore the first bullet point at this moment.

name: user-sample
spec:
cloudCredentialsRef:
cloudName: devstack-admin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a change during development. Let's stick with openstack-admin for consistency. Wdyt?

name: user-sample
spec:
cloudCredentialsRef:
cloudName: devstack-admin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here.

spec:
cloudCredentialsRef:
cloudName: openstack-admin
cloudName: devstack-admin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here too :).

Comment on lines +24 to +30
apiVersion: v1
kind: Secret
metadata:
name: user-sample
type: Opaque
stringData:
password: "TestPassword"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
apiVersion: v1
kind: Secret
metadata:
name: user-sample
type: Opaque
stringData:
password: "TestPassword"
apiVersion: v1
kind: Secret
metadata:
name: user-sample
type: Opaque
stringData:
password: "TestPassword"

A few blank spaces at the beginning. Let's remove them for better indentation.


// password is the password set for the user
// +optional
Password *PasswordSpec `json:"password,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we keep it simple and pass the SecretRef directly here? Any advantage of using a struct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on this, not sure there is a point in warping it in an additional struct

Comment on lines +30 to +36
apiVersion: v1
kind: Secret
metadata:
name: user-create-full
type: Opaque
stringData:
password: "TestPassword" No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably you also need to add a new user-dependency-no-password-secret or something like that at 00-create-resources-missing-deps.yaml to properly test the dependency with this secret, and complete the deletion later as well.

Comment on lines +2368 to +2372





Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ooc: why do we have so many blank lines here? 🧐

Copy link
Contributor

@eshulman2 eshulman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very quick and shallow review (need to come back to this one)


handleNameUpdate(&updateOpts, obj, osResource)
handleDescriptionUpdate(&updateOpts, resource, osResource)
handleEnabledUpdate(&updateOpts, resource, osResource)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing password update logic, I would suggest adding it here to allow password changing and address what @winiciusallan was mentioning about password not changing when changing the secret


// password is the password set for the user
// +optional
Password *PasswordSpec `json:"password,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 on this, not sure there is a point in warping it in an additional struct

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

Labels

semver:minor Backwards-compatible change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keystone: Add Password field to User Controller

3 participants