Import upstream v0.16.22, stripped

Upstream commit: 474dd0229cb20cf513036619781ed97bd8073c3f
Enterprise-only files removed or emptied: 63
Enterprise-only snippets removed: 117 in 50 files
Dangling module declarations removed: 5
Cargo edits turning enterprise off: 14
Verification: clean
Enterprise feature gates left for rebuilt features: 19 in 18 files

Produced by tools/fork/strip.py. The full report is in docs/fork/strip-reports/ on main.
This commit is contained in:
jcoffey-dev committed 2026-09-18 10:21:56 -07:00
commit 7dae9b29fd
1650 files changed
+485521

No files matched your search

@@ -0,0 +1,53 @@
/*
* SPDX-FileCopyrightText: 2020 Stalwart Labs LLC <[email protected]>
*
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
*/
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Arguments {
pub tag: String,
pub mechanism: Mechanism,
pub params: Vec<String>,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Mechanism {
Plain,
CramMd5,
DigestMd5,
ScramSha1,
ScramSha256,
Apop,
Ntlm,
Gssapi,
Anonymous,
External,
OAuthBearer,
XOauth2,
}
impl Mechanism {
pub fn serialize(&self, buf: &mut Vec<u8>) {
buf.extend_from_slice(match self {
Mechanism::Plain => b"PLAIN",
Mechanism::CramMd5 => b"CRAM-MD5",
Mechanism::DigestMd5 => b"DIGEST-MD5",
Mechanism::ScramSha1 => b"SCRAM-SHA-1",
Mechanism::ScramSha256 => b"SCRAM-SHA-256",
Mechanism::Apop => b"APOP",
Mechanism::Ntlm => b"NTLM",
Mechanism::Gssapi => b"GSSAPI",
Mechanism::Anonymous => b"ANONYMOUS",
Mechanism::External => b"EXTERNAL",
Mechanism::OAuthBearer => b"OAUTHBEARER",
Mechanism::XOauth2 => b"XOAUTH2",
});
}
pub fn into_bytes(self) -> Vec<u8> {
let mut buf = Vec::with_capacity(10);
self.serialize(&mut buf);
buf
}
}