Skip to content

Commit

Permalink
chore: separate maksing switch from terminal security (#6499)
Browse files Browse the repository at this point in the history
Signed-off-by: Ash <[email protected]>
  • Loading branch information
iutx authored Mar 4, 2025
1 parent 46c3b0b commit 4bef1dc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions internal/tools/orchestrator/conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ type Conf struct {
TraceLogEnv string `env:"TRACELOGENV" default:"TERMINUS_DEFINE_TAG"`
WsDiceRootDomain string `env:"WS_DICE_ROOT_DOMAIN" default:"app.terminus.io,erda.cloud"`
TerminalSecurity bool `env:"TERMINAL_SECURITY" default:"false"`
TerminalMasking bool `env:"TERMINAL_MASKING" default:"false"`
ExecutorClientTimeout int `env:"EXECUTOR_CLIENT_TIMEOUT" default:"10"`
CustomRegCredSecret string `env:"CUSTOM_REGCRED_SECRET" default:"regcred"`
ErdaNamespace string `env:"DICE_NAMESPACE" default:"default"`
Expand Down Expand Up @@ -198,6 +199,10 @@ func TerminalSecurity() bool {
return cfg.TerminalSecurity
}

func TerminalMasking() bool {
return cfg.TerminalMasking
}

func ExecutorClientTimeout() time.Duration {
return time.Duration(cfg.ExecutorClientTimeout) * time.Second
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (k *Kubernetes) Terminal(namespace, podname, containername string, upperCon
return
}
m[0] = Output
if conf.TerminalSecurity() {
if conf.TerminalSecurity() || conf.TerminalMasking() {
m = hidePassEnv(m)
}
if err := upperConn.WriteMessage(tp, m); err != nil {
Expand Down

0 comments on commit 4bef1dc

Please sign in to comment.