Commit 7093e195 authored by Philipp Schafft's avatar Philipp Schafft 🦁
Browse files

Feature: Added support to type="static" <role> to list user

This adds support to list the user for a static <role>.
parent 1c550b0c
......@@ -57,6 +57,17 @@ static void clear_auth (auth_t *auth) {
auth->state = NULL;
static auth_result static_userlist(auth_t *auth, xmlNodePtr srcnode) {
auth_static_t *auth_info = auth->state;
xmlNodePtr newnode;
newnode = xmlNewChild(srcnode, NULL, XMLSTR("User"), NULL);
xmlNewChild(newnode, NULL, XMLSTR("username"), XMLSTR(auth_info->username));
xmlNewChild(newnode, NULL, XMLSTR("password"), XMLSTR(auth_info->password));
return AUTH_OK;
int auth_get_static_auth (auth_t *authenticator, config_options_t *options) {
auth_static_t *auth_info;
int need_user;
......@@ -75,6 +86,7 @@ int auth_get_static_auth (auth_t *authenticator, config_options_t *options) {
return -1;
authenticator->authenticate_client = static_auth;
authenticator->listuser = static_userlist;
authenticator->free = clear_auth;
authenticator->state = auth_info;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment