Skip to content

Commit

Permalink
fix: Add default constructors to processors and controller services (#36
Browse files Browse the repository at this point in the history
)

This commit adds default constructors to several processors and
controller services to ensure they're properly initialized.

It also introduces build-source encoding in the POM files and adds the
maven-gpg-plugin version.
  • Loading branch information
pflynn-virtru authored Oct 23, 2024
1 parent 82519e5 commit 7ac491c
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nifi-tdf-controller-services-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
<name>nifi-tdf-controller-services-api</name>
<description>TDF NiFi Controller Service API</description>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.nifi</groupId>
Expand Down
4 changes: 4 additions & 0 deletions nifi-tdf-processors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${maven.compiler.source}</source>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@
*/
public abstract class AbstractTDFProcessor extends AbstractProcessor {

/**
* Default constructor for AbstractTDFProcessor.
*/
public AbstractTDFProcessor() {
super();
}

/**
* Configuration property representing the limit on the number of FlowFiles
* that can be pulled from the FlowFile queue at a time.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ public abstract class AbstractToProcessor extends AbstractTDFProcessor{
static final String TDF_ATTRIBUTE = "tdf_attribute";
static final String TDF_ASSERTION_PREFIX = "tdf_assertion_";

/**
* Default constructor for AbstractToProcessor.
*/
public AbstractToProcessor() {
super();
}

/**
* Property descriptor for the Key Access Server (KAS) URL configuration.
*/
public static final PropertyDescriptor KAS_URL = new org.apache.nifi.components.PropertyDescriptor.Builder()
.name("KAS URL")
.expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@
@Tags({"NanoTDF", "OpenTDF", "Decrypt", "Data Centric Security"})
public class ConvertFromNanoTDF extends AbstractTDFProcessor {

/**
* Default constructor for ConvertFromNanoTDF.
*/
public ConvertFromNanoTDF() {
super();
}

/**
* Processes the provided list of flow files by decrypting their content using the NanoTDF protocol.
* If decryption succeeds, the flow file is routed to the success relationship; otherwise, it is routed to the failure relationship.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
@Tags({"ZTDF", "Zero Trust Data Format", "OpenTDF", "Decrypt", "Data Centric Security"})
public class ConvertFromZTDF extends AbstractTDFProcessor {

/**
* Default constructor for ConvertFromZTDF.
*/
public ConvertFromZTDF() {
super();
}

/**
* Processes a list of flow files by decrypting their content using the TDF (Trusted Data Format) SDK.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
})
public class ConvertToNanoTDF extends AbstractToProcessor {

/**
* Default constructor for ConvertToNanoTDF.
*/
public ConvertToNanoTDF() {
super();
}

/**
* Defines a relationship indicating that NanoTDF creation has failed
* due to the content size exceeding the maximum allowed NanoTDF size threshold.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
})
public class ConvertToZTDF extends AbstractToProcessor {

/**
* Default constructor for ConvertToZTDF.
*/
public ConvertToZTDF() {
super();
}

/**
* Property descriptor for the "Sign Assertions" feature in the ConvertToZTDF processor. This property allows specifying whether
* the assertions should be signed or not. It is not a required property and defaults to "false".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
@CapabilityDescription("Provides An implementation of the OpenTDFControllerService API for OpenTDF SDK Configuration Parameters")
public class SimpleOpenTDFControllerService extends AbstractControllerService implements OpenTDFControllerService {

/**
* Default constructor for SimpleOpenTDFControllerService.
*/
public SimpleOpenTDFControllerService() {
super();
}

/**
* The endpoint of the OpenTDF platform in GRPC compatible format, excluding the protocol prefix.
* This is a required property and supports expression language within the scope of the variable registry.
Expand Down
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@
<artifactId>maven-deploy-plugin</artifactId>
<version>3.1.3</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.3</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down

0 comments on commit 7ac491c

Please sign in to comment.