aboutsummaryrefslogtreecommitdiff
path: root/src/audit.h
blob: 2031734cbe3a772248a1ac745fdc83d0c46cf87b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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