ssh-keys page not showing key information
Bug #1859194 reported by
Guillermo Gonzalez
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical SSO provider |
Fix Released
|
Critical
|
Unassigned |
Bug Description
/ssh-keys page is missing the ssh key id, type and text (maybe empty/hidden?)
Related branches
lp:~deadlight/canonical-identity-provider/ssh-form
- Daniel Manrique (community): Approve
- Anthony Dillon (community): Approve
- Maximiliano Bertacchini: Approve
-
Diff: 163 lines (+54/-53)3 files modifiedsrc/webui/forms.py (+15/-32)
src/webui/templates/account/ssh_keys.html (+19/-19)
src/webui/tests/test_forms.py (+20/-2)
Changed in canonical-identity-provider: | |
status: | New → Triaged |
Changed in canonical-identity-provider: | |
importance: | Undecided → Critical |
Changed in canonical-identity-provider: | |
status: | Triaged → Fix Committed |
Changed in canonical-identity-provider: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I think the issue is: the new template expects `delete_ key_form. fields. ssh_keys. choices` to contain a dict with the parsed tokens for each key, but instead it's getting preformatted html code.
Expected:
[("ssh-rsa abcdef0123456789 my key", {"label": "my key", "type": "ssh-rsa", "text": "abcdef01234567 89"}), ...]
Actual:
[("ssh-rsa abcdef0123456789 my key", "<div>< ul><li> <td>... <dt>my key</dt> ...</div> "), ...]
The preformatted html is returned by `webui. forms.format_ ssh_key( )`, called by `DeleteSSHKeyForm`.
Quick fix: update this function to return {'label': comment, 'type': key_type, 'text': key_text}. According to the docstring it does the html rendering by itself for security reasons, but I don't see why it couldn't be safely rendered in the template.