JMAP Registry API implementation - part 1

This commit is contained in:
mdecimus
2026-02-22 19:41:56 +01:00
parent f2c2ad6748
commit ec148c5550
21 changed files with 733 additions and 220 deletions

View File

@@ -17,7 +17,6 @@ use dns_update::DnsUpdater;
use registry::schema::structs;
use rustls::sign::CertifiedKey;
use std::{fmt::Debug, sync::Arc, time::Duration};
use store::registry::RegistryObject;
pub struct AcmeProvider {
pub id: String,

View File

@@ -13,7 +13,7 @@ use ahash::AHashSet;
use registry::{
schema::{
enums::BlockReason,
prelude::{HashedObject, Object, ObjectType},
prelude::{Object, ObjectType},
structs::{self, AllowedIp, BlockedIp, Rate},
},
types::{datetime::UTCDateTime, ipmask::IpAddrOrMask},
@@ -65,10 +65,10 @@ impl Security {
let mut expired_allows = Vec::new();
let now = now() as i64;
for ip in bp.list_infallible::<HashedObject<AllowedIp>>().await {
for ip in bp.list_infallible::<AllowedIp>().await {
let id = ip.id;
let revision = ip.object.revision;
let ip = ip.object.object;
let revision = ip.revision;
let ip = ip.object;
if ip.expires_at.as_ref().is_none_or(|ip| ip.timestamp() > now) {
if let Some(ip) = ip.address.try_to_ip() {
@@ -328,10 +328,10 @@ impl BlockedIps {
let mut expired_blocks = Vec::new();
let now = now() as i64;
for ip in bp.list_infallible::<HashedObject<BlockedIp>>().await {
for ip in bp.list_infallible::<BlockedIp>().await {
let id = ip.id;
let revision = ip.object.revision;
let ip = ip.object.object;
let revision = ip.revision;
let ip = ip.object;
if ip.expires_at.as_ref().is_none_or(|ip| ip.timestamp() > now) {
if let Some(ip) = ip.address.try_to_ip() {