Beispiel #1
0
  @RequestMapping(value = "/health", method = RequestMethod.GET)
  public Map<String, String> getHealth(HttpServletRequest request) throws FlockException {
    Object o = request.getAttribute(ApiKeyInterceptor.API_KEY);
    if (o == null) o = request.getHeader(ApiKeyInterceptor.API_KEY);
    String apiKey = "";
    if (o != null) apiKey = o.toString();

    if ("".equals(apiKey)) apiKey = null;
    if (request.getAttribute(ApiKeyInterceptor.COMPANY) == null && apiKey == null)
      return engineConfig.getHealthAuth(); // Caller may have admin role but not belong to a company
    return engineConfig.getHealth();
  }
Beispiel #2
0
 @RequestMapping(value = "/ping", method = RequestMethod.GET)
 public String getPing() {
   // curl -X GET http://localhost:8081/api/v1/track/ping
   return engineConfig.authPing();
 }