-
Notifications
You must be signed in to change notification settings - Fork 109
Allow users to update their own password with kci
tool
#2048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Paweł Wieczorek <pawiecz@collabora.com>
Add command to change user's password. Sample command is as below: `./kci user change_password --username admin` Signed-off-by: Paweł Wieczorek <pawiecz@collabora.com>
This PR adds features required for kernelci/kernelci-api#298 that were missing in kernelci/kernelci-api#320. |
Yes, |
Signed-off-by: Paweł Wieczorek <pawiecz@collabora.com>
Signed-off-by: Paweł Wieczorek <pawiecz@collabora.com>
TODOs resolved. Patch retested manually (I have to look into test automation/gating in this repo), aligned with messages from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's missing the abstract method in the base API class, right? I only see the concrete method in the latest
version.
'/password', | ||
{ | ||
'current_password': {'password': current}, | ||
'new_password': {'password': new}, | ||
}, | ||
{ | ||
'username': username, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now I'm wondering if having /password/<username>
would be a better design for the API endpoint. But that's just an implementation detail, wanted to share it here as a thought.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or /<username>/password
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or
/<username>/password
)
+1 on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the original idea was that the username wasn't required if the query was using an API token for authentication. But since it requires the old password we don't rely on a token so the user endpoint makes more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(or
/<username>/password
)+1 on this.
Do you mean a new API path or should it be a part of /user
, i.e. /user/<username>/password
?
I can adjust it to also accept API token instead of only the old password.
Alright we can merge this now, and add the abstract method in the base class as a follow-up. |
This PR depends on changes from kernelci/kernelci-api#320.
Changes have been tested against local instance of API.
Two TODOs left in the command implementation might be blockers for merging this change.Fixes kernelci/kernelci-api#298