@@ -19,7 +19,7 @@ use crate::{bson::RawDocumentBuf, bson_compat::cstr, options::ClientOptions};
1919use derive_where:: derive_where;
2020use hmac:: { digest:: KeyInit , Mac } ;
2121use rand:: Rng ;
22- use serde:: Deserialize ;
22+ use serde:: { Deserialize , Serialize } ;
2323use typed_builder:: TypedBuilder ;
2424
2525use self :: scram:: ScramVersion ;
@@ -44,7 +44,7 @@ const MONGODB_OIDC_STR: &str = "MONGODB-OIDC";
4444/// The authentication mechanisms supported by MongoDB.
4545///
4646/// Note: not all of these mechanisms are currently supported by the driver.
47- #[ derive( Clone , Deserialize , PartialEq , Debug ) ]
47+ #[ derive( Clone , Deserialize , Serialize , PartialEq , Debug ) ]
4848#[ non_exhaustive]
4949pub enum AuthMechanism {
5050 /// MongoDB Challenge Response nonce and MD5 based authentication system. It is currently
@@ -558,8 +558,7 @@ impl Credential {
558558 mechanism. authenticate_stream ( conn, self , opts) . await
559559 }
560560
561- #[ cfg( test) ]
562- pub ( crate ) fn serialize_for_client_options < S > (
561+ pub ( crate ) fn serialize < S > (
563562 credential : & Option < Credential > ,
564563 serializer : S ,
565564 ) -> std:: result:: Result < S :: Ok , S :: Error >
0 commit comments