use go-oidc instead of verifying and extracting tokens ourselves, rename oidc_endpoint to oidc_issuer to be more inline with spec

This commit is contained in:
Raal Goff 2021-10-06 17:19:15 +08:00
parent 0393ab524c
commit c487591437
7 changed files with 69 additions and 185 deletions

View file

@ -50,6 +50,11 @@ func (m Machine) isAlreadyRegistered() bool {
return m.Registered
}
// isExpired returns whether the machine registration has expired
func (m Machine) isExpired() bool {
return time.Now().UTC().After(*m.Expiry)
}
// toNode converts a Machine into a Tailscale Node. includeRoutes is false for shared nodes
// as per the expected behaviour in the official SaaS
func (m Machine) toNode(includeRoutes bool) (*tailcfg.Node, error) {