TS2021: Expose Register handler in Noise

This commit is contained in:
Juan Font Alonso
2022-03-27 22:25:21 +02:00
parent 323a7d9c2e
commit 834f39db31
5 changed files with 270 additions and 4 deletions

9
api.go
View File

@@ -563,8 +563,13 @@ func (h *Headscale) handleAuthKey(
machineKey key.MachinePublic,
registerRequest tailcfg.RegisterRequest,
) {
machineKeyStr := MachinePublicKeyStripPrefix(machineKey)
var machineKeyStr string
if machineKey.IsZero() {
// We are handling here a Noise auth key
machineKeyStr = ""
} else {
machineKeyStr = MachinePublicKeyStripPrefix(machineKey)
}
log.Debug().
Str("func", "handleAuthKey").
Str("machine", registerRequest.Hostinfo.Hostname).