Skip to content

Commit

Permalink
[WFLY-15452] bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
baranowb committed Nov 17, 2021
1 parent 6c9ef20 commit fb63e03
Show file tree
Hide file tree
Showing 10 changed files with 1,743 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@ enum Namespace {
UNDERTOW_10_0("urn:jboss:domain:undertow:10.0"),
UNDERTOW_11_0("urn:jboss:domain:undertow:11.0"),
UNDERTOW_12_0("urn:jboss:domain:undertow:12.0"),
UNDERTOW_13_0("urn:jboss:domain:undertow:13.0"),
;

/**
* The current namespace version.
*/
public static final Namespace CURRENT = UNDERTOW_12_0;
public static final Namespace CURRENT = UNDERTOW_13_0;

private final String name;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public class UndertowExtension implements Extension {
static final AccessConstraintDefinition LISTENER_CONSTRAINT = new SensitiveTargetAccessConstraintDefinition(
new SensitivityClassification(SUBSYSTEM_NAME, "web-connector", false, false, false));

private static final ModelVersion CURRENT_MODEL_VERSION = ModelVersion.create(11, 0, 0);
private static final ModelVersion CURRENT_MODEL_VERSION = ModelVersion.create(13, 0, 0);


public static StandardResourceDescriptionResolver getResolver(final String... keyPrefix) {
Expand Down Expand Up @@ -107,6 +107,7 @@ public void initializeParsers(ExtensionParsingContext context) {
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.UNDERTOW_10_0.getUriString(), UndertowSubsystemParser_10_0::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.UNDERTOW_11_0.getUriString(), UndertowSubsystemParser_11_0::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.UNDERTOW_12_0.getUriString(), UndertowSubsystemParser_12_0::new);
context.setSubsystemXmlMapping(SUBSYSTEM_NAME, Namespace.UNDERTOW_13_0.getUriString(), UndertowSubsystemParser_13_0::new);
}

@Override
Expand All @@ -119,7 +120,7 @@ public void initialize(ExtensionContext context) {
deployments.registerSubModel(DeploymentServletDefinition.INSTANCE);
deployments.registerSubModel(DeploymentWebSocketDefinition.INSTANCE);

subsystem.registerXMLElementWriter(UndertowSubsystemParser_12_0::new);
subsystem.registerXMLElementWriter(UndertowSubsystemParser_13_0::new);
}

}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import static org.wildfly.extension.undertow.handlers.ReverseProxyHandler.CONNECTIONS_PER_THREAD;
import static org.wildfly.extension.undertow.handlers.ReverseProxyHandler.CONNECTION_IDLE_TIMEOUT;
import static org.wildfly.extension.undertow.handlers.ReverseProxyHandler.MAX_RETRIES;
import static org.wildfly.extension.undertow.AjpListenerResourceDefinition.ALLOWED_REQUEST_ATTRIBUTES_PATTERN;

import org.jboss.as.controller.ModelVersion;
import org.jboss.as.controller.PathAddress;
Expand Down Expand Up @@ -111,6 +112,10 @@ private static void registerTransformersWildFly22(ResourceTransformationDescript
subsystemBuilder.getAttributeBuilder().addRejectCheck(RejectAttributeChecker.DEFINED, OBFUSCATE_SESSION_ROUTE)
.setDiscard(DiscardAttributeChecker.DEFAULT_VALUE, OBFUSCATE_SESSION_ROUTE)
.end();
subsystemBuilder.addChildResource(UndertowExtension.SERVER_PATH)
.addChildResource(UndertowExtension.AJP_LISTENER_PATH).getAttributeBuilder()
.setDiscard(DiscardAttributeChecker.DEFAULT_VALUE, ALLOWED_REQUEST_ATTRIBUTES_PATTERN)
.addRejectCheck(new SimpleRejectAttributeChecker(ModelNode.TRUE), ALLOWED_REQUEST_ATTRIBUTES_PATTERN.getName()).end();
}

private static void registerTransformersWildFly18(ResourceTransformationDescriptionBuilder subsystemBuilder) {
Expand All @@ -128,9 +133,10 @@ private static void registerTransformersWildFly18(ResourceTransformationDescript
}

private static void registerTransformersWildFly16(ResourceTransformationDescriptionBuilder subsystemBuilder) {
subsystemBuilder
.addChildResource(UndertowExtension.SERVER_PATH)
.addChildResource(UndertowExtension.HOST_PATH)
final ResourceTransformationDescriptionBuilder serverBuilder = subsystemBuilder
.addChildResource(UndertowExtension.SERVER_PATH);

serverBuilder.addChildResource(UndertowExtension.HOST_PATH)
.rejectChildResource(ConsoleAccessLogDefinition.INSTANCE.getPathElement());
}

Expand Down
1,086 changes: 1,086 additions & 0 deletions undertow/src/main/resources/schema/wildfly-undertow_13_0.xsd

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ public class ServerServiceTestCase extends AbstractUndertowSubsystemTestCase {

@Override
protected String getSubsystemXml() throws IOException {
return readResource("undertow-12.0.xml");
return readResource("undertow-13.0.xml");
}

@Override
protected String getSubsystemXsdPath() throws Exception {
return "schema/wildfly-undertow_12_0.xsd";
return "schema/wildfly-undertow_13_0.xsd";
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ public class UndertowServiceTestCase extends AbstractUndertowSubsystemTestCase {

@Override
protected String getSubsystemXml() throws IOException {
return readResource("undertow-12.0.xml");
return readResource("undertow-13.0.xml");
}

@Override
protected String getSubsystemXsdPath() throws Exception {
return "schema/wildfly-undertow_12_0.xsd";
return "schema/wildfly-undertow_13_0.xsd";
}

@Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ protected String getSubsystemXsdPath() throws Exception {
return "schema/wildfly-undertow_12_0.xsd";
}

@Override
protected KernelServices standardSubsystemTest(String configId, boolean compareXml) throws Exception {
return super.standardSubsystemTest(configId, false);
}

@Test
public void testRuntime() throws Exception {
setProperty();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* JBoss, Home of Professional Open Source.
* Copyright 2021, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/

package org.wildfly.extension.undertow;

import java.io.IOException;

import org.jboss.as.subsystem.test.KernelServices;
import org.jboss.as.subsystem.test.KernelServicesBuilder;
import org.junit.Test;

/**
* Test for UndertowSubsystem with subsystem schema version 12.0.
*
* @author Flavia Rainone
* @author Bartosz Baranowski
*/
public class UndertowSubsystem130TestCase extends AbstractUndertowSubsystemTestCase {

private static final int SCHEMA_VERSION = 12;
private final String virtualHostName = "some-server";

@Override
protected String getSubsystemXml() throws IOException {
return readResource("undertow-13.0.xml");
}

@Override
protected String getSubsystemXsdPath() throws Exception {
return "schema/wildfly-undertow_13_0.xsd";
}

@Test
public void testRuntime() throws Exception {
setProperty();
KernelServicesBuilder builder = createKernelServicesBuilder(RUNTIME).setSubsystemXml(getSubsystemXml());
KernelServices mainServices = builder.build();
testRuntime(mainServices, virtualHostName, SCHEMA_VERSION);
testRuntimeOther(mainServices);
testRuntimeLast(mainServices);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<!--
~ JBoss, Home of Professional Open Source.
~ Copyright 2021, Red Hat, Inc., and individual contributors
~ as indicated by the @author tags. See the copyright.txt file in the
~ distribution for a full listing of individual contributors.
~
~ This is free software; you can redistribute it and/or modify it
~ under the terms of the GNU Lesser General Public License as
~ published by the Free Software Foundation; either version 2.1 of
~ the License, or (at your option) any later version.
~
~ This software is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
~ Lesser General Public License for more details.
~
~ You should have received a copy of the GNU Lesser General Public
~ License along with this software; if not, write to the Free
~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
~ 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-->

<subsystem xmlns="urn:jboss:domain:undertow:13.0" default-server="some-server" default-servlet-container="myContainer" default-virtual-host="default-virtual-host" instance-id="some-id" statistics-enabled="true">
<byte-buffer-pool name="test" thread-local-cache-size="45" buffer-size="1000" direct="false" leak-detection-percent="50" max-pool-size="1000"/>
<buffer-cache buffer-size="1025" buffers-per-region="1054" max-regions="15" name="default"/>
<buffer-cache buffer-size="1025" buffers-per-region="1054" max-regions="15" name="extra"/>
<server default-host="other-host" name="some-server" servlet-container="myContainer">
<ajp-listener disallowed-methods="FOO TRACE" allow-unescaped-characters-in-url="true" allowed-request-attributes-pattern="test" max-parameters="5000" name="ajp-connector" no-request-timeout="10000" receive-buffer="5000" redirect-socket="ajps" request-parse-timeout="2000" resolve-peer-address="true" secure="true" send-buffer="50000" socket-binding="ajp" tcp-backlog="500" tcp-keep-alive="true" max-ajp-packet-size="10000"/>
<http-listener always-set-keep-alive="${prop.smth:false}" certificate-forwarding="true" name="default" proxy-address-forwarding="${prop.smth:false}" redirect-socket="ajp" resolve-peer-address="true" socket-binding="http" proxy-protocol="true"/>
<http-listener max-cookies="100" max-headers="30" max-parameters="30" max-post-size="100000" name="second" redirect-socket="https-non-default" require-host-http11="true" socket-binding="http-2" url-charset="windows-1250"/>
<http-listener max-cookies="100" max-headers="30" max-parameters="30" max-post-size="100000" name="no-redirect" socket-binding="http-3" url-charset="windows-1250" worker="non-default"/>
<https-listener disallowed-methods="" max-buffered-request-size="50000" max-connections="100" name="https" record-request-start-time="true" require-host-http11="true" resolve-peer-address="true" security-realm="UndertowRealm" socket-binding="https-non-default" verify-client="REQUESTED"/>
<https-listener certificate-forwarding="true" allow-unescaped-characters-in-url="true" enabled-cipher-suites="ALL:!MD5:!DHA" enabled-protocols="SSLv3, TLSv1.2" name="https-2" proxy-address-forwarding="true" read-timeout="-1" security-realm="UndertowRealm" socket-binding="https-2" write-timeout="-1"/>
<https-listener disallowed-methods="" max-buffered-request-size="50000" max-connections="100" name="https-3" record-request-start-time="true" resolve-peer-address="true" socket-binding="https-3" ssl-context="TestContext" rfc6265-cookie-validation="true" proxy-protocol="true"/>
<!--<https-listener disallowed-methods="" max-buffered-request-size="50000" max-connections="100" name="https-4" record-request-start-time="true" resolve-peer-address="true" socket-binding="https-4" />--> <!-- this one must fail-->
<host alias="localhost,some.host" default-response-code="503" default-web-module="something.war" name="default-virtual-host">
<location handler="welcome-content" name="/">
<filter-ref name="limit-connections"/>
<filter-ref name="headers" priority="${some.priority:10}"/>
<filter-ref name="404-handler"/>
<filter-ref name="static-gzip" predicate="path-suffix('.js')"/>
</location>
<access-log directory="${jboss.server.server.dir}" pattern="REQ %{i,test-header}" predicate="not path-suffix(*.css)" prefix="access" rotate="false"/>
<console-access-log predicate="not path-suffix(*.css)" worker="default">
<attributes>
<authentication-type/>
<date-time date-format="yyyy-MM-dd'T'HH:mm:ss" key="timestamp"/>
<query-parameter>
<name value="test"/>
</query-parameter>
<request-header key-prefix="requestHeader">
<name value="Content-Type"/>
<name value="Content-Encoding"/>
</request-header>
<response-code/>
<response-time time-unit="MICROSECONDS"/>
</attributes>
<metadata>
<property name="@version" value="1"/>
<property name="host" value="${jboss.host.name:localhost}"/>
</metadata>
</console-access-log>
<single-sign-on cookie-name="SSOID" domain="${prop.domain:myDomain}" http-only="true" path="/path" secure="true"/>
</host>
<host alias="www.mysite.com,${prop.value:default-alias}" default-response-code="501" default-web-module="something-else.war" disable-console-redirect="true" name="other-host" queue-requests-on-start="false">
<location handler="welcome-content" name="/">
<filter-ref name="limit-connections"/>
<filter-ref name="headers"/>
<filter-ref name="static-gzip" predicate="path-suffix('.js') or path-suffix('.css') or path-prefix('/resources')"/>
<filter-ref name="404-handler"/>
<filter-ref name="mod-cluster"/>
<filter-ref name="mod-cluster-other"/>
</location>
<filter-ref name="headers"/>
<http-invoker http-authentication-factory="factory" path="services"/>
</host>
</server>
<servlet-container default-buffer-cache="extra" default-encoding="utf-8" default-session-timeout="100" directory-listing="true" eager-filter-initialization="true" ignore-flush="true" name="myContainer" proactive-authentication="${prop.pro:false}" use-listener-encoding="${prop.foo:false}" disable-session-id-reuse="${prop.foo:true}" disable-file-watch-service="${prop.foo:true}" file-cache-metadata-size="50" file-cache-max-file-size="5000" file-cache-time-to-live="1000" default-cookie-version="1" preserve-path-on-forward="false">
<jsp-config check-interval="${prop.check-interval:20}" disabled="${prop.disabled:false}" display-source-fragment="${prop.display-source-fragment:true}" dump-smap="${prop.dump-smap:true}" error-on-use-bean-invalid-class-attribute="${prop.error-on-use-bean-invalid-class-attribute:true}" generate-strings-as-char-arrays="${prop.generate-strings-as-char-arrays:true}" java-encoding="${prop.java-encoding:utf-8}" keep-generated="${prop.keep-generated:true}" mapped-file="${prop.mapped-file:true}" modification-test-interval="${prop.modification-test-interval:1000}" optimize-scriptlets="${prop.optimise-scriptlets:true}" recompile-on-fail="${prop.recompile-on-fail:true}" scratch-dir="${prop.scratch-dir:/some/dir}" smap="${prop.smap:true}" source-vm="${prop.source-vm:1.7}" tag-pooling="${prop.tag-pooling:true}" target-vm="${prop.target-vm:1.7}" trim-spaces="${prop.trim-spaces:true}" x-powered-by="${prop.x-powered-by:true}"/>
<session-cookie comment="session cookie" domain="example.com" http-only="true" max-age="1000" name="MYSESSIONCOOKIE" secure="true"/>
<websockets deflater-level="0" dispatch-to-worker="false" per-message-deflate="false"/>
<mime-mappings>
<mime-mapping name="txt" value="text/plain"/>
</mime-mappings>
<welcome-files>
<welcome-file name="index.seam"/>
</welcome-files>
<crawler-session-management session-timeout="2" user-agents=".*googlebot.*"/>
</servlet-container>
<handlers>
<file case-sensitive="false" directory-listing="true" follow-symlink="true" name="welcome-content" path="${jboss.home.dir}" safe-symlink-paths="/path/to/folder /second/path"/>
<reverse-proxy connection-idle-timeout="60000" max-request-time="60000" connections-per-thread="30" max-retries="10" name="reverse-proxy">
<host instance-id="myRoute" name="server1" outbound-socket-binding="ajp-remote" path="/test" scheme="ajp" ssl-context="TestContext"/>
<host instance-id="myRoute" name="server2" outbound-socket-binding="ajp-remote" path="/test" scheme="ajp" ssl-context="TestContext"/>
</reverse-proxy>
</handlers>
<filters>
<request-limit max-concurrent-requests="15000" name="limit-connections" queue-size="100"/>
<response-header header-name="MY_HEADER" header-value="someValue" name="headers"/>
<gzip name="static-gzip"/>
<error-page code="404" name="404-handler" path="/opt/data/404.html"/>
<mod-cluster advertise-frequency="1000" advertise-path="/foo" advertise-protocol="ajp"
advertise-socket-binding="advertise-socket-binding" broken-node-timeout="1000"
cached-connections-per-thread="10" connection-idle-timeout="10"
failover-strategy="DETERMINISTIC" health-check-interval="600"
management-access-predicate="method[GET]" management-socket-binding="test3"
max-request-time="1000" max-retries="10" name="mod-cluster"
security-key="password" ssl-context="TestContext" max-ajp-packet-size="10000">
<ranked-affinity delimiter="."/>
</mod-cluster>
<mod-cluster name="mod-cluster-other" management-socket-binding="test3">
<single-affinity/>
</mod-cluster>
<filter class-name="io.undertow.server.handlers.HttpTraceHandler" module="io.undertow.core" name="custom-filter"/>
<expression-filter expression="dump-request" name="requestDumper"/>
<rewrite name="redirects" redirect="true" target="'/foo/'"/>
</filters>
<application-security-domains>
<application-security-domain enable-jacc="true" http-authentication-factory="elytron-factory" name="other" override-deployment-config="true" enable-jaspi="false" integrated-jaspi="false">
<single-sign-on client-ssl-context="my-ssl-context" cookie-name="SSOID" domain="${prop.domain:myDomain}" http-only="true" key-alias="my-key-alias" key-store="my-key-store" path="/path" secure="true">
<credential-reference alias="my-credential-alias" store="my-credential-store" type="password"/>
</single-sign-on>
</application-security-domain>
<application-security-domain security-domain="elytron-domain" name="domain-ref" />
</application-security-domains>
</subsystem>

0 comments on commit fb63e03

Please sign in to comment.