mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
fix: preserve case-sensitive SSH usernames in host picker
This commit is contained in:
@@ -21,7 +21,7 @@ Orca can drive agents on remote machines over SSH — useful for long-running bu
|
||||
|
||||
Dirty add/edit forms ignore outside clicks so an accidental click away does not discard your fields; use Escape, Cancel, or × to discard.
|
||||
|
||||
The OpenSSH config picker's **In Orca** badge also recognizes a saved target with the same configured hostname, port, and user, even when its label differs from the config alias. A different port or user remains a separate target; entries without `HostName` are matched by alias only.
|
||||
The OpenSSH config picker's **In Orca** badge also recognizes a saved target with the same configured hostname, port, and user, even when its label differs from the config alias. Hostnames are compared case-insensitively, but SSH usernames preserve case. A different port or user remains a separate target; entries without `HostName` are matched by alias only.
|
||||
|
||||
## Host key verification
|
||||
|
||||
|
||||
@@ -77,6 +77,16 @@ describe('SSH config host picker search', () => {
|
||||
expect(result.newHostCount).toBe(0)
|
||||
})
|
||||
|
||||
it('keeps case-distinct SSH users on the same machine separate', () => {
|
||||
const result = searchSshConfigHosts(
|
||||
[{ host: 'admin-account', hostname: 'BOX', user: 'Admin' }],
|
||||
[{ configHost: 'saved-account', label: 'Saved', host: 'box', port: 22, username: 'admin' }]
|
||||
)
|
||||
|
||||
expect(result.hosts[0]).toMatchObject({ alias: 'admin-account', alreadyInOrca: false })
|
||||
expect(result.newHostCount).toBe(1)
|
||||
})
|
||||
|
||||
it('leaves a different machine unflagged', () => {
|
||||
const result = searchSshConfigHosts(
|
||||
[{ host: 'aimp', hostname: '172.16.203.131', user: 'chanmuzi' }],
|
||||
|
||||
@@ -30,8 +30,11 @@ describe('sshEndpointIdentity', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('folds host and user case but keeps a different user distinct', () => {
|
||||
expect(sshEndpointIdentity({ host: 'BOX', port: 22, username: 'Me' })).toBe(
|
||||
it('folds hostname case but preserves case-sensitive SSH usernames', () => {
|
||||
expect(sshEndpointIdentity({ host: 'BOX', port: 22, username: 'me' })).toBe(
|
||||
sshEndpointIdentity({ host: 'box', port: 22, username: 'me' })
|
||||
)
|
||||
expect(sshEndpointIdentity({ host: 'box', port: 22, username: 'Me' })).not.toBe(
|
||||
sshEndpointIdentity({ host: 'box', port: 22, username: 'me' })
|
||||
)
|
||||
expect(sshEndpointIdentity({ host: 'box', port: 22, username: 'me' })).not.toBe(
|
||||
|
||||
@@ -25,5 +25,5 @@ export function sshEndpointIdentity(target: {
|
||||
target.port <= 65_535
|
||||
? target.port
|
||||
: 22
|
||||
return `${host}\u0000${port}\u0000${target.username?.trim().toLowerCase() ?? ''}`
|
||||
return `${host}\u0000${port}\u0000${target.username?.trim() ?? ''}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user