Registry store implementation - part 1

This commit is contained in:
mdecimus
2026-02-17 21:55:28 +00:00
parent b5ff8b5952
commit 2a557c58e5
26 changed files with 1161 additions and 320 deletions

View File

@@ -12,7 +12,7 @@ use jmap_proto::{
types::state::State,
};
use jmap_tools::{Key, Map, Value};
use registry::schema::prelude::{Object, Permission, Property};
use registry::schema::prelude::{Object, Permission};
use std::future::Future;
use store::{registry::RegistryQuery, roaring::RoaringBitmap};
use trc::AddContext;
@@ -52,8 +52,7 @@ impl PrincipalGet for Server {
let principal_ids = self
.registry()
.query::<RoaringBitmap>(
RegistryQuery::new(Object::Account)
.equal_opt(Property::MemberTenantId, access_token.tenant_id()),
RegistryQuery::new(Object::Account).with_tenant(access_token.tenant_id()),
)
.await
.caused_by(trc::location!())?;

View File

@@ -52,8 +52,7 @@ impl PrincipalQuery for Server {
let principal_ids = self
.registry()
.query::<RoaringBitmap>(
RegistryQuery::new(Object::Account)
.equal_opt(Property::MemberTenantId, access_token.tenant_id()),
RegistryQuery::new(Object::Account).with_tenant(access_token.tenant_id()),
)
.await
.caused_by(trc::location!())?;
@@ -88,10 +87,7 @@ impl PrincipalQuery for Server {
self.registry()
.query::<RoaringBitmap>(
RegistryQuery::new(Object::Account)
.equal_opt(
Property::MemberTenantId,
access_token.tenant_id(),
)
.with_tenant(access_token.tenant_id())
.text(text),
)
.await
@@ -113,10 +109,7 @@ impl PrincipalQuery for Server {
.query::<RoaringBitmap>(
RegistryQuery::new(Object::Account)
.equal(Property::Type, typ.to_id())
.equal_opt(
Property::MemberTenantId,
access_token.tenant_id(),
),
.with_tenant(access_token.tenant_id()),
)
.await
.caused_by(trc::location!())?,