implemented user impersonization

This commit is contained in:
2025-07-02 23:20:21 +02:00
parent ea6ca9e45d
commit 5100ac244a
12 changed files with 198 additions and 63 deletions

View File

@@ -16,8 +16,10 @@ import java.net.InetSocketAddress;
import java.util.concurrent.Executors;
public class Application {
private static final System.Logger LOG = System.getLogger("Umbrella");
private static final String USER_DB = "/home/srichter/workspace/umbrella/data/umbrella.db";
private static final System.Logger LOG = System.getLogger("Umbrella");
private static final String USER_DB = "/home/srichter/workspace/umbrella/data/umbrella.db";
private static final String LOGIN_SERVICE_DB = "/home/srichter/workspace/umbrella/data/umbrella.db";
public static void main(String[] args) throws IOException {
ColorLogger.setRootLogLevel(DEBUG);
LOG.log(INFO, "Starting Umbrella:");
@@ -25,10 +27,11 @@ public class Application {
var threads = 16;
var connectionProvider = new ConnectionProvider();
var userDb = new SqliteDB(connectionProvider.get(USER_DB));
var loginServicedb = new SqliteDB(connectionProvider.get(LOGIN_SERVICE_DB));
HttpServer server = HttpServer.create(new InetSocketAddress(port), 0);
server.setExecutor(Executors.newFixedThreadPool(threads));
new WebHandler().bindPath("/").on(server);
new UserModule(userDb).bindPath("/api/user").on(server);
new UserModule(userDb,loginServicedb).bindPath("/api/user").on(server);
new Translations().bindPath("/api/translations").on(server);
LOG.log(INFO,"Started web server at {0}",port);
server.start();