Interface GuardrailsConfigProvider

All Known Implementing Classes:
GuardrailsConfigProvider.Default

public interface GuardrailsConfigProvider
Provider of GuardrailsConfigs for a ClientState.

The GuardrailsConfigProvider.Default implementation always retuns the GuardrailsConfig parsed from cassandra.yaml, but different implementations can return different configurations based on the specified ClientState.

Custom implementations can be specified at runtime with the system property CUSTOM_IMPLEMENTATION_PROPERTY. These configurations can be used to read the guardrails configuration from some other source, and provide different configurations depending on the ClientState or some other factors. However, this mechanism for pluggability and the related GuardrailsConfig interface are not officially supported and may change in a minor release.

  • Field Details

    • CUSTOM_IMPLEMENTATION_PROPERTY

      @Deprecated(since="5.0") static final String CUSTOM_IMPLEMENTATION_PROPERTY
      Deprecated.
      CUSTOM_GUARDRAILS_CONFIG_PROVIDER_CLASS.getKey() must be used instead. See CASSANDRA-17797
    • instance

      static final GuardrailsConfigProvider instance
  • Method Details

    • getOrCreate

      GuardrailsConfig getOrCreate(@Nullable ClientState state)
      Returns the GuardrailsConfig to be used for the specified ClientState.
      Parameters:
      state - a client state, maybe null if the guardrails check for which we are getting the config is for a background process that is not associated to a user query.
      Returns:
      the configuration to be used for state
    • build

      static GuardrailsConfigProvider build(String customImpl)
      Creates an instance of the custom guardrails config provider of the given class.
      Parameters:
      customImpl - the fully qualified classname of the guardrails config provider to be instantiated
      Returns:
      a new instance of the specified custom guardrails config provider of the given class.