Skip to content

Commit

Permalink
feat: Add AuthMechanism::ScramSha3_512{,Plus}
Browse files Browse the repository at this point in the history
  • Loading branch information
duesee committed Feb 15, 2024
1 parent 276f651 commit 5ac9a92
Showing 1 changed file with 25 additions and 0 deletions.
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

0 comments on commit 5ac9a92

Please sign in to comment.