One edition: the last enterprise gates come out of shared code (SPEC 2.3)
Every one of the 14 was `#[cfg(not(feature = "enterprise"))]` on the arm the fork always compiles: the Enterprise arms went with the import, and nothing turns the feature on. Removing the attribute leaves the same code, now unconditional, in 11 files. Two of them looked like behavior worth checking before touching: the `validate_tenant_quota` stub that always passes, and the refusal to cancel a pending DestroyAccount task. The stub is vestigial — the rebuilt multi-tenancy enforces quotas in `crates/features/src/tenancy/quota.rs` for those objects and more — and the refusal is undelete's open question, which this change leaves exactly as it was. The binary builds with no new warnings, and `system_tests` and `jmap_tests`, which cover the touched registry, task-manager and auth paths, both pass. The feature definitions stay in the manifests, inert: taking them out would widen every sync's diff for nothing.
This commit is contained in:
@@ -397,7 +397,6 @@ impl RegistryGet for Server {
|
||||
ObjectType::ArchivedItem => crate::inbuxa::undelete::get(get)
|
||||
.await
|
||||
.map(|get| get.into_response()),
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
#[allow(unreachable_patterns)] // inbuxa: every object type has an arm now
|
||||
_ => Ok(get.not_found_any().into_response()),
|
||||
}
|
||||
|
||||
@@ -345,7 +345,6 @@ pub(crate) async fn validate_role(
|
||||
}
|
||||
|
||||
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
pub async fn validate_tenant_quota(
|
||||
_server: &Server,
|
||||
_access_token: &AccessToken,
|
||||
@@ -360,7 +359,6 @@ pub async fn schedule_account_destruction(
|
||||
account: &Account,
|
||||
) -> trc::Result<()> {
|
||||
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
let status = TaskStatus::now();
|
||||
|
||||
let (account_domain_id, account_name, account_type) = match account {
|
||||
|
||||
@@ -264,7 +264,6 @@ pub(crate) async fn task_set(
|
||||
let due = task.due_timestamp();
|
||||
|
||||
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
if let Task::DestroyAccount(_) = task {
|
||||
set.response.not_destroyed.append(
|
||||
id,
|
||||
|
||||
@@ -907,7 +907,6 @@ impl RegistrySet for Server {
|
||||
set.fail_all_destroy("Telemetry objects cannot be deleted");
|
||||
Ok(set.into_response())
|
||||
}
|
||||
#[cfg(not(feature = "enterprise"))]
|
||||
#[allow(unreachable_patterns)] // inbuxa: ArchivedItem was the last one
|
||||
_ => {
|
||||
set.fail_all_create("Enterprise objects cannot be created");
|
||||
|
||||
Reference in New Issue
Block a user