Minor refactors
This commit is contained in:
@@ -51,12 +51,12 @@ tasks.register<Jar>("jarExternalApp") {
|
|||||||
dependsOn("classes")
|
dependsOn("classes")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.register<Jar>("jarHttpsServer") {
|
tasks.register<Jar>("jarHttpServer") {
|
||||||
manifest {
|
manifest {
|
||||||
attributes["Main-Class"] = "Main"
|
attributes["Main-Class"] = "Main"
|
||||||
}
|
}
|
||||||
archiveBaseName.set("httpsServer")
|
archiveBaseName.set("httpServer")
|
||||||
from(sourceSets["httpsServer"].output)
|
from(sourceSets["httpServer"].output)
|
||||||
dependsOn("classes")
|
dependsOn("classes")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ tasks.named("build") {
|
|||||||
dependsOn("jarAcq")
|
dependsOn("jarAcq")
|
||||||
dependsOn("jarAcs")
|
dependsOn("jarAcs")
|
||||||
dependsOn("jarExternalApp")
|
dependsOn("jarExternalApp")
|
||||||
dependsOn("jarHttpsServer")
|
dependsOn("jarHttpServer")
|
||||||
}
|
}
|
||||||
|
|
||||||
group = "be.naaturel"
|
group = "be.naaturel"
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package httpsServer.httpServer.src;
|
package httpServer.httpServer.src;
|
||||||
|
|
||||||
import com.sun.net.httpserver.HttpServer;
|
import com.sun.net.httpserver.HttpServer;
|
||||||
import common.common.src.logger.Logger;
|
import common.common.src.logger.Logger;
|
||||||
import httpsServer.httpServer.src.handlers.IRequestHandler;
|
import httpServer.httpServer.src.handlers.IRequestHandler;
|
||||||
import httpsServer.httpServer.src.handlers.RequestHandler;
|
import httpServer.httpServer.src.handlers.RequestHandler;
|
||||||
import httpsServer.httpServer.src.interceptors.RequestInterceptor;
|
import httpServer.httpServer.src.interceptors.RequestInterceptor;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.lang.reflect.Proxy;
|
import java.lang.reflect.Proxy;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package httpsServer.httpServer.src.annotations;
|
package httpServer.httpServer.src.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package httpsServer.httpServer.src.annotations;
|
package httpServer.httpServer.src.annotations;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package httpsServer.httpServer.src.authorization;
|
package httpServer.httpServer.src.authorization;
|
||||||
|
|
||||||
import org.springframework.security.crypto.bcrypt.BCrypt;
|
import org.springframework.security.crypto.bcrypt.BCrypt;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package httpsServer.httpServer.src.authorization;
|
package httpServer.httpServer.src.authorization;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package httpsServer.httpServer.src.authorization;
|
package httpServer.httpServer.src.authorization;
|
||||||
|
|
||||||
import org.springframework.security.crypto.bcrypt.BCrypt;
|
import org.springframework.security.crypto.bcrypt.BCrypt;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package httpsServer.httpServer.src.exceptions;
|
package httpServer.httpServer.src.exceptions;
|
||||||
|
|
||||||
public class ClientAuthorisationException extends Exception {
|
public class ClientAuthorisationException extends Exception {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package httpsServer.httpServer.src.exceptions;
|
package httpServer.httpServer.src.exceptions;
|
||||||
|
|
||||||
public class NoSuchVerbException extends Exception {
|
public class NoSuchVerbException extends Exception {
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package httpsServer.httpServer.src.handlers;
|
package httpServer.httpServer.src.handlers;
|
||||||
|
|
||||||
import com.sun.net.httpserver.HttpExchange;
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
|
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
package httpsServer.httpServer.src.handlers;
|
package httpServer.httpServer.src.handlers;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import com.sun.net.httpserver.HttpExchange;
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
import common.common.src.html.HtmlManager;
|
import common.common.src.html.HtmlManager;
|
||||||
import common.common.src.logger.Logger;
|
import common.common.src.logger.Logger;
|
||||||
import httpsServer.httpServer.src.annotations.AllowedVerb;
|
import httpServer.httpServer.src.annotations.AllowedVerb;
|
||||||
import httpsServer.httpServer.src.annotations.OnlyAuthorizedClients;
|
import httpServer.httpServer.src.annotations.OnlyAuthorizedClients;
|
||||||
import httpsServer.httpServer.src.authorization.AuthorizedClients;
|
import httpServer.httpServer.src.authorization.AuthorizedClients;
|
||||||
import httpsServer.httpServer.src.authorization.Client;
|
import httpServer.httpServer.src.authorization.Client;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
@@ -1,16 +1,14 @@
|
|||||||
package httpsServer.httpServer.src.interceptors;
|
package httpServer.httpServer.src.interceptors;
|
||||||
|
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
|
||||||
import com.sun.net.httpserver.HttpExchange;
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
import httpsServer.httpServer.src.annotations.AllowedVerb;
|
import httpServer.httpServer.src.annotations.AllowedVerb;
|
||||||
import httpsServer.httpServer.src.annotations.OnlyAuthorizedClients;
|
import httpServer.httpServer.src.annotations.OnlyAuthorizedClients;
|
||||||
import httpsServer.httpServer.src.authorization.AuthorizedClients;
|
import httpServer.httpServer.src.authorization.AuthorizedClients;
|
||||||
import httpsServer.httpServer.src.exceptions.NoSuchVerbException;
|
import httpServer.httpServer.src.exceptions.NoSuchVerbException;
|
||||||
import httpsServer.httpServer.src.exceptions.ClientAuthorisationException;
|
import httpServer.httpServer.src.exceptions.ClientAuthorisationException;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
import java.util.Base64;
|
|
||||||
|
|
||||||
public class RequestInterceptor implements InvocationHandler {
|
public class RequestInterceptor implements InvocationHandler {
|
||||||
|
|
||||||
Reference in New Issue
Block a user