summaryrefslogtreecommitdiff
path: root/src/audit.h
diff options
context:
space:
mode:
authorAnders Betts <anders.betts@gmail.com>2026-09-17 19:55:36 +0200
committerAnders Betts <anders.betts@gmail.com>2026-09-17 19:55:36 +0200
commit380195f7cd5e57acf2c1cf2bc41069e6b0b979ed (patch)
tree32a88fb22a7fbe8f1fd5c105156d1f928c93950d /src/audit.h
downloadbokf-0.1.0.tar.gz
bokf-0.1.0.zip
Initial commit: daemon, clients, docs, Docker deploy pipelinev0.1.0
Diffstat (limited to 'src/audit.h')
-rw-r--r--src/audit.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/audit.h b/src/audit.h
new file mode 100644
index 0000000..2031734
--- /dev/null
+++ b/src/audit.h
@@ -0,0 +1,19 @@
+#ifndef BOKF_AUDIT_H
+#define BOKF_AUDIT_H
+
+#include <sqlite3.h>
+#include <stdint.h>
+
+#include "yyjson.h"
+
+int audit_append(sqlite3 *db, int64_t org_id, int64_t user_id, int64_t token_id,
+ const char *action, const char *request_json,
+ const char *result_code, char **err);
+
+/* 0 = chain verified, 1 = chain broken, -1 = error */
+int audit_verify(sqlite3 *db, int64_t *checked, int64_t *bad_seq, char **err);
+
+/* Serialize command args for the audit log with secrets removed. */
+char *audit_args_json(yyjson_val *args);
+
+#endif