Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NK-559 Obfuscate secrets from console config view. #1244

Merged
merged 1 commit into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ type config struct {
GoogleAuth *GoogleAuthConfig `yaml:"google_auth" json:"google_auth" usage:"Google's auth settings."`
Satori *SatoriConfig `yaml:"satori" json:"satori" usage:"Satori integration settings."`
Storage *StorageConfig `yaml:"storage" json:"storage" usage:"Storage settings."`
Limit int // Only used for migrate command.
Limit int `json:"-"` // Only used for migrate command.
}

// NewConfig constructs a Config struct which represents server settings, and populates it with default values.
Expand Down
7 changes: 7 additions & 0 deletions server/console_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ func (s *ConsoleServer) GetConfig(ctx context.Context, in *emptypb.Empty) (*cons
cfg.GetGoogleAuth().CredentialsJSON = ObfuscationString
cfg.GetGoogleAuth().OAuthConfig = nil

cfg.GetIAP().Google.PrivateKey = ObfuscationString
cfg.GetIAP().Apple.SharedPassword = ObfuscationString
cfg.GetIAP().Huawei.ClientSecret = ObfuscationString

cfg.GetSocial().FacebookInstantGame.AppSecret = ObfuscationString
cfg.GetIAP().FacebookInstant.AppSecret = ObfuscationString

cfgBytes, err := json.Marshal(cfg)
if err != nil {
s.logger.Error("Error encoding config.", zap.Error(err))
Expand Down
Loading