Skip to content

Commit

Permalink
Merge pull request #801 from ersonp/remove-json-dmsgpty
Browse files Browse the repository at this point in the history
Remove Config Whitelist dmsgpty
  • Loading branch information
jdknives authored Jun 8, 2021
2 parents 1b0c38d + a340041 commit 37f0cd1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 21 deletions.
10 changes: 1 addition & 9 deletions pkg/visor/init_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,7 @@ func initDmsgpty(ctx context.Context, v *Visor, log *logging.Logger) error {
}
}

var wl dmsgpty.Whitelist
if conf.AuthFile == "" {
wl = dmsgpty.NewMemoryWhitelist()
} else {
var err error
if wl, err = dmsgpty.NewConfigWhitelist(v.conf.Dmsgpty.AuthFile); err != nil {
return err
}
}
wl := dmsgpty.NewMemoryWhitelist()

// Ensure hypervisors are added to the whitelist.
if err := wl.Add(v.conf.Hypervisors...); err != nil {
Expand Down
14 changes: 6 additions & 8 deletions pkg/visor/visorconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,9 @@ func defaultConfigFromCommon(cc *Common, hypervisor bool) (*V1, error) {
conf := MakeBaseConfig(cc)

conf.Dmsgpty = &V1Dmsgpty{
Port: skyenv.DmsgPtyPort,
AuthFile: skyenv.DefaultDmsgPtyWhitelist,
CLINet: skyenv.DefaultDmsgPtyCLINet,
CLIAddr: skyenv.DefaultDmsgPtyCLIAddr,
Port: skyenv.DmsgPtyPort,
CLINet: skyenv.DefaultDmsgPtyCLINet,
CLIAddr: skyenv.DefaultDmsgPtyCLIAddr,
}

conf.STCP = &snet.STCPConfig{
Expand Down Expand Up @@ -157,10 +156,9 @@ func MakePackageConfig(log *logging.MasterLogger, confPath string, sk *cipher.Se
}

conf.Dmsgpty = &V1Dmsgpty{
Port: skyenv.DmsgPtyPort,
AuthFile: skyenv.PackageDmsgPtyWhiteList,
CLINet: skyenv.DefaultDmsgPtyCLINet,
CLIAddr: skyenv.DefaultDmsgPtyCLIAddr,
Port: skyenv.DmsgPtyPort,
CLINet: skyenv.DefaultDmsgPtyCLINet,
CLIAddr: skyenv.DefaultDmsgPtyCLIAddr,
}

conf.Transport.LogStore = &V1LogStore{
Expand Down
7 changes: 3 additions & 4 deletions pkg/visor/visorconfig/v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ type V1 struct {

// V1Dmsgpty configures the dmsgpty-host.
type V1Dmsgpty struct {
Port uint16 `json:"port"`
AuthFile string `json:"authorization_file"`
CLINet string `json:"cli_network"`
CLIAddr string `json:"cli_address"`
Port uint16 `json:"port"`
CLINet string `json:"cli_network"`
CLIAddr string `json:"cli_address"`
}

// V1Transport defines a transport config.
Expand Down

0 comments on commit 37f0cd1

Please sign in to comment.