Add INFO logging for fingerprint passthrough
This commit is contained in:
parent
56577b727e
commit
f127c624c0
1 changed files with 4 additions and 2 deletions
|
|
@ -296,14 +296,16 @@ func (p *SkelPlugin) createUpstreamWithClientKey(conn libplugin.ConnMetadata, to
|
|||
}
|
||||
|
||||
// If client public key is provided, prepend fingerprint to username
|
||||
// Format: "SHA256:xxxxx.originaluser" - maldoror/upstream can parse this
|
||||
// Format: "fp:xxxxx.originaluser" - maldoror/upstream can parse this
|
||||
if clientPublicKey != nil {
|
||||
hash := sha256.Sum256(clientPublicKey)
|
||||
fingerprint := base64.RawStdEncoding.EncodeToString(hash[:])
|
||||
// Replace any dots in fingerprint with underscores to avoid parsing issues
|
||||
fingerprint = strings.ReplaceAll(fingerprint, ".", "_")
|
||||
user = "fp:" + fingerprint + "." + user
|
||||
log.Debugf("passing client fingerprint in username: %s", user)
|
||||
log.Infof("passing client fingerprint in username: %s", user)
|
||||
} else {
|
||||
log.Infof("no client public key provided, using original username: %s", user)
|
||||
}
|
||||
|
||||
p.cache.SetDefault(conn.UniqueID(), to)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue