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

#[non_exhaustive]
pub enum AuthMechanism {
    MongoDbCr,
    ScramSha1,
    ScramSha256,
    MongoDbX509,
    Gssapi,
    Plain,
    MongoDbAws,
}
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 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

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 ==. Read more

This method tests for !=.

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

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.