Redact secrets from logs and downgrade PII log levels#468
Open
ChristianPavilonis wants to merge 1 commit intomainfrom
Open
Redact secrets from logs and downgrade PII log levels#468ChristianPavilonis wants to merge 1 commit intomainfrom
ChristianPavilonis wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Redacted<T>wrapper that prints[REDACTED]in Debug/Display while preserving transparent serde and.expose()access.debug!and payload logs totrace!so they no longer appear in production.DebugtoInfoto prevent verbose output in production by default.Changes
crates/common/src/redacted.rsRedacted<T>wrapper type with[REDACTED]Debug/Display, transparent serde,.expose(), and testscrates/common/src/lib.rsmod redactedcrates/common/src/settings.rsproxy_secret,secret_key,username,password,secret_store_idtoRedacted<String>; updated validatorscrates/common/build.rs#[path]for buildcrates/common/src/auth.rs.expose()for credential comparisoncrates/common/src/http_util.rs.expose()for proxy_secret accesscrates/common/src/settings_data.rs.expose()for secret_key comparisoncrates/common/src/request_signing/endpoints.rs.expose()for secret_store_idcrates/common/src/synthetic.rsinfo!todebug!crates/common/src/integrations/prebid.rsdebug!totrace!crates/common/src/integrations/aps.rsdebug!totrace!crates/common/src/integrations/adserver_mock.rsdebug!totrace!crates/fastly/src/main.rsDebug→Info; settings loginfo!→debug!AGENTS.mdtracingreference tologCloses
Closes #404
Test plan
cargo test --workspacecargo clippy --all-targets --all-features -- -D warningscargo fmt --all -- --checkcd crates/js/lib && npx vitest runcd crates/js/lib && npm run formatcd docs && npm run formatcargo build --bin trusted-server-fastly --release --target wasm32-wasip1fastly compute serveChecklist
unwrap()in production code — useexpect("should ...")logmacros (notprintln!)