mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 11:05:45 +00:00
types/persist: remove unused field Persist.Provider
It was only obviously unused after the previous change, c39cde79d
.
Updates #19334
Change-Id: I9896d5fa692cb4346c070b4a339d0d12340c18f7
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
c39cde79d2
commit
5100bdeba7
@ -671,9 +671,6 @@ func (c *Direct) doLogin(ctx context.Context, opt loginOpt) (mustRegen bool, new
|
||||
request.NodeKey.ShortString())
|
||||
return true, "", nil, nil
|
||||
}
|
||||
if resp.Login.Provider != "" {
|
||||
persist.Provider = resp.Login.Provider
|
||||
}
|
||||
persist.UserProfile = tailcfg.UserProfile{
|
||||
ID: resp.User.ID,
|
||||
DisplayName: resp.Login.DisplayName,
|
||||
|
@ -34,7 +34,6 @@ type Persist struct {
|
||||
|
||||
PrivateNodeKey key.NodePrivate
|
||||
OldPrivateNodeKey key.NodePrivate // needed to request key rotation
|
||||
Provider string
|
||||
UserProfile tailcfg.UserProfile
|
||||
NetworkLockKey key.NLPrivate
|
||||
NodeID tailcfg.StableNodeID
|
||||
@ -99,7 +98,6 @@ func (p *Persist) Equals(p2 *Persist) bool {
|
||||
return p.LegacyFrontendPrivateMachineKey.Equal(p2.LegacyFrontendPrivateMachineKey) &&
|
||||
p.PrivateNodeKey.Equal(p2.PrivateNodeKey) &&
|
||||
p.OldPrivateNodeKey.Equal(p2.OldPrivateNodeKey) &&
|
||||
p.Provider == p2.Provider &&
|
||||
p.UserProfile.Equal(&p2.UserProfile) &&
|
||||
p.NetworkLockKey.Equal(p2.NetworkLockKey) &&
|
||||
p.NodeID == p2.NodeID &&
|
||||
|
@ -29,7 +29,6 @@ func (src *Persist) Clone() *Persist {
|
||||
LegacyFrontendPrivateMachineKey key.MachinePrivate
|
||||
PrivateNodeKey key.NodePrivate
|
||||
OldPrivateNodeKey key.NodePrivate
|
||||
Provider string
|
||||
UserProfile tailcfg.UserProfile
|
||||
NetworkLockKey key.NLPrivate
|
||||
NodeID tailcfg.StableNodeID
|
||||
|
@ -21,7 +21,7 @@ func fieldsOf(t reflect.Type) (fields []string) {
|
||||
}
|
||||
|
||||
func TestPersistEqual(t *testing.T) {
|
||||
persistHandles := []string{"LegacyFrontendPrivateMachineKey", "PrivateNodeKey", "OldPrivateNodeKey", "Provider", "UserProfile", "NetworkLockKey", "NodeID", "DisallowedTKAStateIDs"}
|
||||
persistHandles := []string{"LegacyFrontendPrivateMachineKey", "PrivateNodeKey", "OldPrivateNodeKey", "UserProfile", "NetworkLockKey", "NodeID", "DisallowedTKAStateIDs"}
|
||||
if have := fieldsOf(reflect.TypeFor[Persist]()); !reflect.DeepEqual(have, persistHandles) {
|
||||
t.Errorf("Persist.Equal check might be out of sync\nfields: %q\nhandled: %q\n",
|
||||
have, persistHandles)
|
||||
@ -72,16 +72,6 @@ func TestPersistEqual(t *testing.T) {
|
||||
true,
|
||||
},
|
||||
|
||||
{
|
||||
&Persist{Provider: "google"},
|
||||
&Persist{Provider: "o365"},
|
||||
false,
|
||||
},
|
||||
{
|
||||
&Persist{Provider: "google"},
|
||||
&Persist{Provider: "google"},
|
||||
true,
|
||||
},
|
||||
{
|
||||
&Persist{UserProfile: tailcfg.UserProfile{
|
||||
ID: tailcfg.UserID(3),
|
||||
|
@ -67,7 +67,6 @@ func (v PersistView) LegacyFrontendPrivateMachineKey() key.MachinePrivate {
|
||||
}
|
||||
func (v PersistView) PrivateNodeKey() key.NodePrivate { return v.ж.PrivateNodeKey }
|
||||
func (v PersistView) OldPrivateNodeKey() key.NodePrivate { return v.ж.OldPrivateNodeKey }
|
||||
func (v PersistView) Provider() string { return v.ж.Provider }
|
||||
func (v PersistView) UserProfile() tailcfg.UserProfile { return v.ж.UserProfile }
|
||||
func (v PersistView) NetworkLockKey() key.NLPrivate { return v.ж.NetworkLockKey }
|
||||
func (v PersistView) NodeID() tailcfg.StableNodeID { return v.ж.NodeID }
|
||||
@ -81,7 +80,6 @@ func (v PersistView) DisallowedTKAStateIDs() views.Slice[string] {
|
||||
LegacyFrontendPrivateMachineKey key.MachinePrivate
|
||||
PrivateNodeKey key.NodePrivate
|
||||
OldPrivateNodeKey key.NodePrivate
|
||||
Provider string
|
||||
UserProfile tailcfg.UserProfile
|
||||
NetworkLockKey key.NLPrivate
|
||||
NodeID tailcfg.StableNodeID
|
||||
|
Loading…
Reference in New Issue
Block a user