Skip to content

Conversation

@heifner
Copy link
Contributor

@heifner heifner commented Dec 26, 2025

Mask private keys in logging of signature-provider.

@heifner heifner requested a review from jglanz December 26, 2025 19:43
Copy link
Collaborator

@jglanz jglanz left a comment

Choose a reason for hiding this comment

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

Should we move all of this to fc::log for reusability? Also, as we have the key prefixes available, should this be 1 large or several small regex patterns. Potentially part of a storage shim could be a std::regex exp_key_string_pattern?

I'm fine approving this as is, but want to get your perspective on the above first

Comment on lines +37 to +43
auto mask_private = [](const string& v) -> std::string {
if (auto parts = fc::split(v, ','); parts.size() > 1) {
return std::accumulate(std::next(parts.begin()), std::prev(parts.end()), parts[0],
[](const string& acc, const string& part) { return acc + "," + part; }) + ",***";
}
return "***"s;
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we move all of this to fc::log for reusability? Also, as we have the key prefixes available, should this be 1 large or several small regex patterns. Potentially part of a storage shim could be a std::regex exp_key_string_pattern?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could move it to fc::log. To do so would require a key pattern, as you suggest, to make it generic. Since this is currently only used here I don't see the point.

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