refactor: rename main class and centralize constants
This commit is contained in:
parent
29ef24a1d3
commit
db52a5cfa5
2
pom.xml
2
pom.xml
@ -54,7 +54,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<archive>
|
<archive>
|
||||||
<manifest>
|
<manifest>
|
||||||
<mainClass>cz.trask.adfs.AdfsAuthMsServer</mainClass>
|
<mainClass>cz.trask.adfs.AdfsAuthServer</mainClass>
|
||||||
</manifest>
|
</manifest>
|
||||||
</archive>
|
</archive>
|
||||||
<descriptorRefs>
|
<descriptorRefs>
|
||||||
|
|||||||
@ -1,6 +1,10 @@
|
|||||||
package cz.trask.adfs;
|
package cz.trask.adfs;
|
||||||
|
|
||||||
public final class AdfsAuthMsConstants {
|
public final class AdfsAuthConstants {
|
||||||
|
|
||||||
|
private AdfsAuthConstants() {
|
||||||
|
// utility class
|
||||||
|
}
|
||||||
|
|
||||||
public static final String AUTH_PREFIX_BEARER = "Bearer ";
|
public static final String AUTH_PREFIX_BEARER = "Bearer ";
|
||||||
public static final String HEADER_AUTHORIZATION = "Authorization";
|
public static final String HEADER_AUTHORIZATION = "Authorization";
|
||||||
@ -23,16 +23,16 @@ import cz.trask.adfs.config.AppConfig.ContextConfig;
|
|||||||
import cz.trask.adfs.config.ConfigurationManager;
|
import cz.trask.adfs.config.ConfigurationManager;
|
||||||
import cz.trask.adfs.context.BaseContextHandler;
|
import cz.trask.adfs.context.BaseContextHandler;
|
||||||
import cz.trask.adfs.service.AdfsTokenService;
|
import cz.trask.adfs.service.AdfsTokenService;
|
||||||
import static cz.trask.adfs.AdfsAuthMsConstants.*;
|
import static cz.trask.adfs.AdfsAuthConstants.*;
|
||||||
|
|
||||||
public class AdfsAuthMsServer {
|
public class AdfsAuthServer {
|
||||||
|
|
||||||
private static final Logger logger = LogManager.getLogger(AdfsAuthMsServer.class);
|
private static final Logger logger = LogManager.getLogger(AdfsAuthServer.class);
|
||||||
|
|
||||||
private final HttpServer server;
|
private final HttpServer server;
|
||||||
|
|
||||||
public AdfsAuthMsServer() throws Exception {
|
public AdfsAuthServer() throws Exception {
|
||||||
logger.debug("Initializing AdfsAuthMsServer");
|
logger.debug("Initializing AdfsAuthServer");
|
||||||
ConfigurationManager configurationManager = ConfigurationManager.load();
|
ConfigurationManager configurationManager = ConfigurationManager.load();
|
||||||
AppConfig config = configurationManager.getConfig();
|
AppConfig config = configurationManager.getConfig();
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
@ -55,7 +55,7 @@ public class AdfsAuthMsServer {
|
|||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
try {
|
try {
|
||||||
AdfsAuthMsServer server = new AdfsAuthMsServer();
|
AdfsAuthServer server = new AdfsAuthServer();
|
||||||
server.start();
|
server.start();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Failed to start ADFS auth microservice", e);
|
logger.error("Failed to start ADFS auth microservice", e);
|
||||||
@ -13,7 +13,7 @@ import com.sun.net.httpserver.Headers;
|
|||||||
import com.sun.net.httpserver.HttpExchange;
|
import com.sun.net.httpserver.HttpExchange;
|
||||||
|
|
||||||
import cz.trask.adfs.dto.TokenPayloadIdp;
|
import cz.trask.adfs.dto.TokenPayloadIdp;
|
||||||
import static cz.trask.adfs.AdfsAuthMsConstants.*;
|
import static cz.trask.adfs.AdfsAuthConstants.*;
|
||||||
|
|
||||||
public class ProcessHandler extends BaseContextHandler {
|
public class ProcessHandler extends BaseContextHandler {
|
||||||
|
|
||||||
|
|||||||
@ -33,7 +33,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
|
|
||||||
import cz.trask.adfs.config.AdfsConfig;
|
import cz.trask.adfs.config.AdfsConfig;
|
||||||
import cz.trask.adfs.dto.TokenPayloadIdp;
|
import cz.trask.adfs.dto.TokenPayloadIdp;
|
||||||
import static cz.trask.adfs.AdfsAuthMsConstants.*;
|
import static cz.trask.adfs.AdfsAuthConstants.*;
|
||||||
|
|
||||||
public class AdfsTokenService {
|
public class AdfsTokenService {
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user