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>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>cz.trask.adfs.AdfsAuthMsServer</mainClass>
|
||||
<mainClass>cz.trask.adfs.AdfsAuthServer</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
<descriptorRefs>
|
||||
|
||||
@ -1,6 +1,10 @@
|
||||
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 HEADER_AUTHORIZATION = "Authorization";
|
||||
@ -23,16 +23,16 @@ import cz.trask.adfs.config.AppConfig.ContextConfig;
|
||||
import cz.trask.adfs.config.ConfigurationManager;
|
||||
import cz.trask.adfs.context.BaseContextHandler;
|
||||
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;
|
||||
|
||||
public AdfsAuthMsServer() throws Exception {
|
||||
logger.debug("Initializing AdfsAuthMsServer");
|
||||
public AdfsAuthServer() throws Exception {
|
||||
logger.debug("Initializing AdfsAuthServer");
|
||||
ConfigurationManager configurationManager = ConfigurationManager.load();
|
||||
AppConfig config = configurationManager.getConfig();
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
@ -55,7 +55,7 @@ public class AdfsAuthMsServer {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
try {
|
||||
AdfsAuthMsServer server = new AdfsAuthMsServer();
|
||||
AdfsAuthServer server = new AdfsAuthServer();
|
||||
server.start();
|
||||
} catch (Exception 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 cz.trask.adfs.dto.TokenPayloadIdp;
|
||||
import static cz.trask.adfs.AdfsAuthMsConstants.*;
|
||||
import static cz.trask.adfs.AdfsAuthConstants.*;
|
||||
|
||||
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.dto.TokenPayloadIdp;
|
||||
import static cz.trask.adfs.AdfsAuthMsConstants.*;
|
||||
import static cz.trask.adfs.AdfsAuthConstants.*;
|
||||
|
||||
public class AdfsTokenService {
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user