#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