From 549a26d0879c514c410c3322f8dd0355126bf153 Mon Sep 17 00:00:00 2001 From: Valerio Bozzolan Date: Fri, 12 Jan 2024 22:32:59 +0100 Subject: [PATCH] Auth SSH Details: show Public Key (not just Type) Summary: At the moment the "SSH Key Details" page lists only two minimal information: - Key Type (Example: 'ssh-rsa') - Created (Example: 'Wed, Dec 13, 5:13 PM') After this change it shows also the original Public Key. It becomes something like: - Public Key (Example: 'ssh-rsa AAAB3....... mariana@localhost') - Created (Example: 'Wed, Dec 13, 5:13 PM') This is just a minimal UX change. Note that you can already see the Public Key by clicking "Edit". So, nothing new is shown. Context: Premising that Phorge encourages to Revoke your decommissioned / deprecated / compromised SSH keys with a very lovely "Revoke" Workflow... Root problem: If you Revoke one of your keys, and if you then want to double-check that SSH Public Key again (if you want to see its original body), you then discover that you cannot see it anymore. In fact, the only way is the Edit button, but Editing is disabled for any Revoked Key. In this kind of situation, it's not nice to have to involve your favorite database administrator, to inspect the 'phabricator_auth.auth_sshkey' database table, to just be able to see your SSH Public Key again. After this change, you can easily self-audit your Revoked SSH Public Keys, and your beloved DBA has extra free time. Win-win situation. Closes T15692 Test Plan: - visit your SSH Keys, open one, and check the new Details with your big eyes - do the dame while juggling two ping pong balls (is anybody reading this?) - do the same on a Revoked key Reviewers: O1 Blessed Committers, aklapper Reviewed By: O1 Blessed Committers, aklapper Subscribers: aklapper, tobiaswiese, Matthew, Cigaryno Maniphest Tasks: T15692 Differential Revision: https://we.phorge.it/D25495 --- .../auth/controller/PhabricatorAuthSSHKeyViewController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php b/src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php index 54c6e3861b..591b835d62 100644 --- a/src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php +++ b/src/applications/auth/controller/PhabricatorAuthSSHKeyViewController.php @@ -110,7 +110,7 @@ final class PhabricatorAuthSSHKeyViewController $properties = id(new PHUIPropertyListView()) ->setUser($viewer); - $properties->addProperty(pht('SSH Key Type'), $ssh_key->getKeyType()); + $properties->addProperty(pht('Public Key'), $ssh_key->getEntireKey()); $properties->addProperty( pht('Created'), phabricator_datetime($ssh_key->getDateCreated(), $viewer));