MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / define

Method define

nodedb/src/control/security/ceiling.rs:44–55  ·  view source on GitHub ↗

Define or update a ceiling for a tenant. In production, this should only be callable with a break-glass key.

(&self, ceiling: TenantCeiling)

Source from the content-addressed store, hash-verified

42 ///
43 /// In production, this should only be callable with a break-glass key.
44 pub fn define(&self, ceiling: TenantCeiling) {
45 let tid = ceiling.tenant_id;
46 let mut ceilings = self.ceilings.write().unwrap_or_else(|p| p.into_inner());
47 info!(
48 tenant_id = tid,
49 max_collections = ceiling.max_collections,
50 max_storage_bytes = ceiling.max_storage_bytes,
51 audit_min_retention_days = ceiling.audit_min_retention_days,
52 "ceiling defined"
53 );
54 ceilings.insert(tid, ceiling);
55 }
56
57 /// Get the ceiling for a tenant (if defined).
58 pub fn get(&self, tenant_id: u64) -> Option<TenantCeiling> {

Callers 2

ceiling_enforcementFunction · 0.45
define_scopeFunction · 0.45

Calls 2

writeMethod · 0.45
insertMethod · 0.45

Tested by 1

ceiling_enforcementFunction · 0.36