Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-17772

Improve documentation around query methods in CQLTester and GuardrailTester

    XMLWordPrintableJSON

Details

    Description

      Anything that relies on CQLTester.executeFormattedQuery (the assertInvalidThrowMessage methods for instance) will use internal client state rather than the client state specified for the query, thus nullifying any guardrail or systems keyspace permission checks as the ClientState.isInternal flag overrides all such permission checking. Reference: link
       
      See chain of CQLTester -> ClientState.isInternal here if interested:
      CQLTester
      QueryProcessor
       
      This is pretty easy to stumble across when testing guardrails as GuardrailTester adds a variety of assertFails and assertThrows signatures that do respect the client state and thus apply guardrails (example)
       
      We should add documentation to the method calls in CQLTester and GuardrailTester to reflect this discrepancy as it can easily trip someone up writing tests for guardrails.

      Attachments

        Activity

          People

            jmckenzie Josh McKenzie
            jmckenzie Josh McKenzie
            Josh McKenzie
            Andres de la Peña
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: