Class AvroTrustedClassBuildItem

java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.MultiBuildItem
io.quarkus.avro.spi.AvroTrustedClassBuildItem

public final class AvroTrustedClassBuildItem extends io.quarkus.builder.item.MultiBuildItem
Marks classes as trusted for Avro deserialization.

Since Avro 1.12.2, classes are validated against a global security validator before they are deserialized; untrusted classes cause a java.lang.SecurityException. Extensions that generate or handle classes which are deserialized through Avro (for example Avro-generated records, or Protobuf-generated messages used with Pulsar) should produce this build item so those classes pass Avro's security validation.

The quarkus-avro extension collects all instances of this build item and configures the Avro validator accordingly. Producing it has no effect if the quarkus-avro extension is not present.

  • Constructor Details

    • AvroTrustedClassBuildItem

      public AvroTrustedClassBuildItem(String className)
      Parameters:
      className - the fully qualified name of a class to trust
    • AvroTrustedClassBuildItem

      public AvroTrustedClassBuildItem(Collection<String> classNames)
      Parameters:
      classNames - the fully qualified names of the classes to trust
  • Method Details

    • getClassNames

      public Set<String> getClassNames()