All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.quorum.tessera.api.exception.SecurityExceptionMapper Maven / Gradle / Ivy

package com.quorum.tessera.api.exception;

import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class SecurityExceptionMapper implements ExceptionMapper {

  private static final Logger LOGGER = LoggerFactory.getLogger(SecurityExceptionMapper.class);

  @Override
  public Response toResponse(final SecurityException exception) {
    LOGGER.error("Security exception", exception);

    // Return 500 assume access attempt is malicious
    return Response.serverError().build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy