Skip to content

Fix token cache debug log redaction - #970

Merged
Nilesh Choudhary (4gust) merged 2 commits into
devfrom
4gust-token-cache-redaction
Oct 13, 2026
Merged

Nilesh Choudhary (4gust) merged 2 commits into
devfrom
4gust-token-cache-redaction

Conversation

@4gust

Copy link
Copy Markdown
Contributor

Redact sensitive authentication fields and usernames from token cache debug logs without changing cached data. Add regression tests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3a2461b7-7e6f-4fb8-a822-db855b140539
@4gust
Nilesh Choudhary (4gust) requested a review from a team as a code owner October 12, 2026 09:52
Copilot AI balanced review requested due to automatic review settings October 12, 2026 09:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Client assertions and broker account identifiers can still leak through debug logs.

2 open findings
What changed in this PR

Redacts authentication secrets and usernames from token-cache debug logs while preserving cached data.

Changes:

  • Expands debug-log redaction.
  • Adds regression tests for redaction and cache integrity.
File Description
msal/​token_cache.py Extends event-field masking.
tests/​test_token_cache.py Tests redaction without data mutation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread msal/token_cache.py
Comment thread msal/token_cache.py Outdated
Copilot AI balanced review requested due to automatic review settings October 12, 2026 10:31
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3a2461b7-7e6f-4fb8-a822-db855b140539

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation comprehensively covers the targeted sensitive fields and includes regression tests for logging and cache behavior.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

@4gust
Nilesh Choudhary (4gust) merged commit d73407a into dev Oct 13, 2026
8 checks passed
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