Skip to content

Commit

Permalink
fix: relay considered sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Dec 17, 2024
1 parent b679a14 commit 47dfbc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions relay/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,10 @@ func NewConfig(ctx *cli.Context) (Config, error) {
}
return config, nil
}

// SanitizedConfig returns a copy of the Config with sensitive information removed or obfuscated.
func (c Config) SanitizedConfig() Config {
sanitized := c
sanitized.RelayConfig.AuthenticationKeyCacheSize = 0 // Obfuscate sensitive information
return sanitized
}
2 changes: 1 addition & 1 deletion relay/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func RunRelay(ctx *cli.Context) error {
if err != nil {
return fmt.Errorf("failed to create logger: %w", err)
}
logger.Info(fmt.Sprintf("Relay configuration: %#v", config))
logger.Info(fmt.Sprintf("Relay configuration: %#v", config.SanitizedConfig()))

dynamoClient, err := dynamodb.NewClient(config.AWS, logger)
if err != nil {
Expand Down

0 comments on commit 47dfbc2

Please sign in to comment.