Skip to content

Commit ed2fa16

Browse files
peateyclaude
andcommitted
test(auth): address review feedback on debug redaction tests
- Remove redundant VendorExtraTokenFields from use super:: in test_stored_credentials_debug_redacts_token_response (already imported at module scope) - Add assert!(debug_output.contains("created_at")) to test_stored_authorization_state_debug_redacts_secrets to verify non-secret fields remain visible in Debug output - Run cargo fmt Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c09e84c commit ed2fa16

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

crates/rmcp/src/transport/auth.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ impl std::fmt::Debug for StoredCredentials {
7373
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7474
f.debug_struct("StoredCredentials")
7575
.field("client_id", &self.client_id)
76-
.field("token_response", &self.token_response.as_ref().map(|_| "[REDACTED]"))
76+
.field(
77+
"token_response",
78+
&self.token_response.as_ref().map(|_| "[REDACTED]"),
79+
)
7780
.field("granted_scopes", &self.granted_scopes)
7881
.field("token_received_at", &self.token_received_at)
7982
.finish()
@@ -2807,11 +2810,12 @@ mod tests {
28072810
assert!(!debug_output.contains("super-secret-verifier"));
28082811
assert!(!debug_output.contains("super-secret-csrf"));
28092812
assert!(debug_output.contains("[REDACTED]"));
2813+
assert!(debug_output.contains("created_at"));
28102814
}
28112815

28122816
#[test]
28132817
fn test_stored_credentials_debug_redacts_token_response() {
2814-
use super::{OAuthTokenResponse, StoredCredentials, VendorExtraTokenFields};
2818+
use super::{OAuthTokenResponse, StoredCredentials};
28152819
use oauth2::{AccessToken, basic::BasicTokenType};
28162820

28172821
let token_response = OAuthTokenResponse::new(

0 commit comments

Comments
 (0)