Commit 96beb305 authored by jan.koester's avatar jan.koester
Browse files

test

parent 177a289a
Loading
Loading
Loading
Loading
Loading
+1 −1
Changes for src/gpo_default.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
#pragma once

namespace authdb {
    const char *gpo_default[][4]={
    inline const char *gpo_default[][4]={
        {"888cd19b-352d-11f0-a8cc-3cecefce9ac2","AuthDB: Can Login Admin Interface","Make it possible to Login into Admin Interface from AuthDB","true"},
        {nullptr}
    };
+21 −0
Changes for src/session.cpp: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include "backend.h"
#include "group.h"
#include "gpo.h"
#include "gpo_default.h"
#include "types.h"
#include "exception.h"
#include "cluster.h"
@@ -319,6 +320,26 @@ const authdb::SessionData *authdb::Session::addSession(AuthBackend &backend,uuid
        }
    }

    // Populate default GPOs that are missing from the backend
    for(size_t i=0; gpo_default[i][0]!=nullptr; ++i){
        uuid::uuid defid(gpo_default[i][0]);
        bool found=false;
        for(const SessionData::GPOResult *cures=&newSession->_GPOResult; cures; cures=cures->next){
            if(cures->GPOId==defid){
                found=true;
                break;
            }
        }
        if(!found){
            if(!gpores->GPOId.empty()){
                gpores->next=new SessionData::GPOResult();
                gpores=gpores->next;
            }
            gpores->GPOId=defid;
            gpores->GPORes=(strcmp(gpo_default[i][3],"true")==0);
        }
    }

    {
        std::lock_guard<std::mutex> guard(_SessionLock);

+1 −1
Changes for test/docker/Dockerfile: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ RUN git clone https://tuxist.de/git/tuxist/libparitypp.git && \

RUN git clone https://tuxist.de/git/jan.koester/authdb.git && \
    mkdir authdb/build && \
    cd authdb/build && cmake ../ -G Ninja -DDATAPATH:PATH=/usr/local/share/authdb && ninja install
    cd authdb/build && cmake ../ -G Ninja -DBUILD_BINDINGS=OFF -DDATAPATH:PATH=/usr/local/share/authdb && ninja install

# --- Runtime stage ---
FROM node:alpine