Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add AuthMechanism::ScramSha3_512{,Plus} #407

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions imap-types/src/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ pub enum AuthMechanism<'a> {
/// * <https://developers.google.com/gmail/imap/xoauth2-protocol>
XOAuth2,

//
// --- SHA-1 ---
//
/// SCRAM-SHA-1
///
/// # Reference(s):
Expand All @@ -85,6 +88,9 @@ pub enum AuthMechanism<'a> {
/// * https://datatracker.ietf.org/doc/html/rfc5802
ScramSha1Plus,

//
// --- SHA-2 ---
//
/// SCRAM-SHA-256
///
/// # Reference(s):
Expand All @@ -99,6 +105,23 @@ pub enum AuthMechanism<'a> {
/// * https://datatracker.ietf.org/doc/html/rfc7677
ScramSha256Plus,

//
// --- SHA-3 ---
//
/// SCRAM-SHA3-512
///
/// # Reference(s):
///
/// * https://datatracker.ietf.org/doc/html/draft-melnikov-scram-sha3-512
ScramSha3_512,

/// SCRAM-SHA3-512-PLUS
///
/// # Reference(s):
///
/// * https://datatracker.ietf.org/doc/html/draft-melnikov-scram-sha3-512
ScramSha3_512Plus,

/// Some other (unknown) mechanism.
Other(AuthMechanismOther<'a>),
}
Expand Down Expand Up @@ -140,6 +163,8 @@ impl<'a> AsRef<str> for AuthMechanism<'a> {
Self::ScramSha1Plus => "SCRAM-SHA-1-PLUS",
Self::ScramSha256 => "SCRAM-SHA-256",
Self::ScramSha256Plus => "SCRAM-SHA-256-PLUS",
Self::ScramSha3_512 => "SCRAM-SHA3-512",
Self::ScramSha3_512Plus => "SCRAM-SHA3-512-PLUS",
Self::Other(other) => other.0.as_ref(),
}
}
Expand Down
Loading