private static boolean isRoleCertificatePresent(DiscFilterRequest request) {
        return getClientCertificate(request)
                .filter(cert -> {
                    try {
                        AthenzX509CertificateUtils.getRolesFromRoleCertificate(cert);
                        return true;
                    } catch (Exception e) {
                        log.log(Level.FINE, e, () -> "Not a role certificate: " + e.getMessage());
                        return false;
                    }
                })
                .isPresent();
    }
An Athenz security filter that uses a configured action and resource name to control access.

@author bjorncs
jdisc-security-filters/src/main/java/com/yahoo/jdisc/http/filter/security/athenz/AthenzAuthorizationFilter.java