Skip to content

Instantly share code, notes, and snippets.

View arleighdickerson's full-sized avatar
👉
Let all naysayers know

Arleigh Dickerson arleighdickerson

👉
Let all naysayers know
View GitHub Profile
import lombok.val;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import io.arleigh.gantry.activeclient.ActiveClientService;
import io.arleigh.gantry.clientsession.ClientSessionService;
import io.arleigh.gantry.util.SecurityUtils;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.springframework.context.event.EventListener;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.messaging.simp.user.SimpUser;
import org.springframework.messaging.simp.user.SimpUserRegistry;
module.exports = function (Driver) {
return class extends Driver {
constructor(url) {
super(url, [
// 'v10.stomp',
// 'v11.stomp',
'v12.stomp',
]);
this.binaryType = 'arraybuffer';
}
// noinspection RegExpSingleCharAlternation,RegExpUnnecessaryNonCapturingGroup
const isoEightSixZeroOne = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*))(?:Z|(\+|-)([\d|:]*))?$/;
export namespace jsonUtil {
export function isJsonPatch(obj: any): obj is unknown {
return false;
}
export function jsonReviver(key: string, value: any) {
import io.arleigh.gantry.util.SecurityUtils;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.slf4j.MDC;
import org.springframework.boot.actuate.audit.listener.AuditApplicationEvent;
import org.springframework.context.event.EventListener;
import org.springframework.security.access.event.AbstractAuthorizationEvent;
import org.springframework.security.access.event.AuthorizationFailureEvent;
import org.springframework.stereotype.Component;
import org.springframework.util.ReflectionUtils;
import io.arleigh.gantry.util.UuidGenerator;
import lombok.RequiredArgsConstructor;
import org.slf4j.MDC;
import org.springframework.context.annotation.Profile;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;
import org.springframework.web.filter.OncePerRequestFilter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import org.springframework.lang.Nullable;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.time.Duration;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Random;
import java.util.UUID;
import lombok.NonNull;
import lombok.SneakyThrows;
import org.apache.commons.codec.binary.Base32;
import org.springframework.lang.Nullable;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.util.Arrays;
import java.util.Locale;
import java.util.regex.Pattern;
import io.arleigh.gantry.cache.PrefixedKeyGenerator;
import io.arleigh.gantry.properties.AppRedisProperties;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.val;
import org.redisson.api.RedissonClient;
import org.redisson.jcache.configuration.RedissonConfiguration;
import org.redisson.spring.cache.RedissonSpringCacheManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.cache.JCacheManagerCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.data.redis.core.RedisKeyValueAdapter;
import org.springframework.data.redis.repository.configuration.EnableRedisRepositories;
import org.springframework.session.data.redis.config.ConfigureRedisAction;
// https://dzone.com/articles/build-a-chat-application-using-spring-boot-websock
// https://engineering.salesforce.com/lessons-learned-using-spring-data-redis-f3121f89bff9
// https://help.heroku.com/5BP0E8RC/how-to-enable-notify-keyspace-events-on-redis