static RedisCompositeKey parse(final String key) {
        val patternBits = Splitter.on(':').splitToList(key);
        if (patternBits.size() == 2) {
            Assert.isTrue(patternBits.getFirst().equals(REDIS_NAMESPACE_PRINCIPALS), "Unknown principal key pattern %s".formatted(key));
            return RedisCompositeKey.builder()
                .namespace(patternBits.getFirst())
                .id(patternBits.getLast())
                .build();
        }
        if (patternBits.size() == 3) {
            Assert.isTrue(patternBits.getFirst().equals(REDIS_NAMESPACE_TICKETS), "Unknown ticket key pattern %s".formatted(key));
            return RedisCompositeKey.builder()
                .namespace(patternBits.getFirst())
                .prefix(patternBits.get(1))
                .id(patternBits.getLast())
                .build();
        }
        throw new IllegalArgumentException("Unable to parse pattern " + key);
    }
Parse key into redis composite key.

@param key the redis key pattern
@return the redis composite key
support/cas-server-support-redis-ticket-registry/src/main/java/org/apereo/cas/ticket/registry/key/RedisKeyGenerator.java