MCPcopy Create free account
hub / github.com/bytebase/dbhub / findDefaultSSHKey

Function findDefaultSSHKey

src/utils/ssh-config-parser.ts:78–86  ·  view source on GitHub ↗

* Find the first existing SSH key from default locations. * Resolves symlinks and returns the real path if found.

()

Source from the content-addressed store, hash-verified

76 * Resolves symlinks and returns the real path if found.
77 */
78function findDefaultSSHKey(): string | undefined {
79 for (const keyPath of DEFAULT_SSH_KEYS) {
80 const resolvedPath = resolveSymlink(keyPath);
81 if (isFile(resolvedPath)) {
82 return resolvedPath;
83 }
84 }
85 return undefined;
86}
87
88/**
89 * Parse SSH config file and extract configuration for a specific host

Callers 1

parseSSHConfigFunction · 0.85

Calls 2

resolveSymlinkFunction · 0.85
isFileFunction · 0.85

Tested by

no test coverage detected