Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIFI-7187 #4086

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nifi-commons/nifi-flowfile-packager/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.19</version>
<version>1.20</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
2 changes: 1 addition & 1 deletion nifi-commons/nifi-metrics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<dependency>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-jvm</artifactId>
<version>4.1.0</version>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>org.spockframework</groupId>
Expand Down
2 changes: 1 addition & 1 deletion nifi-commons/nifi-record-path/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.6.2</version>
<version>2.8.1</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've run into issues with caffeine API compatibility a while ago ( long enough that my prior experience may be totally invalid today ). Do you feel confident these won't cause any issues? I have some flows where I can try these changes out with my record paths ( most seem like they are already covered by unit tests ) -- so if you can resolve conflicts i'd be happy to take some cycles to try this out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no i have no confidence beyond what our tests offer

</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion nifi-commons/nifi-rocksdb-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>org.rocksdb</groupId>
<artifactId>rocksdbjni</artifactId>
<version>6.2.2</version>
<version>6.6.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
2 changes: 1 addition & 1 deletion nifi-commons/nifi-schema-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<version>3.9</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
4 changes: 2 additions & 2 deletions nifi-commons/nifi-security-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<version>3.9</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
Expand Down Expand Up @@ -87,7 +87,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-configuration2</artifactId>
<version>2.4</version>
<version>2.6</version>
</dependency>
</dependencies>

Expand Down
2 changes: 1 addition & 1 deletion nifi-commons/nifi-socket-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<version>3.9</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Expand Down
2 changes: 2 additions & 0 deletions nifi-nar-bundles/nifi-accumulo-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-accumulo-processors</artifactId>
<version>1.12.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
<artifactId>nifi-services</artifactId>
<version>1.12.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ language governing permissions and limitations under the License. -->
<packaging>jar</packaging>

<properties>
<amqp-client.version>5.6.0</amqp-client.version>
<amqp-client.version>5.8.0</amqp-client.version>
</properties>

<dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<dependency>
<groupId>org.coursera</groupId>
<artifactId>metrics-datadog</artifactId>
<version>1.1.5</version>
<version>1.1.14</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@
<dependency>
<groupId>org.jeasy</groupId>
<artifactId>easy-rules-core</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.jeasy</groupId>
<artifactId>easy-rules-mvel</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -57,7 +57,7 @@
<dependency>
<groupId>org.jeasy</groupId>
<artifactId>easy-rules-spel</artifactId>
<version>3.3.0</version>
<version>3.4.0</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<dependency>
<groupId>com.icegreen</groupId>
<artifactId>greenmail</artifactId>
<version>1.5.9</version>
<version>1.5.11</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
Expand Down Expand Up @@ -74,13 +74,13 @@
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>2.0.2</version>
<version>2.0.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>2.0.2</version>
<version>2.0.5</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -103,7 +103,7 @@
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<version>2.0.2</version>
<version>2.0.5</version>
<scope>test</scope>
<exclusions>
<!-- bytebuddy excluded due to the transitive dependency version (1.9.3) not being able to mock
Expand All @@ -122,13 +122,13 @@
<!-- included explicitly for use with mockito-core and powermock-core -->
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.9.10</version>
<version>1.10.8</version>
</dependency>
<dependency>
<!-- included explicitly for use with mockito-core and powermock-core -->
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
<version>1.9.10</version>
<version>1.10.8</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.6.2</version>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>2.6.2</version>
<version>2.8.1</version>
</dependency>
<!-- Other modules using nifi-avro-record-utils are expected to have these APIs available, typically through a NAR dependency -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-csv</artifactId>
<version>1.6</version>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.6</version>
<version>1.8</version>
</dependency>
<dependency>
<groupId>org.apache.nifi</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.8.1</version>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>1.0.1</version>
<version>2.8.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.6</version>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.github.stefanbirkner</groupId>
<artifactId>system-rules</artifactId>
<version>1.18.0</version>
<version>1.19.0</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
public class HTTPHeaderFiltersTest {

@Test
public void testCSPHeaderApplied() throws ServletException, IOException {
public void testCSPHeaderApplied() throws ServletException, IOException, Exception {
// Arrange

FilterHolder originFilter = new FilterHolder(new ContentSecurityPolicyFilter());
Expand All @@ -43,14 +43,16 @@ public void testCSPHeaderApplied() throws ServletException, IOException {
FilterChain mockFilterChain = Mockito.mock(FilterChain.class);

// Action
originFilter.start();
originFilter.initialize();
originFilter.getFilter().doFilter(mockRequest, mockResponse, mockFilterChain);

// Verify
assertEquals("frame-ancestors 'self'", mockResponse.getHeader("Content-Security-Policy"));
}

@Test
public void testCSPHeaderAppliedOnlyOnce() throws ServletException, IOException {
public void testCSPHeaderAppliedOnlyOnce() throws ServletException, IOException, Exception {
// Arrange

FilterHolder originFilter = new FilterHolder(new ContentSecurityPolicyFilter());
Expand All @@ -61,6 +63,8 @@ public void testCSPHeaderAppliedOnlyOnce() throws ServletException, IOException
FilterChain mockFilterChain = Mockito.mock(FilterChain.class);

// Action
originFilter.start();
originFilter.initialize();
originFilter.getFilter().doFilter(mockRequest, mockResponse, mockFilterChain);
originFilter.getFilter().doFilter(mockRequest, mockResponse, mockFilterChain);

Expand All @@ -70,7 +74,7 @@ public void testCSPHeaderAppliedOnlyOnce() throws ServletException, IOException


@Test
public void testXFrameOptionsHeaderApplied() throws ServletException, IOException {
public void testXFrameOptionsHeaderApplied() throws ServletException, IOException, Exception {
// Arrange

FilterHolder xfoFilter = new FilterHolder(new XFrameOptionsFilter());
Expand All @@ -81,14 +85,16 @@ public void testXFrameOptionsHeaderApplied() throws ServletException, IOExceptio
FilterChain mockFilterChain = Mockito.mock(FilterChain.class);

// Action
xfoFilter.start();
xfoFilter.initialize();
xfoFilter.getFilter().doFilter(mockRequest, mockResponse, mockFilterChain);

// Verify
assertEquals("SAMEORIGIN", mockResponse.getHeader("X-Frame-Options"));
}

@Test
public void testHSTSHeaderApplied() throws ServletException, IOException {
public void testHSTSHeaderApplied() throws ServletException, IOException, Exception {
// Arrange

FilterHolder hstsFilter = new FilterHolder(new StrictTransportSecurityFilter());
Expand All @@ -99,14 +105,16 @@ public void testHSTSHeaderApplied() throws ServletException, IOException {
FilterChain mockFilterChain = Mockito.mock(FilterChain.class);

// Action
hstsFilter.start();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is needed due to API changes? seems relatively innocuous.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep is necessary due to some change in that class in jetty

hstsFilter.initialize();
hstsFilter.getFilter().doFilter(mockRequest, mockResponse, mockFilterChain);

// Verify
assertEquals("max-age=31540000", mockResponse.getHeader("Strict-Transport-Security"));
}

@Test
public void testXSSProtectionHeaderApplied() throws ServletException, IOException {
public void testXSSProtectionHeaderApplied() throws ServletException, IOException, Exception {
// Arrange

FilterHolder xssFilter = new FilterHolder(new XSSProtectionFilter());
Expand All @@ -117,6 +125,8 @@ public void testXSSProtectionHeaderApplied() throws ServletException, IOExceptio
FilterChain mockFilterChain = Mockito.mock(FilterChain.class);

// Action
xssFilter.start();
xssFilter.initialize();
xssFilter.getFilter().doFilter(mockRequest, mockResponse, mockFilterChain);

// Verify
Expand Down
Loading