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/sessions.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/sessions.h (limited to 'src/sessions.h') diff --git a/src/sessions.h b/src/sessions.h new file mode 100644 index 0000000..d573b23 --- /dev/null +++ b/src/sessions.h @@ -0,0 +1,28 @@ +#ifndef BOKF_SESSIONS_H +#define BOKF_SESSIONS_H + +#include + +struct session { + char id[64]; + int64_t user_id; + int is_admin; + int64_t active_org; + int64_t bound_org; /* token sessions are bound to one org; 0 = none */ + int64_t token_id; /* api token used to open the session, 0 for password */ + char scopes[32]; + int64_t created; + int64_t last_seen; + int64_t expires; + struct session *next; +}; + +void sessions_init(long ttl_seconds); +struct session *sessions_create(int64_t user_id, int is_admin, + int64_t active_org, int64_t bound_org, + const char *scopes); +struct session *sessions_get(const char *id); +void sessions_destroy(const char *id); +void sessions_free_all(void); + +#endif -- cgit v1.3