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

Function ss_authorize

tests/test_store_scope.c:363–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361
362typedef struct { bool deny_restore, deny_pin, pin_seen, restore_armed; int restore_denied; } ss_auth_t;
363static int ss_authorize(void *opaque,int action,const char *a,const char *b,const char *db,const char *trigger) {
364 (void)trigger; ss_auth_t *auth=opaque;
365 if (action==SQLITE_READ && ss_eq(a,"nodes") && ss_eq(db,"main") && auth->deny_pin) {
366 auth->pin_seen=true; auth->restore_armed=true; return SQLITE_DENY;
367 }
368 if (action==SQLITE_PRAGMA && a && sqlite3_stricmp(a,"query_only")==0 && b &&
369 auth->deny_restore && auth->restore_armed) {
370 auth->restore_denied++; return SQLITE_DENY;
371 }
372 return SQLITE_OK;
373}
374TEST(store_scope_close_restore_denial_requires_connection_discard) {
375 cbm_store_t *s=cbm_store_open_memory(); ss_ids_t id={0};
376 bool setup=ss_seed(s,&id) && ss_sql(s,"PRAGMA query_only=0; PRAGMA busy_timeout=2468")==SQLITE_OK;

Callers

nothing calls this directly

Calls 1

ss_eqFunction · 0.85

Tested by

no test coverage detected