Commit 408383fe authored by jan.koester's avatar jan.koester
Browse files

test

parent 96beb305
Loading
Loading
Loading
Loading
+3 −0
Changes for data/config.yaml: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,5 +14,8 @@ AUTHDB:
    PORT: 9090
    BIND: "0.0.0.0"
    MAXCONN: 1024
    CLUSTER:
        ENABLE: "false"
        PATH: "/tmp/cluster.db"
    ADMINDB:
        PATH: "/tmp/admin.db"
+10 −1
Changes for src/authdb.cpp: 10 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -553,9 +553,18 @@ int main(int argc,char *argv[]){
                      << " with " << ccfg.peers.size() << " peer(s)" << std::endl;
        }

        std::string backendPath;
        if (clusterEnabled) {
            auto *clusterPath = config.getKey("/AUTHDB/CLUSTER/PATH");
            if (clusterPath)
                backendPath = config.getValue(clusterPath, 0);
        } else {
            backendPath = config.getValue(config.getKey("/AUTHDB/ADMINDB/PATH"), 0);
        }

        authdb::AuthBackend backend(
            clusterEnabled ? authdb::AuthBackendType::ClusterStore : authdb::AuthBackendType::File,
            clusterEnabled ? "" : config.getValue(config.getKey("/AUTHDB/ADMINDB/PATH"),0),
            backendPath,
            "admin.local"
        );

+2 −2
Changes for src/backend.cpp: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ authdb::AuthBackend::AuthBackend(int type, const std::string &options,const std:
    if(_Type==AuthBackendType::File){
        _Api =  new class File(_Options.c_str(),VERSION,_Domain.c_str());
    }else if(_Type==AuthBackendType::ClusterStore){
        _Api = new class ClusterBackend(_Domain.c_str(),VERSION);
        _Api = new class ClusterBackend(_Domain.c_str(),VERSION,_Options.c_str());
    }else{
        throw AuthBackendError("unkown file backend");
    }
@@ -46,7 +46,7 @@ authdb::AuthBackend::AuthBackend(const AuthBackend &backend){
    if(_Type==AuthBackendType::File){
        _Api = new class File(backend._Options.c_str(),VERSION,backend._Domain.c_str());
    }else if(_Type==AuthBackendType::ClusterStore){
        _Api = new class ClusterBackend(backend._Domain.c_str(),VERSION);
        _Api = new class ClusterBackend(backend._Domain.c_str(),VERSION,backend._Options.c_str());
    }
}