mirror of
https://github.com/plexusorg/Module-HTTPD.git
synced 2024-12-22 07:55:01 +00:00
Update to Jetty 12
This commit is contained in:
parent
44dc3c1e9e
commit
b81a7a8ca0
8 changed files with 10 additions and 30 deletions
|
@ -36,9 +36,9 @@ dependencies {
|
||||||
implementation("dev.plex:server:1.5-SNAPSHOT")
|
implementation("dev.plex:server:1.5-SNAPSHOT")
|
||||||
implementation("org.json:json:20240303")
|
implementation("org.json:json:20240303")
|
||||||
implementation("org.reflections:reflections:0.10.2")
|
implementation("org.reflections:reflections:0.10.2")
|
||||||
implementation("org.eclipse.jetty:jetty-server:11.0.24")
|
implementation("org.eclipse.jetty:jetty-server:12.0.14")
|
||||||
implementation("org.eclipse.jetty:jetty-servlet:11.0.24")
|
implementation("org.eclipse.jetty.ee10:jetty-ee10-servlet:12.0.14")
|
||||||
implementation("org.eclipse.jetty:jetty-proxy:11.0.24")
|
implementation("org.eclipse.jetty:jetty-proxy:12.0.14")
|
||||||
implementation("com.github.MilkBowl:VaultAPI:1.7.1") {
|
implementation("com.github.MilkBowl:VaultAPI:1.7.1") {
|
||||||
exclude("org.bukkit", "bukkit")
|
exclude("org.bukkit", "bukkit")
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@ import lombok.Getter;
|
||||||
import net.milkbowl.vault.permission.Permission;
|
import net.milkbowl.vault.permission.Permission;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||||
|
import org.eclipse.jetty.ee10.servlet.ServletContextHandler;
|
||||||
|
import org.eclipse.jetty.ee10.servlet.ServletHandler;
|
||||||
|
import org.eclipse.jetty.ee10.servlet.ServletHolder;
|
||||||
import org.eclipse.jetty.server.*;
|
import org.eclipse.jetty.server.*;
|
||||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
|
||||||
import org.eclipse.jetty.servlet.ServletHandler;
|
|
||||||
import org.eclipse.jetty.servlet.ServletHolder;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
|
@ -71,7 +71,9 @@ public class HTTPDModule extends PlexModule
|
||||||
Server server = new Server();
|
Server server = new Server();
|
||||||
ServletHandler servletHandler = new ServletHandler();
|
ServletHandler servletHandler = new ServletHandler();
|
||||||
|
|
||||||
context = new ServletContextHandler(servletHandler, "/", ServletContextHandler.SESSIONS);
|
context = new ServletContextHandler(ServletContextHandler.SESSIONS);
|
||||||
|
context.setHandler(servletHandler);
|
||||||
|
context.setContextPath("/");
|
||||||
HttpConfiguration configuration = new HttpConfiguration();
|
HttpConfiguration configuration = new HttpConfiguration();
|
||||||
configuration.addCustomizer(new ForwardedRequestCustomizer());
|
configuration.addCustomizer(new ForwardedRequestCustomizer());
|
||||||
HttpConnectionFactory factory = new HttpConnectionFactory(configuration);
|
HttpConnectionFactory factory = new HttpConnectionFactory(configuration);
|
||||||
|
|
|
@ -6,12 +6,6 @@ import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.time.ZonedDateTime;
|
import java.time.ZonedDateTime;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 6:37 PM [03-05-2024]
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@Accessors(fluent = true)
|
@Accessors(fluent = true)
|
||||||
|
|
|
@ -5,10 +5,6 @@ import dev.plex.authentication.impl.DiscordOAuth2Provider;
|
||||||
import dev.plex.util.PlexLog;
|
import dev.plex.util.PlexLog;
|
||||||
import org.apache.commons.lang3.NotImplementedException;
|
import org.apache.commons.lang3.NotImplementedException;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 7:08 PM [03-05-2024]
|
|
||||||
*/
|
|
||||||
public class AuthenticationManager
|
public class AuthenticationManager
|
||||||
{
|
{
|
||||||
private final OAuth2Provider provider;
|
private final OAuth2Provider provider;
|
||||||
|
|
|
@ -4,10 +4,6 @@ import org.eclipse.jetty.server.Response;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 6:36 PM [03-05-2024]
|
|
||||||
*/
|
|
||||||
public interface OAuth2Provider
|
public interface OAuth2Provider
|
||||||
{
|
{
|
||||||
HashMap<String, AuthenticatedUser> sessions();
|
HashMap<String, AuthenticatedUser> sessions();
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package dev.plex.authentication;
|
package dev.plex.authentication;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 6:37 PM [03-05-2024]
|
|
||||||
*/
|
|
||||||
public enum UserType
|
public enum UserType
|
||||||
{
|
{
|
||||||
DISCORD, UNKNOWN
|
DISCORD, UNKNOWN
|
||||||
|
|
|
@ -13,10 +13,6 @@ import java.net.URLEncoder;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author Taah
|
|
||||||
* @since 6:41 PM [03-05-2024]
|
|
||||||
*/
|
|
||||||
public class DiscordOAuth2Provider implements OAuth2Provider
|
public class DiscordOAuth2Provider implements OAuth2Provider
|
||||||
{
|
{
|
||||||
private final HashMap<String, AuthenticatedUser> sessions = Maps.newHashMap();
|
private final HashMap<String, AuthenticatedUser> sessions = Maps.newHashMap();
|
||||||
|
|
|
@ -18,7 +18,7 @@ import java.text.StringCharacterIterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.eclipse.jetty.servlet.ServletHolder;
|
import org.eclipse.jetty.ee10.servlet.ServletHolder;
|
||||||
|
|
||||||
public class AbstractServlet extends HttpServlet
|
public class AbstractServlet extends HttpServlet
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue