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

Function ceiling_enforcement

nodedb/src/control/security/ceiling.rs:152–164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

150
151 #[test]
152 fn ceiling_enforcement() {
153 let store = CeilingStore::new();
154 store.define(TenantCeiling {
155 tenant_id: 1,
156 max_collections: 10,
157 max_storage_bytes: 1024 * 1024 * 1024,
158 audit_min_retention_days: 365,
159 });
160
161 assert!(store.check_collection_limit(1, 5).is_ok());
162 assert!(store.check_collection_limit(1, 10).is_err());
163 assert!(store.check_collection_limit(2, 999).is_ok()); // No ceiling for tenant 2.
164 }
165
166 #[test]
167 fn audit_always_forbidden() {

Callers

nothing calls this directly

Calls 1

defineMethod · 0.45

Tested by

no test coverage detected