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

Support obfuscation of more complex log record messages #12151

Merged
merged 2 commits into from
Mar 4, 2024
Merged

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Mar 4, 2024

closes #12139

ObfuscateApiKeyFilter as introduced by #12072 was assuming log record messages were strings, so when we attempted to remove a PREFECT_API_KEY from the message, we saw attribute errors like in the original issue.

this pr uses visit_collection to allow us to redact arbitrary collections recursively

Checklist

  • This pull request references any related issue by including "closes <link to issue>"
    • If no issue exists and your change is not a small fix, please create an issue first.
  • This pull request includes tests or only affects documentation.
  • This pull request includes a label categorizing the change e.g. maintenance, fix, feature, enhancement, docs.

@zzstoatzz zzstoatzz requested a review from a team as a code owner March 4, 2024 17:05
@zzstoatzz zzstoatzz added the fix A fix for a bug in an existing feature label Mar 4, 2024
Copy link

netlify bot commented Mar 4, 2024

Deploy Preview for prefect-docs-preview ready!

Name Link
🔨 Latest commit 3e6f1a8
🔍 Latest deploy log https://app.netlify.com/sites/prefect-docs-preview/deploys/65e600346ec6d00008d6cda2
😎 Deploy Preview https://deploy-preview-12151--prefect-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@zzstoatzz zzstoatzz self-assigned this Mar 4, 2024
Copy link
Member

@desertaxle desertaxle left a comment

Choose a reason for hiding this comment

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

LGTM!

src/prefect/logging/filters.py Outdated Show resolved Hide resolved
Co-authored-by: Alexander Streed <desertaxle@users.noreply.github.com>
@zzstoatzz zzstoatzz changed the title visit collection to redact api key Support obfuscation of more complex log record messages Mar 4, 2024
@zzstoatzz zzstoatzz merged commit 21df19d into main Mar 4, 2024
45 checks passed
@zzstoatzz zzstoatzz deleted the log-lists branch March 4, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A fix for a bug in an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.16.1 log filter prevents logging lists
2 participants