Skip to content

Commit

Permalink
Confluent Packaging (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
rufusfnash authored and pegerto committed Jan 28, 2019
1 parent 17cb420 commit 997ae17
Show file tree
Hide file tree
Showing 9 changed files with 216 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.idea/
venafi-tpp-log-connector.iml
*.iml
target/
dependency-reduced-pom.xml
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,20 @@ This connector connects via HTTP to your instance of the Venafi Trust Protection
# Development
To manually install the connector:
1. Build the JAR with `mvn package`
2. Find the JAR in your target folder called venafi-tpp-log-connector-<version you're building>.jar
2. Find the JAR in your target folder called venafi-tpp-log-connector-<version you're building>-fat.jar
3. Create a connect property file
```
name=venafi
connector.class=com.opencredo.connect.venafi.tpp.log.TppLogSourceConnector
tasks.max=1
type.name=kafka-connect
venafi.base.url=<your_base_url>
venafi.username=<your_api_username>
venafi.password=<your_api_password>
```
This is filled with the minimum values required, any default values are provided by the [config definition class](./src/main/java/com/opencredo/connect/venafi/tpp/log/TppLogSourceConfig.java).
This can also be looked at for more information on configuration, or look at the [wiki on the config definitions.](https://github.com/opencredo/kafka-connect-venafi-tpp/wiki/Config-Definitions-explained.)
Make sure to replace the items with the <> brackets with what's needed to connect to your Venafi TPP/VEDSDK instance.
4. Create a directory and place the JAR file in it, e.g. `<path-to-confluent>/share/java/kafka-connect-venafi`.
4. Create a directory and place the JAR file in it, e.g. `<path-to-confluent>/share/java/kafka-connect-venafi-tpp`.
5. Then call: `<path-to-confluent>/bin/confluent load venafi -d venafi.properties`

For more information please look at the [Confluent instructions on manually installing connectors](https://docs.confluent.io/current/connect/managing/install.html#connect-install-connectors).
Expand Down
24 changes: 24 additions & 0 deletions config/source-quickstart.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# The first few settings are required for all connectors: a name, the connector class to run, and the maximum number of tasks to create:
name=venafi
connector.class=com.opencredo.connect.venafi.tpp.log.TppLogSourceConnector
tasks.max=1
# The remaining configs are specific to the Venafi source connector. In this example, we connect to
# the TPP API on localhost using username "admin" and password "admin". These values should be changed for
# your specific instance.
venafi.base.url=https://localhost:443/VEDSDK
venafi.username=admin
venafi.password=admin

# Topic to publish TPP log data to.
# The default is "TPP-LOGS".
# Valid Values: non-empty string and no ISO control characters
#venafi.topic=TPP-LOGS

# Window of data to pull from log api.
# Valid Values: [2,...,10000]
# The default is 100.
#venafi.batch.size=100

# Poll interval in milliseconds. E.G. Roughly, how often the connector will connect to the TPP API.
# The default is 1000 as in once a second.
#venafi.poll.interval=1000
Binary file added logos/opencredo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added logos/venafi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
106 changes: 103 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.opencredo</groupId>
<artifactId>venafi-tpp-log-connector</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>venafi-tpp-log-connector</name>
<artifactId>kafka-connect-venafi-tpp</artifactId>
<version>0.9.1-SNAPSHOT</version>
<name>kafka-connect-venafi-tpp</name>
<description>Kafka connector for Venafi Trust Protection Platform Security Events</description>

<properties>
Expand All @@ -15,6 +15,11 @@
<feign.version>10.1.0</feign.version>
<kafka-connect.version>2.0.1</kafka-connect.version>
<mockito.version>2.23.4</mockito.version>
<kafka.connect.maven.plugin.version>0.11.1</kafka.connect.maven.plugin.version>
<connect.component.owner.username>OpenCredo Ltd.</connect.component.owner.username>
<connect.component.componentTypes>source</connect.component.componentTypes>
<project.package.home>target/${project.artifactId}-${project.version}-package</project.package.home>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
Expand Down Expand Up @@ -116,6 +121,25 @@
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.0.0</version>
<configuration>
<descriptors>
<descriptor>src/assembly/development.xml</descriptor>
<descriptor>src/assembly/package.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand All @@ -127,6 +151,7 @@
<goal>shade</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-fat</finalName>
<artifactSet>
<excludes>
<exclude>classworlds:classworlds</exclude>
Expand All @@ -141,14 +166,89 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.confluent</groupId>
<artifactId>kafka-connect-maven-plugin</artifactId>
<version>0.11.1</version>
<executions>
<execution>
<goals>
<goal>kafka-connect</goal>
</goals>
<configuration>
<title>Kafka Connect Venafi TPP</title>
<documentationUrl>
https://github.com/opencredo/kafka-connect-venafi-tpp/blob/master/README.md
</documentationUrl>
<description>
This connector connects via HTTP to your instance of the Venafi Trust Protection
Platform ( which shall be referred to as TPP from here on) and pulls your Log events
into Kafka, allowing you to do any filtering/transforming/processing you'd like to do
within a comfortable Kafka environment.

N.B. Currently the connector starts from the beginning of time (i.e. processes all past
events first), a future release will allow the option of starting from now (i.e.
skipping all previous events).
</description>
<logo>logos/venafi.png</logo>

<supportProviderName>${connect.component.owner.username}</supportProviderName>
<supportSummary>OpenCredo supports the Venafi source connector on behalf of Venafi.
</supportSummary>
<supportUrl>https://github.com/opencredo/kafka-connect-venafi-tpp</supportUrl>
<supportLogo>logos/opencredo.png</supportLogo>

<ownerUsername>opencredo</ownerUsername>
<ownerType>organization</ownerType>
<ownerName>${connect.component.owner.username}</ownerName>
<ownerUrl>https://opencredo.com/</ownerUrl>
<ownerLogo>logos/opencredo.png</ownerLogo>

<componentTypes>
<componentType>source</componentType>
</componentTypes>

<tags>
<tag>venafi</tag>
<tag>tpp</tag>
</tags>

<!--<confluentControlCenterIntegration>true</confluentControlCenterIntegration>-->
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>standalone</id>
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptors>
<descriptor>src/assembly/standalone.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
</repository>
<repository>
<id>sonatype-repository</id>
<name>Sonatype Repository</name>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
</repository>
</repositories>

</project>
17 changes: 17 additions & 0 deletions src/assembly/development.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<!-- Assembles all dependencies in target/ directory so scripts can easily run in a development
environment -->
<id>development</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<dependencySets>
<dependencySet>
<outputDirectory>share/java/kafka-connect-venafi-tpp/</outputDirectory>
</dependencySet>
</dependencySets>
</assembly>
39 changes: 39 additions & 0 deletions src/assembly/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<!-- Assembles a packaged version targeting OS installation. -->
<id>package</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>share/doc/kafka-connect-venafi-tpp/</outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/config</directory>
<outputDirectory>etc/kafka-connect-venafi-tpp</outputDirectory>
<includes>
<include>*</include>
</includes>
</fileSet>
</fileSets>

<dependencySets>
<dependencySet>
<outputDirectory>share/java/kafka-connect-venafi-tpp</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<useTransitiveFiltering>true</useTransitiveFiltering>
<excludes>
<exclude>org.apache.kafka:connect-api</exclude>
</excludes>
</dependencySet>
</dependencySets>
</assembly>
30 changes: 30 additions & 0 deletions src/assembly/standalone.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2
http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<!-- Assembles a packaged jar that includes all dependencies. This still requires the Connect
runtime, but allows running kafka connect with a connector plugin using only a couple of jars. -->
<id>standalone</id>
<formats>
<format>jar</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>README*</include>
<include>LICENSE*</include>
</includes>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<unpack>true</unpack>
<scope>runtime</scope>
</dependencySet>
</dependencySets>
</assembly>

0 comments on commit 997ae17

Please sign in to comment.