class SignatureFilter extends JsonSecurityRequestFilterBase {

    @Override
    protected Optional<ErrorResponse> filter(DiscFilterRequest request) {
        if (   request.getAttribute(SecurityContext.ATTRIBUTE_NAME) == null
            && request.getHeader("X-Authorization") != null)
            try {
                getSecurityContext(request).ifPresent(securityContext -> {
                    request.setUserPrincipal(securityContext.principal());
                    request.setRemoteUser(securityContext.principal().getName());
                    request.setAttribute(SecurityContext.ATTRIBUTE_NAME, securityContext);
                });
            }
            catch (Exception e) {
                logger.log(Level.FINE, () -> "Exception verifying signed request: " + Exceptions.toMessageString(e));
            }
        return Optional.empty();
    }

    @Inject public  SignatureFilter(Controller controller);

}