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

Add option to hide keys in log and print sha256(key) instead #66

Merged
merged 2 commits into from
Jan 30, 2025

Conversation

moticless
Copy link
Collaborator

@moticless moticless commented Jan 30, 2025

  • Extend librdb-api.h with RDB_hideKeysInLog(RdbParser *p) to hide keys in logs during errors by printing the first 8 hex digits of SHA256(key).
  • Rename ./src/ext/common.h to “/src/ext/extCommon.h
  • Avoid printing twice the reported error message. (The first time occurs when calling to RDB_reportError() and the second time at the end of parserMainLoop(), by calling printParserState()).
  • On error, add to printParserState() also the value of bytesRead of the parser.
  • On elementEndKey(), set ...dataType = RDB_DATA_TYPE_MAX; for completeness.

Copy link
Collaborator

@tezc tezc left a comment

Choose a reason for hiding this comment

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

glanced over changes quickly, it looks good to me.

@moticless moticless merged commit 664a7be into redis:main Jan 30, 2025
2 checks passed
@moticless moticless deleted the hide-keys-in-log branch January 30, 2025 18:24
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.

2 participants