MCPcopy Create free account
hub / github.com/GraphLite-AI/GraphLite / init

Method init

graphlite/src/catalog/providers/security.rs:558–591  ·  view source on GitHub ↗
(&mut self, storage: Arc<StorageManager>)

Source from the content-addressed store, hash-verified

556
557impl CatalogProvider for SecurityCatalog {
558 fn init(&mut self, storage: Arc<StorageManager>) -> CatalogResult<()> {
559 self.storage = Some(storage.clone());
560
561 // Try to load persisted state from storage
562 match storage.load_catalog_provider("security") {
563 Ok(Some(data)) => {
564 // Load persisted catalog state
565 match self.load(&data) {
566 Ok(_) => {
567 log::info!(
568 "Security catalog loaded from storage with {} users, {} roles",
569 self.users.len(),
570 self.roles.len()
571 );
572 }
573 Err(e) => {
574 log::warn!("Failed to deserialize security catalog from storage: {}. Using defaults.", e);
575 }
576 }
577 }
578 Ok(None) => {
579 // This is expected on first run - no catalog data exists yet
580 log::debug!("No persisted security catalog found. Using default initialization.");
581 }
582 Err(e) => {
583 log::warn!(
584 "Error loading security catalog: {}. Using default initialization.",
585 e
586 );
587 }
588 }
589
590 Ok(())
591 }
592
593 fn execute(&mut self, op: CatalogOperation) -> CatalogResult<CatalogResponse> {
594 match op {

Callers

nothing calls this directly

Calls 3

cloneMethod · 0.80
load_catalog_providerMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected