Skip to content
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

Fix emtpy list of authorized_keys in /ssh endpoint #1893

Merged
merged 2 commits into from
Jan 25, 2024

Conversation

ogayot
Copy link
Member

@ogayot ogayot commented Jan 24, 2024

The /ssh endpoint was, I think, meant to return a list of authorized_keys but it didn't.

Fixed the issue and also removed a variable that probably has been unused for years now.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
The SSHModel contained a ssh_import_id member variable. According to the
comment, it was originally meant to store meta-data about a SSH key ;
and was supposed to allow showing some sort of info back in the SSH view
if the user decides to go back.

I suspect that this variable has been unused for a long time.
Furthermore, it can only hold information about a single SSH key and we
support multiple keys..

Let's get rid of it.

Signed-off-by: Olivier Gayot <olivier.gayot@canonical.com>
Copy link
Collaborator

@mwhudson mwhudson left a comment

Choose a reason for hiding this comment

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

Eh well. The return type of the GET is only the same as POST out of laziness really I think. This is more correct though and would help enable a better interface on the client side (really the client UI should let you download as many keys as you want to and then allow you to proceed rather than fetching as part of moving to the next screen...)

@ogayot
Copy link
Member Author

ogayot commented Jan 25, 2024

enable a better interface on the client side (really the client UI should let you download as many keys as you want to and then allow you to proceed rather than fetching as part of moving to the next screen...)

Actually I started all that last year and never got the opportunity to finish it. Will try to dig it up and show what it looked like.

@ogayot ogayot merged commit 9d4bd57 into canonical:main Jan 25, 2024
12 checks passed
@ogayot ogayot deleted the ssh-fixes branch January 25, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants