Class SolrCloudAuthTestCase


  • public class SolrCloudAuthTestCase
    extends SolrCloudTestCase
    Base test class for cloud tests wanting to track authentication metrics. The assertions provided by this base class require a *minimum* count, not exact count from metrics. Warning: Make sure that your test case does not break when beasting.
    • Field Detail

      • NOT_NULL_PREDICATE

        public static final Predicate NOT_NULL_PREDICATE
    • Constructor Detail

      • SolrCloudAuthTestCase

        public SolrCloudAuthTestCase()
    • Method Detail

      • assertPkiAuthMetricsMinimums

        protected void assertPkiAuthMetricsMinimums​(int requests,
                                                    int authenticated,
                                                    int passThrough,
                                                    int failWrongCredentials,
                                                    int failMissingCredentials,
                                                    int errors)
                                             throws InterruptedException
        Used to check metric counts for PKI auth
        Throws:
        InterruptedException
      • assertAuthMetricsMinimums

        protected void assertAuthMetricsMinimums​(int requests,
                                                 int authenticated,
                                                 int passThrough,
                                                 int failWrongCredentials,
                                                 int failMissingCredentials,
                                                 int errors)
                                          throws InterruptedException
        Used to check metric counts for the AuthPlugin in use (except PKI) TODO: many of these params have to be under specified - this should wait a bit to see the desired params and timeout
        Throws:
        InterruptedException
      • assertAuditMetricsMinimums

        protected void assertAuditMetricsMinimums​(MiniSolrCloudCluster cluster,
                                                  String className,
                                                  int count,
                                                  int errors)
                                           throws InterruptedException
        Common test method to be able to check audit metrics
        Parameters:
        className - the class name to be used for composing prefix, e.g. "SECURITY./auditlogging/SolrLogAuditLoggerPlugin"
        Throws:
        InterruptedException
      • verifySecurityStatus

        public static void verifySecurityStatus​(org.apache.http.client.HttpClient cl,
                                                String url,
                                                String objPath,
                                                Object expected,
                                                int count)
                                         throws Exception
        Throws:
        Exception
      • verifySecurityStatus

        protected void verifySecurityStatus​(org.apache.http.client.HttpClient cl,
                                            String url,
                                            String objPath,
                                            Object expected,
                                            int count,
                                            org.jose4j.jws.JsonWebSignature jws)
                                     throws Exception
        Throws:
        Exception
      • makeBasicAuthHeader

        protected static String makeBasicAuthHeader​(String user,
                                                    String pwd)
      • setAuthorizationHeader

        public static void setAuthorizationHeader​(org.apache.http.message.AbstractHttpMessage httpMsg,
                                                  String headerString)