TUN-5682: Remove name field from credentials

This commit is contained in:
João Oliveirinha 2022-02-21 14:51:43 +00:00
parent 9cd2780079
commit 22cd8ceb8c
4 changed files with 1 additions and 6 deletions

View File

@ -55,7 +55,6 @@ func RunQuickTunnel(sc *subcommandContext) error {
AccountTag: data.Result.AccountTag, AccountTag: data.Result.AccountTag,
TunnelSecret: data.Result.Secret, TunnelSecret: data.Result.Secret,
TunnelID: tunnelID, TunnelID: tunnelID,
TunnelName: data.Result.Name,
} }
url := data.Result.Hostname url := data.Result.Hostname

View File

@ -185,7 +185,6 @@ func (sc *subcommandContext) create(name string, credentialsFilePath string, sec
AccountTag: credential.cert.AccountID, AccountTag: credential.cert.AccountID,
TunnelSecret: tunnelSecret, TunnelSecret: tunnelSecret,
TunnelID: tunnel.ID, TunnelID: tunnel.ID,
TunnelName: name,
} }
usedCertPath := false usedCertPath := false
if credentialsFilePath == "" { if credentialsFilePath == "" {
@ -370,7 +369,7 @@ func (sc *subcommandContext) findID(input string) (uuid.UUID, error) {
// Look up name in the credentials file. // Look up name in the credentials file.
credFinder := newStaticPath(sc.c.String(CredFileFlag), sc.fs) credFinder := newStaticPath(sc.c.String(CredFileFlag), sc.fs)
if credentials, err := sc.readTunnelCredentials(credFinder); err == nil { if credentials, err := sc.readTunnelCredentials(credFinder); err == nil {
if credentials.TunnelID != uuid.Nil && input == credentials.TunnelName { if credentials.TunnelID != uuid.Nil {
return credentials.TunnelID, nil return credentials.TunnelID, nil
} }
} }

View File

@ -116,7 +116,6 @@ func Test_subcommandContext_findCredentials(t *testing.T) {
AccountTag: accountTag, AccountTag: accountTag,
TunnelID: tunnelID, TunnelID: tunnelID,
TunnelSecret: secret, TunnelSecret: secret,
TunnelName: name,
}, },
}, },
{ {
@ -161,7 +160,6 @@ func Test_subcommandContext_findCredentials(t *testing.T) {
AccountTag: accountTag, AccountTag: accountTag,
TunnelID: tunnelID, TunnelID: tunnelID,
TunnelSecret: secret, TunnelSecret: secret,
TunnelName: name,
}, },
}, },
} }

View File

@ -41,7 +41,6 @@ type Credentials struct {
AccountTag string AccountTag string
TunnelSecret []byte TunnelSecret []byte
TunnelID uuid.UUID TunnelID uuid.UUID
TunnelName string
} }
func (c *Credentials) Auth() pogs.TunnelAuth { func (c *Credentials) Auth() pogs.TunnelAuth {