Repository navigation
fix(settings): reject empty app password names - #65762
Conversation
5ee1239 to
36a213b
Compare
|
Rebased onto master to resolve the conflict with the TokenScopes changes in update(). The fix itself is unchanged. |
come-nc
left a comment
There was a problem hiding this comment.
Shouldn’t we trim the name at the beginning then, to forbid confusing spaces at start&end ?
Good point, done. The name is now trimmed on create and on rename. On update it's only trimmed when the name actually changes, so existing tokens whose names already have surrounding spaces aren't renamed when only the scope is changed. |
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
@MarioPym please rebase |
Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Mario Alfonso Pym Mejía <pymm@hitss.com>
Assisted-by: ClaudeCode:claude-opus-5-5 Signed-off-by: Mario Alfonso Pym Mejía <pymm@hitss.com>
5b05338 to
20900d4
Compare
|
Rebased onto master, thanks! |
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
Summary
An app password can be renamed to an empty or whitespace-only name: the request returns 200 and the token is saved without a visible name in the list. On creation, an empty name is already rejected, but a whitespace-only name is accepted.
update()now returns 400 when the new name is empty after trimming, before anything is changed, so the frontend shows its existing error and restores the previous name. Tokens that already have an empty name can still change their filesystem scope, since the check only applies when the name changes.create()now also treats a whitespace-only name as empty and keeps the existing 503 response.How to test
Checklist
3. to review, feature component)stable32)AI (if applicable)