Conversation
UltraOptimizedStructuredLogger.mask_sensitive, get_structured_logger's mask_sensitive param, mask_sensitive_patterns, and ProfileConfig.mask_sensitive_data/lazy_pii_masking toggled no behavior after #264 replaced pattern-based key masking with blake2b digest redaction. Left in place, they read as working PII controls to callers setting mask_sensitive=False to see raw keys, or trusting True to scrub SSN/email patterns from logs — neither happened. BREAKING CHANGE: UltraOptimizedStructuredLogger.__init__ no longer accepts mask_sensitive; get_structured_logger() no longer accepts mask_sensitive and now keys _logger_instances on name alone; mask_sensitive_patterns is removed; ProfileConfig.mask_sensitive_data and ProfileConfig.lazy_pii_masking are removed. All were read by nothing and toggled no behavior. Constructors/callers passing them now raise TypeError instead of silently no-op'ing. Same removal shape as L1CacheConfig.namespace_index in v0.18.0 and L1CacheConfig.invalidation_enabled in v0.16.0 (LAB-520).
|
Warning Review limit reached
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 56 minutes. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Your 81 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (4)
Comment |
This comment has been minimized.
This comment has been minimized.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…-3797) UltraOptimizedStructuredLogger's docstring still listed "Smart PII masking" as a feature after this branch deleted the regex-pattern masking it described. The surviving _mask_pii/_pii_keys mechanism is a blunt keyword-name filter, not pattern-based masking — reword to match what's actually left.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
@coderabbitai review |
|
Summary
This PR removes unused PII-masking configuration options from the logging and reliability profile modules, as indicated by the ticket LAB-3797.
Changes
Logging module (
src/cachekit/logging.py)mask_sensitiveparameter fromUltraOptimizedStructuredLogger.__init__and theget_structured_loggerfactory function.nameinstead of a compoundname:mask_sensitivekey.mask_sensitive_patternshelper function (which masked SSNs, credit cards, emails, phone numbers, JWTs, and API keys) and the now-unusedLONG_TOKEN_LENGTH_THRESHOLDconstant.Reliability profiles (
src/cachekit/reliability/profiles.py)mask_sensitive_dataandlazy_pii_maskingfields fromProfileConfigand all profile definitions (LOW_LATENCY, BALANCED, FULL)._lazy_pii_maskingentry from the optimized decorator config output.Tests (
tests/unit/test_structured_logging.py)TestSensitiveDataMaskingtest class covering the deleted masking function.mask_sensitiveargument.get_structured_loggerreturns a single cached instance per name.Secrets baseline (
.secrets.baseline)Purpose
These masking knobs were dead code — the
mask_sensitive/mask_sensitive_data/lazy_pii_maskingflags were carried through configuration but not driving any active masking behavior in the logging path. Sensitive cache keys are already redacted unconditionally viaredact_cache_key(as confirmed by the retainedtest_cache_key_always_redactedtest). Removing these unused options simplifies the logging configuration surface and reduces maintenance overhead.Based on the code changes, here's the pull request description:
Description
This PR updates the documentation string for the
UltraOptimizedStructuredLoggerclass to accurately reflect its PII-masking behavior.Changes
The docstring feature description was changed from the vague "Smart PII masking" to the more precise "PII key-name masking (password/token/secret/key/auth kwargs)".
Purpose
As indicated by the PR title (
refactor(logging): remove dead PII-masking knobs), this change is part of a broader effort to remove dead/unused PII-masking configuration options. This docstring update clarifies that the logger only performs key-name-based masking on specific sensitive keyword arguments (such aspassword,token,secret,key, andauth), rather than implying more sophisticated "smart" masking capabilities that may no longer exist or were never fully implemented.This makes the documentation align with the actual behavior of the logger, reducing potential confusion for developers about what masking is actually provided.