TUN-3286: Use either ID or name in Named Tunnel subcommands.

This commit is contained in:
Adam Chalmers
2020-08-18 16:54:05 -05:00
parent 60de05bfc1
commit 1a96889141
5 changed files with 160 additions and 31 deletions

View File

@@ -174,6 +174,9 @@ func (r *RESTClient) CreateTunnel(name string, tunnelSecret []byte) (*Tunnel, er
if name == "" {
return nil, errors.New("tunnel name required")
}
if _, err := uuid.Parse(name); err == nil {
return nil, errors.New("you cannot use UUIDs as tunnel names")
}
body := &newTunnel{
Name: name,
TunnelSecret: tunnelSecret,