#[non_exhaustive]
pub enum AuthMechanism {
    MongoDbCr,
    ScramSha1,
    ScramSha256,
    MongoDbX509,
    Gssapi,
    Plain,
}
Expand description

The authentication mechanisms supported by MongoDB.

Note: not all of these mechanisms are currently supported by the driver.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MongoDbCr

MongoDB Challenge Response nonce and MD5 based authentication system. It is currently deprecated and will never be supported by this driver.

§

ScramSha1

The SCRAM-SHA-1 mechanism as defined in RFC 5802.

See the MongoDB documentation for more information.

§

ScramSha256

The SCRAM-SHA-256 mechanism which extends RFC 5802 and is formally defined in RFC 7677.

See the MongoDB documentation for more information.

§

MongoDbX509

The MONGODB-X509 mechanism based on the usage of X.509 certificates to validate a client where the distinguished subject name of the client certificate acts as the username.

See the MongoDB documentation for more information.

§

Gssapi

Kerberos authentication mechanism as defined in RFC 4752.

See the MongoDB documentation for more information.

Note: This mechanism is not currently supported by this driver but will be in the future.

§

Plain

The SASL PLAIN mechanism, as defined in RFC 4616, is used in MongoDB to perform LDAP authentication and cannot be used for any other type of authentication. Since the credentials are stored outside of MongoDB, the “$external” database must be used for authentication.

See the MongoDB documentation for more information on LDAP authentication.

Implementations§

Determines if the provided credentials have the required information to perform authentication.

Returns this AuthMechanism as a string.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
The associated error which can be returned from parsing.
Parses a string s to return a value of this type. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.