Enum mongodb::options::AuthMechanism[][src]

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

The authentication mechanisms supported by MongoDB.

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

Variants (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 authenticaiton. 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.

MongoDbAws

MONGODB-AWS authenticates using AWS IAM credentials (an access key ID and a secret access key), temporary AWS IAM credentials obtained from an AWS Security Token Service (STS) Assume Role request, or temporary AWS IAM credentials assigned to an EC2 instance or ECS task.

Note: Only server versions 4.4+ support AWS authentication. Additionally, the driver only supports AWS authentication with the tokio runtime.

Implementations

impl AuthMechanism[src]

pub fn validate_credential(&self, credential: &Credential) -> Result<()>[src]

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

pub fn as_str(&self) -> &'static str[src]

Returns this AuthMechanism as a string.

Trait Implementations

impl Clone for AuthMechanism[src]

impl Debug for AuthMechanism[src]

impl<'de> Deserialize<'de> for AuthMechanism[src]

impl FromStr for AuthMechanism[src]

type Err = Error

The associated error which can be returned from parsing.

impl PartialEq<AuthMechanism> for AuthMechanism[src]

impl StructuralPartialEq for AuthMechanism[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,