-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
1,743 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
447 changes: 447 additions & 0 deletions
447
undertow/src/main/java/org/wildfly/extension/undertow/UndertowSubsystemParser_13_0.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1,086 changes: 1,086 additions & 0 deletions
1,086
undertow/src/main/resources/schema/wildfly-undertow_13_0.xsd
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
undertow/src/test/java/org/wildfly/extension/undertow/UndertowSubsystem130TestCase.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
126 changes: 126 additions & 0 deletions
126
undertow/src/test/resources/org/wildfly/extension/undertow/undertow-13.0.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |