File tree Expand file tree Collapse file tree 3 files changed +48
-4
lines changed
Expand file tree Collapse file tree 3 files changed +48
-4
lines changed Original file line number Diff line number Diff line change @@ -36,17 +36,17 @@ Introduce wrapper types based on the `secrecy` crate's `SecretString` to replace
3636** Total Active Proposals** : 10
3737** Total Postponed** : 0
3838** Total Discarded** : 0
39- ** Completed** : 9
39+ ** Completed** : 10
4040** In Progress** : 0
41- ** Not Started** : 1
41+ ** Not Started** : 0
4242
4343### Phase Summary
4444
4545- ** Phase 0 - Core Setup (High Impact, Low Effort)** : ✅ 2/2 completed (100%)
4646- ** Phase 1 - Provider Secrets (High Impact, Medium Effort)** : ✅ 2/2 completed (100%)
4747- ** Phase 2 - Database Secrets (High Impact, Medium Effort)** : ✅ 2/2 completed (100%)
4848- ** Phase 3 - Documentation and Guidance (High Impact, Low Effort)** : ✅ 2/2 completed (100%) - ADR and AGENTS.md completed
49- - ** Phase 4 - Future Enhancements (Low Impact, Medium Effort)** : ✅ 2 /3 completed (67 %) - Proposals # 9 and # 10 verified
49+ - ** Phase 4 - Future Enhancements (Low Impact, Medium Effort)** : ✅ 3 /3 completed (100 %) - All proposals completed
5050
5151### Discarded Proposals
5252
@@ -846,7 +846,7 @@ Optional improvements that can be done later if needed.
846846
847847### Proposal #8 : Add Debug Tracing for Secret Access
848848
849- ** Status** : ⏳ Not Started
849+ ** Status** : ✅ Completed
850850** Impact** : 🟢 Low
851851** Effort** : 🔵🔵 Medium
852852** Priority** : P4
Original file line number Diff line number Diff line change @@ -44,8 +44,20 @@ impl ApiToken {
4444 /// Exposes the secret API token value.
4545 ///
4646 /// This method should be used carefully as it provides access to the sensitive data.
47+ ///
48+ /// # Debug Tracing
49+ ///
50+ /// In debug builds, this method logs the caller location to help audit secret access patterns.
51+ /// No performance impact in release builds.
4752 #[ must_use]
53+ #[ track_caller]
4854 pub fn expose_secret ( & self ) -> & str {
55+ #[ cfg( debug_assertions) ]
56+ tracing:: trace!(
57+ location = ?std:: panic:: Location :: caller( ) ,
58+ "Secret API token exposed"
59+ ) ;
60+
4961 self . 0 . expose_secret ( )
5062 }
5163}
@@ -160,4 +172,14 @@ mod tests {
160172 let _from_str_slice = ApiToken :: new ( "token" ) ;
161173 let _from_owned_string = ApiToken :: new ( "token" . to_string ( ) ) ;
162174 }
175+
176+ #[ test]
177+ #[ cfg( debug_assertions) ]
178+ fn it_should_trace_secret_exposure_in_debug_builds ( ) {
179+ // This test verifies that tracing is compiled and callable in debug builds.
180+ // The actual trace output would require a tracing subscriber to capture.
181+ let token = ApiToken :: new ( "debug-token" ) ;
182+ let _exposed = token. expose_secret ( ) ;
183+ // If this compiles and runs without panic, tracing is working
184+ }
163185}
Original file line number Diff line number Diff line change @@ -44,8 +44,20 @@ impl Password {
4444 /// Exposes the secret password value.
4545 ///
4646 /// This method should be used carefully as it provides access to the sensitive data.
47+ ///
48+ /// # Debug Tracing
49+ ///
50+ /// In debug builds, this method logs the caller location to help audit secret access patterns.
51+ /// No performance impact in release builds.
4752 #[ must_use]
53+ #[ track_caller]
4854 pub fn expose_secret ( & self ) -> & str {
55+ #[ cfg( debug_assertions) ]
56+ tracing:: trace!(
57+ location = ?std:: panic:: Location :: caller( ) ,
58+ "Secret password exposed"
59+ ) ;
60+
4961 self . 0 . expose_secret ( )
5062 }
5163}
@@ -160,4 +172,14 @@ mod tests {
160172 let _from_str_slice = Password :: new ( "password" ) ;
161173 let _from_owned_string = Password :: new ( "password" . to_string ( ) ) ;
162174 }
175+
176+ #[ test]
177+ #[ cfg( debug_assertions) ]
178+ fn it_should_trace_secret_exposure_in_debug_builds ( ) {
179+ // This test verifies that tracing is compiled and callable in debug builds.
180+ // The actual trace output would require a tracing subscriber to capture.
181+ let password = Password :: new ( "debug-password" ) ;
182+ let _exposed = password. expose_secret ( ) ;
183+ // If this compiles and runs without panic, tracing is working
184+ }
163185}
You can’t perform that action at this time.
0 commit comments