■ ■ ■ ■ ■ ■
internal/server/commands/list.go
| skipped 16 lines |
17 | 17 | | } |
18 | 18 | | |
19 | 19 | | type displayItem struct { |
20 | | - | sc ssh.Conn |
| 20 | + | sc ssh.ServerConn |
21 | 21 | | id string |
22 | 22 | | } |
23 | 23 | | |
24 | 24 | | func fancyTable(tty io.ReadWriter, applicable []displayItem) { |
25 | 25 | | |
26 | | - | t, _ := table.NewTable("Targets", "ID", "Hostname", "IP Address", "Version") |
| 26 | + | t, _ := table.NewTable("Targets", "ID", "Public Key Hash", "Hostname", "IP Address", "Version") |
27 | 27 | | for _, a := range applicable { |
28 | | - | t.AddValues(a.id, clients.NormaliseHostname(a.sc.User()), a.sc.RemoteAddr().String(), string(a.sc.ClientVersion())) |
| 28 | + | t.AddValues(a.id, a.sc.Permissions.Extensions["pubkey-fp"], clients.NormaliseHostname(a.sc.User()), a.sc.RemoteAddr().String(), string(a.sc.ClientVersion())) |
29 | 29 | | } |
30 | 30 | | |
31 | 31 | | t.Fprint(tty) |
| skipped 39 lines |
71 | 71 | | sort.Strings(ids) |
72 | 72 | | |
73 | 73 | | for _, id := range ids { |
74 | | - | toReturn = append(toReturn, displayItem{id: id, sc: matchingClients[id]}) |
| 74 | + | toReturn = append(toReturn, displayItem{id: id, sc: *matchingClients[id]}) |
75 | 75 | | } |
76 | 76 | | |
77 | 77 | | if line.IsSet("t") { |
| skipped 5 lines |
83 | 83 | | |
84 | 84 | | for i, tr := range toReturn { |
85 | 85 | | |
86 | | - | fmt.Fprintf(tty, "%s %s %s, version: %s", tr.id, clients.NormaliseHostname(tr.sc.User()), tr.sc.RemoteAddr().String(), tr.sc.ClientVersion()) |
| 86 | + | fmt.Fprintf(tty, "%s %s %s %s, version: %s", tr.id, tr.sc.Permissions.Extensions["pubkey-fp"], clients.NormaliseHostname(tr.sc.User()), tr.sc.RemoteAddr().String(), tr.sc.ClientVersion()) |
87 | 87 | | |
88 | 88 | | if i != len(toReturn)-1 { |
89 | 89 | | fmt.Fprint(tty, sep) |
| skipped 19 lines |
109 | 109 | | |
110 | 110 | | return terminal.MakeHelpText( |
111 | 111 | | "ls [OPTION] [FILTER]", |
112 | | - | "Filter uses glob matching against all attributes of a target (hostname, ip, id)", |
| 112 | + | "Filter uses glob matching against all attributes of a target (id, public key hash, hostname, ip)", |
113 | 113 | | "\t-t\tPrint all attributes in pretty table", |
114 | 114 | | "\t-h\tPrint help", |
115 | 115 | | ) |
| skipped 2 lines |