|
19 | 19 | import com.networknt.oauth.security.LightGSSAPIAuthenticationMechanism;
|
20 | 20 | import com.networknt.oauth.security.LightIdentityManager;
|
21 | 21 |
|
| 22 | +import com.networknt.server.ServerConfig; |
22 | 23 | import io.undertow.Handlers;
|
23 | 24 | import io.undertow.security.api.AuthenticationMechanism;
|
24 | 25 | import io.undertow.security.api.AuthenticationMode;
|
|
45 | 46 | public class PathHandlerProvider implements HandlerProvider {
|
46 | 47 | private static final String SPNEGO_SERVICE_PASSWORD = "spnegoServicePassword";
|
47 | 48 | private static final String SECRET_CONFIG = "secret";
|
48 |
| - private static final String SERVER_CONFIG = "server"; |
49 | 49 | private static final Map<String, Object> secret = Config.getInstance().getJsonMapConfig(SECRET_CONFIG);
|
50 |
| - private static final Map<String, Object> server = Config.getInstance().getJsonMapConfigNoCache(SERVER_CONFIG); |
| 50 | + private static final ServerConfig serverConfig = ServerConfig.getInstance(); |
51 | 51 | private static final String spnegoServicePassword = (String)secret.get(SPNEGO_SERVICE_PASSWORD);
|
52 | 52 |
|
53 | 53 | @Override
|
54 | 54 | public HttpHandler getHandler() {
|
55 | 55 | final IdentityManager basicIdentityManager = new LightIdentityManager();
|
56 | 56 |
|
57 | 57 | HttpHandler handler = Handlers.routing()
|
58 |
| - .add(Methods.GET, "/health/"+server.get("serviceId"), new HealthGetHandler()) |
| 58 | + .add(Methods.GET, "/health/" + serverConfig.getServiceId(), new HealthGetHandler()) |
59 | 59 | .add(Methods.GET, "/server/info", new ServerInfoGetHandler())
|
60 | 60 | .add(Methods.GET, "/oauth2/code", addGetSecurity(new Oauth2CodeGetHandler(), basicIdentityManager))
|
61 | 61 | .add(Methods.POST, "/oauth2/code", addFormSecurity(new Oauth2CodePostHandler(), basicIdentityManager))
|
|
0 commit comments