From 83c79d1fd7c92f86e62ea2a0ab356cb1171dbc66 Mon Sep 17 00:00:00 2001
From: Maurus Decimus <11444311+mdecimus@users.noreply.github.com>
Date: Tue, 7 Apr 2026 19:48:30 +0200
Subject: [PATCH] Schema adjustments
---
crates/common/src/lib.rs | 10 ----------
crates/http/src/auth/permissions.rs | 13 ++++++++-----
crates/jmap/src/registry/get.rs | 1 -
crates/jmap/src/registry/mapping/account.rs | 1 +
crates/jmap/src/registry/set.rs | 1 -
crates/registry/src/types/string.rs | 8 --------
crates/trc/src/event/enums_impl.rs | 14 ++++----------
tests/src/directory/oidc.rs | 1 +
tests/src/directory/sql.rs | 1 +
tests/src/store/registry.rs | 1 +
10 files changed, 16 insertions(+), 35 deletions(-)
diff --git a/crates/common/src/lib.rs b/crates/common/src/lib.rs
index 40c1e40b..786bbd65 100644
--- a/crates/common/src/lib.rs
+++ b/crates/common/src/lib.rs
@@ -427,16 +427,6 @@ pub struct ThrottleKeyHasher {
#[derive(Clone, Default)]
pub struct ThrottleKeyHasherBuilder {}
-pub const DEFAULT_LOGO_RAW: &str = r#"
-"#;
-
pub const DEFAULT_LOGO_BASE64: &str =
"iVBORw0KGgoAAAANSUhEUgAAAMgAAAAnCAMAAAB9lPf7AAABOFBMVEUAAAAAADoAAEkPDkIPDkIQ
DkIQDkLcLVTYMVTbLVTbLVQPDkLWM2YQDkIPD0IODEHaJlPbLVQWDT8MC0IQDkIQDkIPDkIODkEQ
diff --git a/crates/http/src/auth/permissions.rs b/crates/http/src/auth/permissions.rs
index d7c81a83..c68645e5 100644
--- a/crates/http/src/auth/permissions.rs
+++ b/crates/http/src/auth/permissions.rs
@@ -12,8 +12,7 @@ use serde::Serialize;
#[derive(Debug, Clone, Serialize)]
pub struct Permissions {
pub permissions: Vec,
- #[serde(rename = "isEnterprise")]
- pub is_enterprise: bool,
+ pub edition: &'static str,
}
pub trait PermissionsApiHandler: Sync + Send {
@@ -29,18 +28,22 @@ impl PermissionsApiHandler for Server {
access_token: &AccessToken,
) -> trc::Result {
#[cfg(not(feature = "enterprise"))]
- let is_enterprise = false;
+ let edition = "oss";
// SPDX-SnippetBegin
// SPDX-FileCopyrightText: 2020 Stalwart Labs LLC
// SPDX-License-Identifier: LicenseRef-SEL
#[cfg(feature = "enterprise")]
- let is_enterprise = self.core.is_enterprise_edition();
+ let edition = if self.core.is_enterprise_edition() {
+ "enterprise"
+ } else {
+ "community"
+ };
// SPDX-SnippetEnd
Ok(JsonResponse::new(Permissions {
permissions: access_token.permissions(),
- is_enterprise,
+ edition,
})
.into_http_response())
}
diff --git a/crates/jmap/src/registry/get.rs b/crates/jmap/src/registry/get.rs
index a7ad3d3a..b8602aa2 100644
--- a/crates/jmap/src/registry/get.rs
+++ b/crates/jmap/src/registry/get.rs
@@ -147,7 +147,6 @@ impl RegistryGet for Server {
| ObjectType::NetworkListener
| ObjectType::ClusterRole
| ObjectType::OidcProvider
- | ObjectType::RegistryBundle
| ObjectType::ReportSettings
| ObjectType::Search
| ObjectType::SearchStore
diff --git a/crates/jmap/src/registry/mapping/account.rs b/crates/jmap/src/registry/mapping/account.rs
index 166603f9..86a5e806 100644
--- a/crates/jmap/src/registry/mapping/account.rs
+++ b/crates/jmap/src/registry/mapping/account.rs
@@ -656,6 +656,7 @@ pub(crate) async fn account_get(
encryption_at_rest: account.encryption_at_rest,
locale: account.locale,
description: account.description,
+ time_zone: account.time_zone,
}
.into_value(),
);
diff --git a/crates/jmap/src/registry/set.rs b/crates/jmap/src/registry/set.rs
index 9f879e49..270edee8 100644
--- a/crates/jmap/src/registry/set.rs
+++ b/crates/jmap/src/registry/set.rs
@@ -230,7 +230,6 @@ impl RegistrySet for Server {
| ObjectType::MtaHook
| ObjectType::NetworkListener
| ObjectType::ClusterRole
- | ObjectType::RegistryBundle
| ObjectType::SieveSystemScript
| ObjectType::SieveUserScript
| ObjectType::SpamDnsblServer
diff --git a/crates/registry/src/types/string.rs b/crates/registry/src/types/string.rs
index 51e590b8..d9af552e 100644
--- a/crates/registry/src/types/string.rs
+++ b/crates/registry/src/types/string.rs
@@ -17,7 +17,6 @@ pub enum StringValidator {
Lowercase,
Uppercase,
Trim,
- SecretHash,
}
pub enum StringValidatorResult {
@@ -68,13 +67,6 @@ impl StringValidator {
StringValidatorResult::Valid
}
}
- Self::SecretHash => {
- if !value.is_empty() && value.len() <= 128 {
- StringValidatorResult::Valid
- } else {
- StringValidatorResult::Invalid("Secret cannot be empty")
- }
- }
}
}
}
diff --git a/crates/trc/src/event/enums_impl.rs b/crates/trc/src/event/enums_impl.rs
index 70c5aaf3..8e40e235 100644
--- a/crates/trc/src/event/enums_impl.rs
+++ b/crates/trc/src/event/enums_impl.rs
@@ -6,7 +6,7 @@
// This file is auto-generated. Do not edit directly.
-use crate::{Level, event::enums::*};
+use crate::{event::enums::*, Level};
use std::borrow::Cow;
impl EventType {
@@ -3706,9 +3706,7 @@ impl EventType {
EventType::Auth(AuthEvent::Success) => "Authentication error",
EventType::Auth(AuthEvent::Failed) => "Authentication failed",
EventType::Auth(AuthEvent::TokenExpired) => "Authentication error",
- EventType::Auth(AuthEvent::MfaRequired) => {
- "This account requires multi-factor authentication. Alternatively, you can use an app password if your account has one."
- }
+ EventType::Auth(AuthEvent::MfaRequired) => "This account requires multi-factor authentication. Alternatively, you can use an app password if your account has one.",
EventType::Auth(AuthEvent::TooManyAttempts) => "Too many authentication attempts",
EventType::Auth(AuthEvent::ClientRegistration) => "Authentication error",
EventType::Auth(AuthEvent::Error) => "Authentication error",
@@ -3761,9 +3759,7 @@ impl EventType {
EventType::Jmap(JmapEvent::InvalidResultReference) => "Invalid result reference",
EventType::Jmap(JmapEvent::Forbidden) => "Forbidden",
EventType::Jmap(JmapEvent::AccountNotFound) => "Account not found",
- EventType::Jmap(JmapEvent::AccountNotSupportedByMethod) => {
- "Account not supported by method"
- }
+ EventType::Jmap(JmapEvent::AccountNotSupportedByMethod) => "Account not supported by method",
EventType::Jmap(JmapEvent::AccountReadOnly) => "Account read-only",
EventType::Jmap(JmapEvent::NotFound) => "Not found",
EventType::Jmap(JmapEvent::CannotCalculateChanges) => "Cannot calculate changes",
@@ -3929,9 +3925,7 @@ impl EventType {
EventType::Smtp(SmtpEvent::UnsupportedParameter) => "SMTP error",
EventType::Smtp(SmtpEvent::SyntaxError) => "SMTP error",
EventType::Smtp(SmtpEvent::RequestTooLarge) => "SMTP error",
- EventType::Store(StoreEvent::AssertValueFailed) => {
- "Another process has modified the value"
- }
+ EventType::Store(StoreEvent::AssertValueFailed) => "Another process has modified the value",
EventType::Store(StoreEvent::FoundationdbError) => "FoundationDB error",
EventType::Store(StoreEvent::MysqlError) => "MySQL error",
EventType::Store(StoreEvent::PostgresqlError) => "PostgreSQL error",
diff --git a/tests/src/directory/oidc.rs b/tests/src/directory/oidc.rs
index 88f56a6b..3b1c50e2 100644
--- a/tests/src/directory/oidc.rs
+++ b/tests/src/directory/oidc.rs
@@ -13,6 +13,7 @@ use registry::{schema::structs, types::map::Map};
pub async fn test() {
let config = structs::OidcDirectory {
+ description: "Test OIDC directory".to_string(),
issuer_url: "http://localhost:9080/realms/stalwart".to_string(),
claim_username: "preferred_username".to_string(),
claim_name: Some("name".to_string()),
diff --git a/tests/src/directory/sql.rs b/tests/src/directory/sql.rs
index 447fae49..ac801b14 100644
--- a/tests/src/directory/sql.rs
+++ b/tests/src/directory/sql.rs
@@ -57,6 +57,7 @@ pub async fn test() {
}
let config = structs::SqlDirectory {
+ description: "Test SQL directory".to_string(),
query_login: concat!(
"SELECT name, secret, description, type FROM accounts ",
"WHERE name = $1 AND active = true"
diff --git a/tests/src/store/registry.rs b/tests/src/store/registry.rs
index 437b13f1..983e77f8 100644
--- a/tests/src/store/registry.rs
+++ b/tests/src/store/registry.rs
@@ -103,6 +103,7 @@ pub async fn test(test: &TestServer) {
roles: UserRoles::Custom(CustomRoles {
role_ids: Map::new(vec![5000u64.into()]),
}),
+ time_zone: None,
});
let account_picke = account.to_pickled_vec();
assert_eq!(