@@ -10,7 +10,7 @@ mod scram;
1010mod test;
1111mod x509;
1212
13- use std:: { borrow:: Cow , str:: FromStr } ;
13+ use std:: { borrow:: Cow , fmt :: Debug , str:: FromStr } ;
1414
1515use hmac:: { Mac , NewMac } ;
1616use rand:: Rng ;
@@ -324,7 +324,7 @@ impl FromStr for AuthMechanism {
324324///
325325/// Some fields (mechanism and source) may be omitted and will either be negotiated or assigned a
326326/// default value, depending on the values of other fields in the credential.
327- #[ derive( Clone , Debug , Default , Deserialize , TypedBuilder , PartialEq ) ]
327+ #[ derive( Clone , Default , Deserialize , TypedBuilder , PartialEq ) ]
328328#[ builder( field_defaults( default , setter( strip_option) ) ) ]
329329#[ non_exhaustive]
330330pub struct Credential {
@@ -433,6 +433,14 @@ impl Credential {
433433 }
434434}
435435
436+ impl Debug for Credential {
437+ fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
438+ f. debug_tuple ( "Credential" )
439+ . field ( & "REDACTED" . to_string ( ) )
440+ . finish ( )
441+ }
442+ }
443+
436444/// Contains the first client message sent as part of the authentication handshake.
437445pub ( crate ) enum ClientFirst {
438446 Scram ( ScramVersion , scram:: ClientFirst ) ,
0 commit comments