mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-26 17:03:06 +00:00
Create constants for other reg methods
This commit is contained in:
parent
58d1255357
commit
106b1e7e8d
3 changed files with 4 additions and 4 deletions
4
api.go
4
api.go
|
@ -21,6 +21,8 @@ import (
|
||||||
const (
|
const (
|
||||||
reservedResponseHeaderSize = 4
|
reservedResponseHeaderSize = 4
|
||||||
RegisterMethodAuthKey = "authKey"
|
RegisterMethodAuthKey = "authKey"
|
||||||
|
RegisterMethodOIDC = "oidc"
|
||||||
|
RegisterMethodCLI = "cli"
|
||||||
)
|
)
|
||||||
|
|
||||||
// KeyHandler provides the Headscale pub key
|
// KeyHandler provides the Headscale pub key
|
||||||
|
@ -422,8 +424,6 @@ func (h *Headscale) handleMachineRefreshKey(
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ctx.Data(http.StatusOK, "application/json; charset=utf-8", respBody)
|
ctx.Data(http.StatusOK, "application/json; charset=utf-8", respBody)
|
||||||
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Headscale) handleMachineRegistrationNew(
|
func (h *Headscale) handleMachineRegistrationNew(
|
||||||
|
|
|
@ -660,7 +660,7 @@ func (h *Headscale) RegisterMachine(
|
||||||
machine.IPAddress = ip.String()
|
machine.IPAddress = ip.String()
|
||||||
machine.NamespaceID = namespace.ID
|
machine.NamespaceID = namespace.ID
|
||||||
machine.Registered = true
|
machine.Registered = true
|
||||||
machine.RegisterMethod = "cli"
|
machine.RegisterMethod = RegisterMethodCLI
|
||||||
h.db.Save(&machine)
|
h.db.Save(&machine)
|
||||||
|
|
||||||
log.Trace().
|
log.Trace().
|
||||||
|
|
2
oidc.go
2
oidc.go
|
@ -223,7 +223,7 @@ func (h *Headscale) OIDCCallback(ctx *gin.Context) {
|
||||||
machine.IPAddress = ip.String()
|
machine.IPAddress = ip.String()
|
||||||
machine.NamespaceID = namespace.ID
|
machine.NamespaceID = namespace.ID
|
||||||
machine.Registered = true
|
machine.Registered = true
|
||||||
machine.RegisterMethod = "oidc"
|
machine.RegisterMethod = RegisterMethodOIDC
|
||||||
machine.LastSuccessfulUpdate = &now
|
machine.LastSuccessfulUpdate = &now
|
||||||
h.db.Save(&machine)
|
h.db.Save(&machine)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue