You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by "exceptionfactory (via GitHub)" <gi...@apache.org> on 2024/01/02 03:37:10 UTC

[PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

exceptionfactory opened a new pull request, #8197:
URL: https://github.com/apache/nifi/pull/8197

   # Summary
   
   [NIFI-11703](https://issues.apache.org/jira/browse/NIFI-11703) Upgrades framework and extension components to Spring Framework 6 and Jetty 12.
   
   Spring Framework 6 and Jetty 12 incorporate new baseline versions of Jakarta EE API components, including Jakarta Servlet API 6.0, Jakarta RESTful Web Services API 3.0, and Jakarta XML Binding 4.0.
   
   The interconnected nature of these libraries required widespread changes to many REST Resource classes and model objects. The vast majority of changes are limited to package name changes from `javax` to `jakarta` as required for the latest versions of Jakarta EE API libraries.
   
   More substantive changes involve the upgrade from Jetty 10 to 12, which includes new Jetty modules and package names supporting Jakarta EE 10. Some of these changes include removing complicated or duplicative test classes that depended on older version of Jetty.
   
   Other notable changes include replacing legacy Swagger Maven Plugins with current versions based on OpenAPI Version 3, also required as part of Jakarta EE API upgrades.
   
   It is important to note that full migration to OpenAPI annotations requires an additional upgrade to newer Swagger Annotations 2. This should be targeted for a subsequent pull request, as it requires adjustments to all current REST Resource classes and methods. The current plugin configuration produces HTML documentation based on Swagger definitions, but response object details are not provided as a result of the current annotations. This will be corrected when upgrading to Swagger Annotations 2 and adjusting references.
   
   It is also important to note that initial evaluation of Spring Framework 6.1 resulted in problems with parameter resolution in AspectJ-based Auditor classes. This is not an issue in Spring Framework 6.0, but further evaluation is necessary for upgrading NiFi itself to Spring Framework 6.1.
   
   Dependencies upgraded include the following:
   
   - Upgraded Spring Framework from 5.3.31 to 6.0.15
   - Upgraded Spring Security from 5.8.7 to 6.2.0
   - Upgraded Spring Vault from 2.3.4 to 3.1.0
   - Upgraded Jetty from 10.0.18 to 12.0.5 with EE 10
   - Upgraded Jersey from 2.41 to 3.1.4
   - Upgraded JAXB from 2.3.9 to 4.0.4
   - Upgraded AspectJ from 1.9.20.1 to 1.9.21
   - Upgraded JMS API from 2.0.1 to 3.1.0
   - Upgraded ActiveMQ Broker from 5.18.2 to 6.0.1 for JMS 3
   - Upgraded JJWT from 0.9.1 to 0.12.3
   
   Other noteworthy removals and replacements include the following:
   
   - Replaced jackson-module-jaxb-annotations with jackson-module-jakarta-xmlbind-annotations
   - Replaced maven-jaxb2-plugin with hisrc-higherjaxb40-maven-plugin 2.1.1
   - Replaced kongchen swagger-maven-plugin with swagger-codegen-maven-plugin from Swagger 3
   - Replaced com.nickwongdev AspectJ Plugin with Codehaus 1.14.0 for newer Java versions
   - Removed unused cglib-nodep
   - Removed references to javax.validation
   - Removed custom Jetty ALPN Processor not required for Java 21
   - Removed several tests depending on older Jetty and Jakarta libraries
   - Removed unnecessary webdefault.xml configurations
   - Replaced unsupported cross-context servlet forwarding with HTTP forwarding
   
   # Tracking
   
   Please complete the following tracking steps prior to pull request creation.
   
   ### Issue Tracking
   
   - [X] [Apache NiFi Jira](https://issues.apache.org/jira/browse/NIFI) issue created
   
   ### Pull Request Tracking
   
   - [X] Pull Request title starts with Apache NiFi Jira issue number, such as `NIFI-00000`
   - [X] Pull Request commit message starts with Apache NiFi Jira issue number, as such `NIFI-00000`
   
   ### Pull Request Formatting
   
   - [X] Pull Request based on current revision of the `main` branch
   - [X] Pull Request refers to a feature branch with one commit containing changes
   
   # Verification
   
   Please indicate the verification steps performed prior to pull request creation.
   
   ### Build
   
   - [X] Build completed using `mvn clean install -P contrib-check`
     - [X] JDK 21
   
   ### Licensing
   
   - [ ] New dependencies are compatible with the [Apache License 2.0](https://apache.org/licenses/LICENSE-2.0) according to the [License Policy](https://www.apache.org/legal/resolved.html)
   - [ ] New dependencies are documented in applicable `LICENSE` and `NOTICE` files
   
   ### Documentation
   
   - [ ] Documentation formatting appears as expected in rendered files
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "EndzeitBegins (via GitHub)" <gi...@apache.org>.
EndzeitBegins commented on code in PR #8197:
URL: https://github.com/apache/nifi/pull/8197#discussion_r1440563720


##########
minifi/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/configuration/ingestors/RestChangeIngestor.java:
##########
@@ -271,15 +268,17 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
                     responseText = "Failed to override config file";
                 }
 
-                writeOutput(response, responseText, statusCode);
+                writeOutput(request, response, responseText, statusCode);
             } else if (GET.equals(request.getMethod())) {
-                writeOutput(response, GET_TEXT, 200);
+                writeOutput(request, response, GET_TEXT, 200);
             } else {
-                writeOutput(response, OTHER_TEXT, 404);
+                writeOutput(request, response, OTHER_TEXT, 404);
             }
+
+            return false;
         }
 
-        private String getPostText(Collection<ListenerHandleResult> listenerHandleResults) {
+        private String getPostText(java.util.Collection<ListenerHandleResult> listenerHandleResults) {

Review Comment:
   Is there a reason to no longer `import java.util.Collection` here? I couldn't find a different class named `Collection` inside this class, so we could use an import here instead?



##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ParseCEF.java:
##########
@@ -270,9 +265,8 @@ public void process(final InputStream in) throws IOException {
             // parcefoneLocale defaults to en_US, so this should not fail. But we force failure in case the custom
             // validator failed to identify an invalid Locale
             final Locale parcefoneLocale = Locale.forLanguageTag(context.getProperty(DATETIME_REPRESENTATION).getValue());
-            final boolean validateData = context.getProperty(VALIDATE_DATA).asBoolean();
             final boolean acceptEmptyExtensions = context.getProperty(ACCEPT_EMPTY_EXTENSIONS).asBoolean();
-            event = parser.parse(buffer, validateData, acceptEmptyExtensions, parcefoneLocale);
+            event = parser.parse(buffer, false, acceptEmptyExtensions, parcefoneLocale);

Review Comment:
   I'm not familiar with CEF, so take this with a grain of salt. 
   Do we no longer support validation in the processor? If so, the corresponding property should be deprecated / removed most likely?
   As far as I could see, it is not used anymore other than declaring it a supported property.



##########
nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/java/org/apache/nifi/registry/web/filter/LogoutFilter.java:
##########
@@ -33,19 +34,19 @@ public class LogoutFilter implements Filter {
     private ServletContext servletContext;
 
     @Override
-    public void init(FilterConfig filterConfig) throws ServletException {
+    public void init(FilterConfig filterConfig) {
         servletContext = filterConfig.getServletContext();
     }
 
     @Override
-    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException {
         final boolean supportsOidc = Boolean.parseBoolean(servletContext.getInitParameter("oidc-supported"));
+
+        final HttpServletResponse httpServletResponse = (HttpServletResponse) response;
         if (supportsOidc) {
-            final ServletContext apiContext = servletContext.getContext("/nifi-registry-api");
-            apiContext.getRequestDispatcher("/access/oidc/logout").forward(request, response);
+            httpServletResponse.sendRedirect("/nifi-registry-api/access/oidc/logout");

Review Comment:
   Maybe its a good idea, to move these paths into constant definitions, similar to the other `LogoutFilter` implementations, see "KNOX_LOGOUT_URL"?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #8197:
URL: https://github.com/apache/nifi/pull/8197#discussion_r1440952412


##########
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ParseCEF.java:
##########
@@ -270,9 +265,8 @@ public void process(final InputStream in) throws IOException {
             // parcefoneLocale defaults to en_US, so this should not fail. But we force failure in case the custom
             // validator failed to identify an invalid Locale
             final Locale parcefoneLocale = Locale.forLanguageTag(context.getProperty(DATETIME_REPRESENTATION).getValue());
-            final boolean validateData = context.getProperty(VALIDATE_DATA).asBoolean();
             final boolean acceptEmptyExtensions = context.getProperty(ACCEPT_EMPTY_EXTENSIONS).asBoolean();
-            event = parser.parse(buffer, validateData, acceptEmptyExtensions, parcefoneLocale);
+            event = parser.parse(buffer, false, acceptEmptyExtensions, parcefoneLocale);

Review Comment:
   Thanks for highlighting this change @EndzeitBegins. The `ParseCEF` Processor relies on the ParCEFone library, which currently depends on javax.validation to due data validation. Based on the other Jakarta upgrades, this is not compatible, but disabling data validation allows us to continue using the library for now. For the purpose of this PR, I will remove the Validation property from this Processor, and it is something that could be revisited.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #8197:
URL: https://github.com/apache/nifi/pull/8197#discussion_r1440917995


##########
minifi/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/configuration/ingestors/RestChangeIngestor.java:
##########
@@ -271,15 +268,17 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
                     responseText = "Failed to override config file";
                 }
 
-                writeOutput(response, responseText, statusCode);
+                writeOutput(request, response, responseText, statusCode);
             } else if (GET.equals(request.getMethod())) {
-                writeOutput(response, GET_TEXT, 200);
+                writeOutput(request, response, GET_TEXT, 200);
             } else {
-                writeOutput(response, OTHER_TEXT, 404);
+                writeOutput(request, response, OTHER_TEXT, 404);
             }
+
+            return false;
         }
 
-        private String getPostText(Collection<ListenerHandleResult> listenerHandleResults) {
+        private String getPostText(java.util.Collection<ListenerHandleResult> listenerHandleResults) {

Review Comment:
   Actually, strike the previous comment, this is necessary because the Jetty `Handler.Collection` inner class clashes with `java.util.Collection`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #8197:
URL: https://github.com/apache/nifi/pull/8197#discussion_r1440927089


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java:
##########
@@ -972,73 +908,24 @@ public StatusHistoryDumpFactory getStatusHistoryDumpFactory() {
 
     private void performInjectionForComponentUis(final Collection<WebAppContext> componentUiExtensionWebContexts,
                                                  final NiFiWebConfigurationContext configurationContext, final FilterHolder securityFilter) {
-        if (CollectionUtils.isNotEmpty(componentUiExtensionWebContexts)) {
-            for (final WebAppContext customUiContext : componentUiExtensionWebContexts) {
-                // set the NiFi context in each custom ui servlet context
-                final ServletContext customUiServletContext = customUiContext.getServletHandler().getServletContext();
-                customUiServletContext.setAttribute("nifi-web-configuration-context", configurationContext);
-
-                // add the security filter to any ui extensions wars
-                if (securityFilter != null) {
-                    customUiContext.addFilter(securityFilter, "/*", EnumSet.allOf(DispatcherType.class));
-                }
+        for (final WebAppContext customUiContext : componentUiExtensionWebContexts) {
+            // set the NiFi context in each custom ui servlet context
+            final ServletContext customUiServletContext = customUiContext.getServletHandler().getServletContext();
+            customUiServletContext.setAttribute("nifi-web-configuration-context", configurationContext);
+
+            // add the security filter to any ui extensions wars
+            if (securityFilter != null) {
+                customUiContext.addFilter(securityFilter, "/*", EnumSet.allOf(DispatcherType.class));
             }
         }
     }
 
     private void performInjectionForContentViewerUis(final Collection<WebAppContext> contentViewerWebContexts,
                                                      final FilterHolder securityFilter) {
-        if (CollectionUtils.isNotEmpty(contentViewerWebContexts)) {
-            for (final WebAppContext contentViewerContext : contentViewerWebContexts) {
-                // add the security filter to any content viewer  wars
-                if (securityFilter != null) {
-                    contentViewerContext.addFilter(securityFilter, "/*", EnumSet.allOf(DispatcherType.class));
-                }
-            }
-        }
-    }
-
-    private void dumpUrls() throws SocketException {

Review Comment:
   Thanks for catching that. Jetty made some adjustments to their APIs, but I will add back this capability based on a similar approach also implemented in Registry.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "bbende (via GitHub)" <gi...@apache.org>.
bbende commented on code in PR #8197:
URL: https://github.com/apache/nifi/pull/8197#discussion_r1440889002


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml:
##########
@@ -53,71 +59,83 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>com.github.kongchen</groupId>
-                <artifactId>swagger-maven-plugin</artifactId>
-                <version>3.1.8</version>
+                <artifactId>maven-resources-plugin</artifactId>
                 <executions>
                     <execution>
-                        <phase>compile</phase>
+                        <id>openapi-filtering</id>
+                        <phase>validate</phase>
                         <goals>
-                            <goal>generate</goal>
+                            <goal>copy-resources</goal>
                         </goals>
                         <configuration>
-                            <apiSources>
-                                <apiSource>
-                                    <locations>
-                                        <location>org.apache.nifi.web.api</location>
-                                    </locations>
-                                    <schemes>
-                                        <scheme>http</scheme>
-                                        <scheme>https</scheme>
-                                    </schemes>
-                                    <outputFormats>json</outputFormats>
-                                    <basePath>/nifi-api</basePath>
-                                    <info>
-                                        <title>NiFi Rest API</title>
-                                        <version>${project.version}</version>
-                                        <description>
-                                            The Rest API provides programmatic access to command and control a NiFi instance in real time. Start and
-                                            stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description,
-                                            definitions of the expected input and output, potential response codes, and the authorizations required
-                                            to invoke each service.
-                                        </description>
-                                        <contact>
-                                            <email>dev@nifi.apache.org</email>
-                                            <url>https://nifi.apache.org</url>
-                                        </contact>
-                                        <license>
-                                            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
-                                            <name>Apache 2.0</name>
-                                        </license>
-                                    </info>
-                                    <templatePath>classpath:/templates/index.html.hbs</templatePath>
-                                    <outputPath>${project.build.directory}/${project.artifactId}-${project.version}/docs/rest-api/index.html</outputPath>
-                                    <swaggerDirectory>${project.build.directory}/swagger-ui</swaggerDirectory>
-                                </apiSource>
-                            </apiSources>
+                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/openapi</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
                         </configuration>
                     </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
                     <execution>
                         <id>copy-resources</id>
                         <phase>validate</phase>
                         <goals>
                             <goal>copy-resources</goal>
                         </goals>
                         <configuration>
-                            <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/docs/rest-api/images</outputDirectory>
-                            <resources>          
+                            <outputDirectory>${restApiDirectory}/images</outputDirectory>
+                            <resources>
                                 <resource>
                                     <directory>src/main/resources/images</directory>
                                 </resource>
-                            </resources>              
-                        </configuration>            
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>io.swagger.core.v3</groupId>
+                <artifactId>swagger-maven-plugin-jakarta</artifactId>
+                <version>2.2.19</version>
+                <configuration>
+                    <resourcePackages>
+                        <package>org.apache.nifi.web.api</package>
+                    </resourcePackages>
+                    <outputPath>${swaggerDirectory}</outputPath>
+                    <outputFileName>swagger</outputFileName>
+                    <outputFormat>JSONANDYAML</outputFormat>
+                    <prettyPrint>true</prettyPrint>
+                    <defaultResponseCode>200</defaultResponseCode>
+                    <configurationFilePath>${project.build.outputDirectory}/openapi.yaml</configurationFilePath>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>resolve</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>io.swagger.codegen.v3</groupId>
+                <artifactId>swagger-codegen-maven-plugin</artifactId>
+                <version>3.0.50</version>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <inputSpec>${swaggerDefinition}</inputSpec>
+                            <output>${restApiDirectory}</output>

Review Comment:
   Not exactly sure what is happening, but it seems like this is not producing the output in `docs/rest-api` and then it is not ending up in the final assembly. Going to embedded docs and clicking Rest API ends up on a Yikes not found page.



##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-jetty/src/main/java/org/apache/nifi/web/server/JettyServer.java:
##########
@@ -972,73 +908,24 @@ public StatusHistoryDumpFactory getStatusHistoryDumpFactory() {
 
     private void performInjectionForComponentUis(final Collection<WebAppContext> componentUiExtensionWebContexts,
                                                  final NiFiWebConfigurationContext configurationContext, final FilterHolder securityFilter) {
-        if (CollectionUtils.isNotEmpty(componentUiExtensionWebContexts)) {
-            for (final WebAppContext customUiContext : componentUiExtensionWebContexts) {
-                // set the NiFi context in each custom ui servlet context
-                final ServletContext customUiServletContext = customUiContext.getServletHandler().getServletContext();
-                customUiServletContext.setAttribute("nifi-web-configuration-context", configurationContext);
-
-                // add the security filter to any ui extensions wars
-                if (securityFilter != null) {
-                    customUiContext.addFilter(securityFilter, "/*", EnumSet.allOf(DispatcherType.class));
-                }
+        for (final WebAppContext customUiContext : componentUiExtensionWebContexts) {
+            // set the NiFi context in each custom ui servlet context
+            final ServletContext customUiServletContext = customUiContext.getServletHandler().getServletContext();
+            customUiServletContext.setAttribute("nifi-web-configuration-context", configurationContext);
+
+            // add the security filter to any ui extensions wars
+            if (securityFilter != null) {
+                customUiContext.addFilter(securityFilter, "/*", EnumSet.allOf(DispatcherType.class));
             }
         }
     }
 
     private void performInjectionForContentViewerUis(final Collection<WebAppContext> contentViewerWebContexts,
                                                      final FilterHolder securityFilter) {
-        if (CollectionUtils.isNotEmpty(contentViewerWebContexts)) {
-            for (final WebAppContext contentViewerContext : contentViewerWebContexts) {
-                // add the security filter to any content viewer  wars
-                if (securityFilter != null) {
-                    contentViewerContext.addFilter(securityFilter, "/*", EnumSet.allOf(DispatcherType.class));
-                }
-            }
-        }
-    }
-
-    private void dumpUrls() throws SocketException {

Review Comment:
   Can we can preserve something similar to this functionality? I think a lot of users look for this logging at the end of start up to know everything is good to go



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "bbende (via GitHub)" <gi...@apache.org>.
bbende commented on PR #8197:
URL: https://github.com/apache/nifi/pull/8197#issuecomment-1875669077

   Reviewing...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #8197:
URL: https://github.com/apache/nifi/pull/8197#discussion_r1440930233


##########
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/pom.xml:
##########
@@ -53,71 +59,83 @@
                 </configuration>
             </plugin>
             <plugin>
-                <groupId>com.github.kongchen</groupId>
-                <artifactId>swagger-maven-plugin</artifactId>
-                <version>3.1.8</version>
+                <artifactId>maven-resources-plugin</artifactId>
                 <executions>
                     <execution>
-                        <phase>compile</phase>
+                        <id>openapi-filtering</id>
+                        <phase>validate</phase>
                         <goals>
-                            <goal>generate</goal>
+                            <goal>copy-resources</goal>
                         </goals>
                         <configuration>
-                            <apiSources>
-                                <apiSource>
-                                    <locations>
-                                        <location>org.apache.nifi.web.api</location>
-                                    </locations>
-                                    <schemes>
-                                        <scheme>http</scheme>
-                                        <scheme>https</scheme>
-                                    </schemes>
-                                    <outputFormats>json</outputFormats>
-                                    <basePath>/nifi-api</basePath>
-                                    <info>
-                                        <title>NiFi Rest API</title>
-                                        <version>${project.version}</version>
-                                        <description>
-                                            The Rest API provides programmatic access to command and control a NiFi instance in real time. Start and
-                                            stop processors, monitor queues, query provenance data, and more. Each endpoint below includes a description,
-                                            definitions of the expected input and output, potential response codes, and the authorizations required
-                                            to invoke each service.
-                                        </description>
-                                        <contact>
-                                            <email>dev@nifi.apache.org</email>
-                                            <url>https://nifi.apache.org</url>
-                                        </contact>
-                                        <license>
-                                            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
-                                            <name>Apache 2.0</name>
-                                        </license>
-                                    </info>
-                                    <templatePath>classpath:/templates/index.html.hbs</templatePath>
-                                    <outputPath>${project.build.directory}/${project.artifactId}-${project.version}/docs/rest-api/index.html</outputPath>
-                                    <swaggerDirectory>${project.build.directory}/swagger-ui</swaggerDirectory>
-                                </apiSource>
-                            </apiSources>
+                            <outputDirectory>${project.build.outputDirectory}</outputDirectory>
+                            <resources>
+                                <resource>
+                                    <directory>src/main/resources/openapi</directory>
+                                    <filtering>true</filtering>
+                                </resource>
+                            </resources>
                         </configuration>
                     </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-resources-plugin</artifactId>
-                <executions>
                     <execution>
                         <id>copy-resources</id>
                         <phase>validate</phase>
                         <goals>
                             <goal>copy-resources</goal>
                         </goals>
                         <configuration>
-                            <outputDirectory>${project.build.directory}/${project.artifactId}-${project.version}/docs/rest-api/images</outputDirectory>
-                            <resources>          
+                            <outputDirectory>${restApiDirectory}/images</outputDirectory>
+                            <resources>
                                 <resource>
                                     <directory>src/main/resources/images</directory>
                                 </resource>
-                            </resources>              
-                        </configuration>            
+                            </resources>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>io.swagger.core.v3</groupId>
+                <artifactId>swagger-maven-plugin-jakarta</artifactId>
+                <version>2.2.19</version>
+                <configuration>
+                    <resourcePackages>
+                        <package>org.apache.nifi.web.api</package>
+                    </resourcePackages>
+                    <outputPath>${swaggerDirectory}</outputPath>
+                    <outputFileName>swagger</outputFileName>
+                    <outputFormat>JSONANDYAML</outputFormat>
+                    <prettyPrint>true</prettyPrint>
+                    <defaultResponseCode>200</defaultResponseCode>
+                    <configurationFilePath>${project.build.outputDirectory}/openapi.yaml</configurationFilePath>
+                </configuration>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>resolve</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>io.swagger.codegen.v3</groupId>
+                <artifactId>swagger-codegen-maven-plugin</artifactId>
+                <version>3.0.50</version>
+                <executions>
+                    <execution>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>generate</goal>
+                        </goals>
+                        <configuration>
+                            <inputSpec>${swaggerDefinition}</inputSpec>
+                            <output>${restApiDirectory}</output>

Review Comment:
   Thanks for catching that. I went through a few iterations and apparently the last version did not correctly map the URL to the HTML location, will fix this and push the changes.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #8197:
URL: https://github.com/apache/nifi/pull/8197#discussion_r1440915553


##########
minifi/minifi-bootstrap/src/main/java/org/apache/nifi/minifi/bootstrap/configuration/ingestors/RestChangeIngestor.java:
##########
@@ -271,15 +268,17 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques
                     responseText = "Failed to override config file";
                 }
 
-                writeOutput(response, responseText, statusCode);
+                writeOutput(request, response, responseText, statusCode);
             } else if (GET.equals(request.getMethod())) {
-                writeOutput(response, GET_TEXT, 200);
+                writeOutput(request, response, GET_TEXT, 200);
             } else {
-                writeOutput(response, OTHER_TEXT, 404);
+                writeOutput(request, response, OTHER_TEXT, 404);
             }
+
+            return false;
         }
 
-        private String getPostText(Collection<ListenerHandleResult> listenerHandleResults) {
+        private String getPostText(java.util.Collection<ListenerHandleResult> listenerHandleResults) {

Review Comment:
   Good catch, this was the result of iterating over some of Jetty's API changes, but this can be reverted to the simple import.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "exceptionfactory (via GitHub)" <gi...@apache.org>.
exceptionfactory commented on code in PR #8197:
URL: https://github.com/apache/nifi/pull/8197#discussion_r1440924676


##########
nifi-registry/nifi-registry-core/nifi-registry-web-ui/src/main/java/org/apache/nifi/registry/web/filter/LogoutFilter.java:
##########
@@ -33,19 +34,19 @@ public class LogoutFilter implements Filter {
     private ServletContext servletContext;
 
     @Override
-    public void init(FilterConfig filterConfig) throws ServletException {
+    public void init(FilterConfig filterConfig) {
         servletContext = filterConfig.getServletContext();
     }
 
     @Override
-    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException {
+    public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException {
         final boolean supportsOidc = Boolean.parseBoolean(servletContext.getInitParameter("oidc-supported"));
+
+        final HttpServletResponse httpServletResponse = (HttpServletResponse) response;
         if (supportsOidc) {
-            final ServletContext apiContext = servletContext.getContext("/nifi-registry-api");
-            apiContext.getRequestDispatcher("/access/oidc/logout").forward(request, response);
+            httpServletResponse.sendRedirect("/nifi-registry-api/access/oidc/logout");

Review Comment:
   Thanks, that's worth adjusting.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12 [nifi]

Posted by "asfgit (via GitHub)" <gi...@apache.org>.
asfgit closed pull request #8197: NIFI-11703 Upgrade to Spring Framework 6 and Jetty 12
URL: https://github.com/apache/nifi/pull/8197


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org