From 380195f7cd5e57acf2c1cf2bc41069e6b0b979ed Mon Sep 17 00:00:00 2001 From: Anders Betts Date: Thu, 17 Sep 2026 19:55:36 +0200 Subject: Initial commit: daemon, clients, docs, Docker deploy pipeline --- src/auth.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/auth.h (limited to 'src/auth.h') diff --git a/src/auth.h b/src/auth.h new file mode 100644 index 0000000..630d8dc --- /dev/null +++ b/src/auth.h @@ -0,0 +1,19 @@ +#ifndef BOKF_AUTH_H +#define BOKF_AUTH_H + +#include +#include + +#define AUTH_TOKEN_PREFIX "bokf_" + +int auth_hash_password(const char *pw, char **out_phc); +int auth_verify_password(const char *phc, const char *pw); +void auth_hash_token(const char *token, unsigned char out[32]); +char *auth_generate_token(void); + +/* Returns user id > 0, -1 if not found, -2 on database error. */ +int64_t auth_user_lookup(sqlite3 *db, const char *username, char **out_pwhash, + char **out_display, int *out_is_admin, + int *out_disabled); + +#endif -- cgit v1.3