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

Redact Vault.Token from AgentSelf response. #2988

Merged
merged 2 commits into from
Aug 8, 2017

Conversation

jvoorhis
Copy link
Contributor

@jvoorhis jvoorhis commented Aug 8, 2017

If Config.Vault.Token is defined, /v1/agent/self will return the string
<redacted>. If the token is not set, This endpoint will continue to
return the empty string.

If Config.Vault.Token is defined, /v1/agent/self will return the string
`<redacted>`. If the token is not set, This endpoint will continue to
return the empty string.
self.Config = ac.(*Config)
}

if self.Config.Vault.Token != "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just do nil handling just in case :)

if self.Config != nil && self.Config.Vault != nil && self.Config.Vault.Token != "" {

@jvoorhis
Copy link
Contributor Author

jvoorhis commented Aug 8, 2017

Good idea. This solution probably violates Law of Demeter, but feels like the right thing for a targeted fix. If there are any other cases where we need to redact config, we should probably hoist this logic up into nomad/config.go.

@dadgar dadgar merged commit 2a1b886 into hashicorp:master Aug 8, 2017
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants