Skip to content
This repository was archived by the owner on Jan 20, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.networknt.oauth.security.LightGSSAPIAuthenticationMechanism;
import com.networknt.oauth.security.LightIdentityManager;

import com.networknt.server.ServerConfig;
import io.undertow.Handlers;
import io.undertow.security.api.AuthenticationMechanism;
import io.undertow.security.api.AuthenticationMode;
Expand All @@ -45,17 +46,16 @@
public class PathHandlerProvider implements HandlerProvider {
private static final String SPNEGO_SERVICE_PASSWORD = "spnegoServicePassword";
private static final String SECRET_CONFIG = "secret";
private static final String SERVER_CONFIG = "server";
private static final Map<String, Object> secret = Config.getInstance().getJsonMapConfig(SECRET_CONFIG);
private static final Map<String, Object> server = Config.getInstance().getJsonMapConfigNoCache(SERVER_CONFIG);
private static final ServerConfig serverConfig = ServerConfig.getInstance();
private static final String spnegoServicePassword = (String)secret.get(SPNEGO_SERVICE_PASSWORD);

@Override
public HttpHandler getHandler() {
final IdentityManager basicIdentityManager = new LightIdentityManager();

HttpHandler handler = Handlers.routing()
.add(Methods.GET, "/health/"+server.get("serviceId"), new HealthGetHandler())
.add(Methods.GET, "/health/" + serverConfig.getServiceId(), new HealthGetHandler())
.add(Methods.GET, "/server/info", new ServerInfoGetHandler())
.add(Methods.GET, "/oauth2/code", addGetSecurity(new Oauth2CodeGetHandler(), basicIdentityManager))
.add(Methods.POST, "/oauth2/code", addFormSecurity(new Oauth2CodePostHandler(), basicIdentityManager))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.networknt.oauth.security.LightFormAuthenticationMechanism;
import com.networknt.oauth.security.LightGSSAPIAuthenticationMechanism;
import com.networknt.oauth.security.LightIdentityManager;
import com.networknt.server.ServerConfig;
import io.undertow.security.api.AuthenticationMechanism;
import io.undertow.security.api.AuthenticationMode;
import io.undertow.security.api.GSSAPIServerSubjectFactory;
Expand All @@ -31,9 +32,7 @@ public class BaseWrapper {

private static final String SPNEGO_SERVICE_PASSWORD = "spnegoServicePassword";
private static final String SECRET_CONFIG = "secret";
private static final String SERVER_CONFIG = "server";
private static final Map<String, Object> secret = Config.getInstance().getJsonMapConfig(SECRET_CONFIG);
private static final Map<String, Object> server = Config.getInstance().getJsonMapConfigNoCache(SERVER_CONFIG);
private static final String spnegoServicePassword = (String)secret.get(SPNEGO_SERVICE_PASSWORD);

final IdentityManager basicIdentityManager = new LightIdentityManager();
Expand Down