Skip to content

Commit

Permalink
Replace insecure native query endpoint with read-only language endpoi…
Browse files Browse the repository at this point in the history
…nt (#2)
  • Loading branch information
QubitPi authored Sep 28, 2024
1 parent c01bf20 commit 507ce46
Show file tree
Hide file tree
Showing 17 changed files with 193 additions and 216 deletions.
47 changes: 0 additions & 47 deletions Dockerfile

This file was deleted.

20 changes: 0 additions & 20 deletions Dockerfile-startup.sh

This file was deleted.

81 changes: 34 additions & 47 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
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.qubitpi</groupId>
<artifactId>jersey-webservice-template</artifactId>
<groupId>org.qubitpi.wilhelm</groupId>
<artifactId>wilhelm-ws</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>Jersey Webservice Template</name>
<description>Template project for building Jersey webservice running in Jetty</description>
<url>https://github.com/QubitPi/jersey-webservice-template</url>
<name>Wilhelm Webservice</name>
<description>Serving data from graph database for wilhelmlang.com</description>
<url>https://github.com/QubitPi/wilhelm-ws</url>

<developers>
<developer>
Expand All @@ -29,34 +29,13 @@
</licenses>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<version.validation.api>3.0.1</version.validation.api>
<version.jcip.annotations>1.0</version.jcip.annotations>
<version.slf4j>1.7.25</version.slf4j>
<version.logback>1.2.3</version.logback>
<version.jackson>2.13.3</version.jackson>
<version.owner>1.0.12</version.owner>
<version.servlet>6.0.0</version.servlet>
<version.jersey>3.1.1</version.jersey>
<version.groovy>4.0.6</version.groovy>
<version.jetty>11.0.15</version.jetty>

<version.maven.war.plugin>3.2.2</version.maven.war.plugin>
<version.maven.javadoc.plugin>3.5.0</version.maven.javadoc.plugin>
<version.maven.jar.plugin>3.1.1</version.maven.jar.plugin>
<version.maven.surefire.plugin>3.0.0-M5</version.maven.surefire.plugin>
<version.maven.compiler.plugin>3.7.0</version.maven.compiler.plugin>
<version.maven.failsafe.plugin>3.0.0-M4</version.maven.failsafe.plugin>
<version.maven.checkstyle.plugin>3.1.2</version.maven.checkstyle.plugin>
<version.maven.surefire.report.plugin>${version.maven.surefire.plugin}</version.maven.surefire.report.plugin>

<checkstyle.skip>false</checkstyle.skip>
<checkstyle.config.location>checkstyle.xml</checkstyle.config.location>
<checkstyle.suppressions.location>checkstyle-suppressions.xml</checkstyle.suppressions.location>
<checkstyle.version>8.30</checkstyle.version>
<checkstyle.resourceIncludes>**/*.properties*</checkstyle.resourceIncludes>
</properties>

Expand All @@ -66,7 +45,7 @@
<dependency>
<groupId>com.fasterxml.jackson</groupId>
<artifactId>jackson-bom</artifactId>
<version>${version.jackson}</version>
<version>2.13.3</version>
<scope>import</scope>
<type>pom</type>
</dependency>
Expand All @@ -82,7 +61,7 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-bom</artifactId>
<version>${version.jetty}</version>
<version>11.0.15</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -105,14 +84,14 @@
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>${version.validation.api}</version>
<version>3.0.1</version>
</dependency>

<!-- Servlet API -->
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${version.servlet}</version>
<version>6.0.0</version>
</dependency>
<dependency>
<groupId>jakarta.ws.rs</groupId>
Expand Down Expand Up @@ -182,26 +161,26 @@
<dependency>
<groupId>net.jcip</groupId>
<artifactId>jcip-annotations</artifactId>
<version>${version.jcip.annotations}</version>
<version>1.0</version>
</dependency>

<!-- Configurations -->
<dependency>
<groupId>org.aeonbits.owner</groupId>
<artifactId>owner</artifactId>
<version>${version.owner}</version>
<version>1.0.12</version>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${version.slf4j}</version>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${version.logback}</version>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
Expand All @@ -223,7 +202,7 @@
<dependency>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${version.groovy}</version>
<version>4.0.6</version>
<scope>test</scope>
</dependency>
<dependency> <!-- Enable mocking of non-interface types -->
Expand Down Expand Up @@ -268,6 +247,13 @@
</exclusion>
</exclusions>
</dependency>

<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>spock</artifactId>
<version>1.20.1</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand All @@ -282,7 +268,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${version.maven.compiler.plugin}</version>
<version>3.7.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
Expand All @@ -294,19 +280,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${version.maven.checkstyle.plugin}</version>
<version>3.1.2</version>
<dependencies>
<!-- override default checkstyle version -->
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>${checkstyle.version}</version>
<version>8.30</version>
</dependency>
</dependencies>
<configuration>
<suppressionsLocation>${checkstyle.suppressions.location}</suppressionsLocation>
<suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
<suppressionsFileExpression>checkstyle.suppressions.file</suppressionsFileExpression>
<configLocation>${checkstyle.config.location}</configLocation>
<configLocation>checkstyle.xml</configLocation>
<configLocation>checkstyle.xml</configLocation>
<includes>**\/*.java,**\/*.groovy</includes>
<resourceIncludes>**/*.properties,**/*.sample</resourceIncludes>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
Expand All @@ -326,7 +313,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${version.maven.javadoc.plugin}</version>
<version>3.5.0</version>
<configuration>
<doclint>none</doclint> <!-- Turnoff all checks -->
</configuration>
Expand Down Expand Up @@ -360,7 +347,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${version.maven.surefire.plugin}</version>
<version>3.0.0-M5</version>
<configuration>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
Expand All @@ -376,14 +363,14 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${version.maven.surefire.report.plugin}</version>
<version>3.0.0-M5</version>
</plugin>

<!-- Integration Test -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${version.maven.failsafe.plugin}</version>
<version>3.0.0-M4</version>
<executions>
<execution>
<goals>
Expand All @@ -402,7 +389,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>${version.maven.war.plugin}</version>
<version>3.2.2</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
Expand All @@ -411,7 +398,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${version.maven.jar.plugin}</version>
<version>3.1.1</version>
</plugin>
</plugins>
</build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.qubitpi.ws.jersey.template.application;
package org.qubitpi.wilhelm.application;

import org.glassfish.hk2.utilities.Binder;
import org.glassfish.hk2.utilities.binding.AbstractBinder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.qubitpi.ws.jersey.template.application;
package org.qubitpi.wilhelm.application;

import com.qubitpi.ws.jersey.template.web.filters.CorsFilter;
import org.qubitpi.wilhelm.web.filters.CorsFilter;

import org.glassfish.hk2.utilities.Binder;

Expand All @@ -32,7 +32,7 @@
@ApplicationPath("v1")
public class ResourceConfig extends org.glassfish.jersey.server.ResourceConfig {

private static final String ENDPOINT_PACKAGE = "com.qubitpi.ws.jersey.template.web.endpoints";
private static final String ENDPOINT_PACKAGE = "org.qubitpi.wilhelm.web.endpoints";

/**
* DI Constructor that allows for finer dependency injection control.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.qubitpi.ws.jersey.template.config;
package org.qubitpi.wilhelm.config;

import org.aeonbits.owner.Config;

Expand Down
Loading

0 comments on commit 507ce46

Please sign in to comment.