src/server/daemon/auth.h

changeset 415
d938228c382e
parent 400
d814b29e8d96
--- a/src/server/daemon/auth.h	Wed Nov 02 19:19:01 2022 +0100
+++ b/src/server/daemon/auth.h	Sun Nov 06 15:53:32 2022 +0100
@@ -33,7 +33,8 @@
 #include <inttypes.h>
 #include "../public/auth.h"
 
-#include <ucx/map.h>
+#include <cx/map.h>
+#include <cx/string.h>
 
 #ifdef	__cplusplus
 extern "C" {
@@ -42,7 +43,7 @@
 typedef struct {
     User     user;
     char     *authdb;
-    sstr_t   *groups;
+    cxmutstr *groups;
     size_t   numgroups;
     char     *password;
     uint32_t ref;
@@ -52,7 +53,7 @@
 struct user_cache_elm {
     CachedUser       *user;
     UserCacheElm     *next_user; // next elm in the cached user list
-    struct UcxMapKey key;        // key to access this element
+    CxHashKey        key;        // key to access this element
     size_t           slot;       // slot in the map
     UserCacheElm     *next_elm;  // next element in this map slot
     time_t           created;
@@ -69,18 +70,18 @@
 
 void auth_cache_init();
 
-User* auth_cache_get(char *authdb, char *user);
+User* auth_cache_get(char *authdb, const char *user);
 void auth_cache_add(
         char *authdb,
         User *user,
-        char *password,
-        char **groups,
+        const char *password,
+        const char **groups,
         size_t numgroups);
 
 void auth_cache_remove_from_map(UserCacheElm *elm);
 
-int cached_user_verify_password(CachedUser *user, char *password);
-int cached_user_check_group(CachedUser *user, char *group);
+int cached_user_verify_password(CachedUser *user, const char *password);
+int cached_user_check_group(CachedUser *user, const char *group);
 void cached_user_unref(CachedUser *user);
 void cached_user_delete(CachedUser *user);
 

mercurial