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

apmsoak: log parsed config #166

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

apmsoak: log parsed config #166

wants to merge 5 commits into from

Conversation

endorama
Copy link
Member

@endorama endorama commented Oct 4, 2024

Print parsed configs in debug logs to help with debugging misbehaviours.

Sensitive values are partially redacted to help with debugging without
disclosing full information.

Sensitive values are partially redacted to help with debugging without
disclosing full information.
@endorama endorama requested a review from a team as a code owner October 4, 2024 15:36
1pkg
1pkg previously approved these changes Oct 4, 2024
e.AddString("scenario", r.Scenario)
e.AddString("scenarios_path", r.ScenariosPath)
e.AddString("server_url", r.ServerURL)
e.AddString("secret_token", r.SecretToken)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: we might want to redact the secret token too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching it! Fixed in dadce87

1pkg
1pkg previously approved these changes Nov 4, 2024
// It handles empty string by returning a fixed value: EMPTY.
func redact(v string) string {
redacted := "EMPTY"
if v != "" {
Copy link
Member

@1pkg 1pkg Nov 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should also check for len(v) > 4

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I updated the check dbfd6c2. If the passed string is smaller than 4 characters the function would still return EMPTY, and I think it's acceptable because we don't expect any secret to be smaller than that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants