MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / gd_authorizer

Function gd_authorizer

tests/test_store_graph_digest.c:476–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474
475typedef struct { const char *denied_table; bool restore; unsigned denials; } gd_auth_t;
476static int gd_authorizer(void *opaque,int op,const char *a,const char *b,const char *db,const char *trigger) {
477 gd_auth_t *c=opaque;(void)db;(void)trigger;
478 if(op==SQLITE_READ && a && c->denied_table &&
479 (strcmp(a,c->denied_table)==0 || (strcmp(c->denied_table,"@schema")==0 &&
480 (strcmp(a,"sqlite_master")==0 || strcmp(a,"sqlite_schema")==0)))) {
481 c->denials++;return SQLITE_DENY;
482 }
483 if(c->restore && op==SQLITE_PRAGMA && a && b && strcmp(a,"query_only")==0)return SQLITE_DENY;
484 return SQLITE_OK;
485}
486TEST(store_graph_digest_sql_errors_cleanup_no_mutation_and_close_discard) {
487 for(int phase=0;phase<2;phase++) {
488 cbm_store_t *s=gd_fixture(false,false);sqlite3 *db=s?cbm_store_get_db(s):NULL;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected