-
Notifications
You must be signed in to change notification settings - Fork 11
rewrite ssh key logic #401
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
fcc616a to
9402c0d
Compare
12d2314 to
feb793b
Compare
53e0bc1 to
affd118
Compare
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.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2238ad5 to
fa2e42f
Compare
537bad1 to
18b1f54
Compare
32ebd66 to
2e52486
Compare
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.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 8 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a93c25e to
8aee5ea
Compare
35d7f90 to
481a6e1
Compare
resources/lib/UnityUser.php
Outdated
| $keys = array_values($keys); | ||
| $this->setSSHKeys($keys, $operator, $send_mail); | ||
| return $key; | ||
| $this->setSSHKeys($keys_after, $operator, $send_mail); |
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.
Should this only be called if the array actually changed?
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 can't find what this was referencing but I don't think this is an issue anymore. Both addSSHKey and removeSSHKey have conditions to break out early before doing an LDAP operation.
e22a230 to
fce31e3
Compare
simplify ssh key adding behavior restructure weird structure wip handle 0 github keys fix bug, return less information less code, better output, slower fix test include key in message shorten key before adding to message message for key removed log + message fix bug fix bug cant rely on error handler for testing add badRequest default case use short key in message consistent operator move logic inside UnityUser expect exception show more characters in shortened key sshkeyexists 1st draft dry multi word comment allow leading whitespace tweak regex, comment simpler regex, valueerror rewrite testValidSSHKey return array fix bug add allowed ssh key types config update test case remove responsibility from addSSHKey update account.php for new testValidSSHKey update ssh_validate for new testValidSSHKey handle ajax failure add tests fix bug fix bugs make error message less promising update test fix require in ajax close other session if exists fix bug only single space use SSHKeyExists() move function tweak comment display invalid key explanation in modal invalid encoding Update webroot/panel/account.php Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> remove unused import remove console.log add tests for shortenString add tests for removing ssh key comment don't log invalid keys update error handler delete key by value instead of by index fixup phpstan fix tests remove old arguments fix tests remove old args remove old arg remove old args
1fd233a to
c666bf4
Compare
before:
after:
[ldap][allowed_ssh_public_key_types]key types are acceptedssh-keygen-style public keys are acceptedScreen.Recording.2025-12-18.at.12.40.14.PM.mov
future work: