mirror of
https://github.com/tailscale/tailscale.git
synced 2025-12-14 03:31:22 +00:00
tailcfg: pointerify RegisterRequest.Auth, omitemptify RegisterResponseAuth
We were storing server-side lots of:
"Auth":{"Provider":"","LoginName":"","Oauth2Token":null,"AuthKey":""},
That was about 7% of our total storage of pending RegisterRequest
bodies.
Updates tailscale/corp#19327
Change-Id: Ib73842759a2b303ff5fe4c052a76baea0d68ae7d
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
375617c5c8
commit
05bfa022f2
@@ -1069,10 +1069,13 @@ func (st SignatureType) String() string {
|
||||
// in response to a RegisterRequest.
|
||||
type RegisterResponseAuth struct {
|
||||
_ structs.Incomparable
|
||||
|
||||
// One of Provider/LoginName, Oauth2Token, or AuthKey is set.
|
||||
Provider, LoginName string
|
||||
Oauth2Token *Oauth2Token
|
||||
AuthKey string
|
||||
|
||||
Provider string `json:",omitempty"`
|
||||
LoginName string `json:",omitempty"`
|
||||
Oauth2Token *Oauth2Token `json:",omitempty"`
|
||||
AuthKey string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// RegisterRequest is sent by a client to register the key for a node.
|
||||
@@ -1093,7 +1096,7 @@ type RegisterRequest struct {
|
||||
NodeKey key.NodePublic
|
||||
OldNodeKey key.NodePublic
|
||||
NLKey key.NLPublic
|
||||
Auth RegisterResponseAuth
|
||||
Auth *RegisterResponseAuth `json:",omitempty"`
|
||||
// Expiry optionally specifies the requested key expiry.
|
||||
// The server policy may override.
|
||||
// As a special case, if Expiry is in the past and NodeKey is
|
||||
|
||||
Reference in New Issue
Block a user