[VOTE][RESULT] Release Apache Tomcat 9.0.73

2023-03-03 Thread Rémy Maucherat
The following votes were cast:

Binding:
+1: remm, kkolinko, markt

No other votes were cast. The vote therefore passes.

Thanks to everyone who contributed to this release.

Rémy

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r60429 - /dev/tomcat/tomcat-9/v9.0.73/ /release/tomcat/tomcat-9/v9.0.73/

2023-03-03 Thread remm
Author: remm
Date: Fri Mar  3 08:13:53 2023
New Revision: 60429

Log:
Release Apache Tomcat 9.0.73

Added:
release/tomcat/tomcat-9/v9.0.73/
  - copied from r60428, dev/tomcat/tomcat-9/v9.0.73/
Removed:
dev/tomcat/tomcat-9/v9.0.73/


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1908011 - in /tomcat/site/trunk/docs/tomcat-9.0-doc: ./ annotationapi/ annotationapi/javax/annotation/ annotationapi/javax/annotation/security/ annotationapi/javax/annotation/sql/ api/ ap

2023-03-03 Thread remm
Author: remm
Date: Fri Mar  3 08:25:54 2023
New Revision: 1908011

URL: http://svn.apache.org/viewvc?rev=1908011&view=rev
Log:
Update docs for 9.0.73


[This commit notification would consist of 76 parts, 
which exceeds the limit of 50 ones, so it was shortened to the summary.]

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1908013 - /tomcat/site/trunk/docs/tomcat-9.0-doc/api/org/apache/catalina/valves/rewrite/RandomizedTextRewriteMap.html

2023-03-03 Thread remm
Author: remm
Date: Fri Mar  3 08:38:31 2023
New Revision: 1908013

URL: http://svn.apache.org/viewvc?rev=1908013&view=rev
Log:
Update docs for 9.0.73

Added:

tomcat/site/trunk/docs/tomcat-9.0-doc/api/org/apache/catalina/valves/rewrite/RandomizedTextRewriteMap.html

Added: 
tomcat/site/trunk/docs/tomcat-9.0-doc/api/org/apache/catalina/valves/rewrite/RandomizedTextRewriteMap.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-9.0-doc/api/org/apache/catalina/valves/rewrite/RandomizedTextRewriteMap.html?rev=1908013&view=auto
==
--- 
tomcat/site/trunk/docs/tomcat-9.0-doc/api/org/apache/catalina/valves/rewrite/RandomizedTextRewriteMap.html
 (added)
+++ 
tomcat/site/trunk/docs/tomcat-9.0-doc/api/org/apache/catalina/valves/rewrite/RandomizedTextRewriteMap.html
 Fri Mar  3 08:38:31 2023
@@ -0,0 +1,416 @@
+
+
+
+
+
+RandomizedTextRewriteMap (Apache Tomcat 9.0.73 API 
Documentation)
+
+
+
+
+
+
+
+
+
+
+
+
+
+var data = {"i0":10,"i1":10};
+var tabs = {65535:["t0","All Methods"],2:["t2","Instance 
Methods"],8:["t4","Concrete Methods"]};
+var altColor = "altColor";
+var rowColor = "rowColor";
+var tableTab = "tableTab";
+var activeTableTab = "activeTableTab";
+var pathtoroot = "../../../../../";
+var useModuleDirectories = true;
+loadScripts(document, 'script');
+
+JavaScript is disabled on your browser.
+
+
+
+
+
+
+
+
+Skip navigation links
+
+
+
+
+Overview
+Package
+Class
+Tree
+Deprecated
+Index
+Help
+
+Apache Tomcat 9.0.73
+
+
+
+All Classes
+
+
+SEARCH:
+
+
+
+
+
+
+
+
+JavaScript is disabled on your browser.
+
+
+
+
+Summary: 
+Nested | 
+Field | 
+Constr | 
+Method
+
+
+Detail: 
+Field | 
+Constr | 
+Method
+
+
+
+
+
+
+
+ 
+
+
+
+
+
+
+
+Package org.apache.catalina.valves.rewrite
+Class 
RandomizedTextRewriteMap
+
+
+
+java.lang.Object
+
+
+org.apache.catalina.valves.rewrite.RandomizedTextRewriteMap
+
+
+
+
+
+
+
+All Implemented Interfaces:
+RewriteMap
+
+
+public class RandomizedTextRewriteMap
+extends java.lang.Object
+implements RewriteMap
+Implement a map for the txt: and rnd: mod_rewrite 
capabilities.
+
+
+
+
+
+
+
+
+
+
+
+
+Field Summary
+
+Fields 
+
+Modifier and Type
+Field
+Description
+
+
+protected static StringManager
+sm
+ 
+
+
+
+
+
+
+
+
+
+
+
+Constructor Summary
+
+Constructors 
+
+Constructor
+Description
+
+
+RandomizedTextRewriteMap​(java.lang.String txtFilePath,
+boolean useRandom)
+
+Create a map from a text file according to the mod_rewrite 
syntax.
+
+
+
+
+
+
+
+
+
+
+
+
+Method Summary
+
+All Methods Instance Methods Concrete Methods 
+
+Modifier and Type
+Method
+Description
+
+
+java.lang.String
+lookup​(java.lang.String key)
+
+Maps a key to a replacement value.
+ The method is free to return null to indicate, that the default
+ value from the RewriteRule directive should be used.
+
+
+
+java.lang.String
+setParameters​(java.lang.String params)
+
+Optional parameter that can be defined through the 
RewriteMap
+ directive in the rewrite.config file.
+
+
+
+
+
+
+
+Methods inherited from class java.lang.Object
+clone, equals, finalize, getClass, hashCode, notify, notifyAll, 
toString, wait, wait, wait
+
+
+
+
+
+Methods inherited from 
interface org.apache.catalina.valves.rewrite.RewriteMap
+setParameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Field Detail
+
+
+
+
+
+sm
+protected static final StringManager sm
+
+
+
+
+
+
+
+
+
+
+
+Constructor Detail
+
+
+
+
+
+RandomizedTextRewriteMap
+public RandomizedTextRewriteMap​(java.lang.String txtFilePath,
+boolean useRandom)
+Create a map from a text file according to the mod_rewrite 
syntax.
+
+Parameters:
+txtFilePath - the text file path
+useRandom - if the map should produce random results
+
+
+
+
+
+
+
+
+
+
+
+
+Method Detail
+
+
+
+
+
+setParameters
+public java.lang.String setParameters​(java.lang.String params)
+Description copied from 
interface: RewriteMap
+Optional parameter that can be defined through the 
RewriteMap
+ directive in the rewrite.config file.
+
+Specified by:
+setParameters in
 interface RewriteMap
+Parameters:
+params - the optional parameter
+Returns:
+value is currently ignored
+
+
+
+
+
+
+
+
+lookup
+public java.lang.String lookup​(java.lang.String key)
+Description copied from 
interface: RewriteMap
+Maps a key to a replacement value.
+ The method is free to return null to indicate, that the default
+ value from the RewriteRule directive sh

[tomcat] branch main updated: Add an access log valve that uses a json format

2023-03-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 00edb6d271 Add an access log valve that uses a json format
00edb6d271 is described below

commit 00edb6d271f6ffbe65a01acc377b1930c7354ab0
Author: remm 
AuthorDate: Fri Mar 3 10:40:08 2023 +0100

Add an access log valve that uses a json format

Note: The attribute names are important, and are not final. Please
comment if you care about this.
There's an inconsistency in the code between JSON and Json. I kept Json
to go along with the existing JsonErrorReportValve.
Based on code submitted by Thomas Meyer in PR#539.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 203 +
 java/org/apache/tomcat/util/json/JSONFilter.java   |   6 +-
 .../apache/tomcat/util/json/TestJSONFilter.java|   1 +
 webapps/docs/changelog.xml |   4 +
 webapps/docs/config/valve.xml  |  65 +++
 5 files changed, 277 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
new file mode 100644
index 00..cd48cfceb2
--- /dev/null
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.valves;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.tomcat.util.json.JSONFilter;
+
+/**
+ * Access log valve derivative that rewrites entries as JSON.
+ * Important note: the attribute names are not final
+ * Patterns are mapped to attributes as followed:
+ * 
+ * a: remoteAddr
+ * A: localAddr
+ * b: size (byteSent: size)
+ * B: byteSentNC
+ * D: elapsedTime
+ * F: firstByteTime
+ * h: host
+ * H: protocol
+ * l: logicalUserName
+ * m: method
+ * p: port
+ * q: query
+ * r: request
+ * s: statusCode
+ * S: sessionId
+ * t: time (dateTime: time)
+ * T: elapsedTimeS
+ * u: user
+ * U: path (requestURI: path)
+ * v: localServerName
+ * I: threadName
+ * X: connectionStatus
+ * 
+ * The attribute list is based on
+ * 
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
+ */
+public class JsonAccessLogValve extends AccessLogValve {
+
+private static final Map PATTERNS;
+static {
+// FIXME: finalize attribute names
+Map pattern2AttributeName = new HashMap<>();
+pattern2AttributeName.put('a', "remoteAddr");
+pattern2AttributeName.put('A', "localAddr");
+pattern2AttributeName.put('b', "size"); /* byteSent -> size */
+pattern2AttributeName.put('B', "byteSentNC");
+pattern2AttributeName.put('D', "elapsedTime");
+pattern2AttributeName.put('F', "firstByteTime");
+pattern2AttributeName.put('h', "host");
+pattern2AttributeName.put('H', "protocol");
+pattern2AttributeName.put('l', "logicalUserName");
+pattern2AttributeName.put('m', "method");
+pattern2AttributeName.put('p', "port");
+pattern2AttributeName.put('q', "query");
+pattern2AttributeName.put('r', "request");
+pattern2AttributeName.put('s', "statusCode");
+pattern2AttributeName.put('S', "sessionId");
+pattern2AttributeName.put('t', "time"); /* dateTime -> time */
+pattern2AttributeName.put('T', "elapsedTimeS");
+pattern2AttributeName.put('u', "user");
+pattern2AttributeName.put('U', "path"); /* requestURI -> path */
+pattern2AttributeName.put('v', "localServerName");
+pattern2AttributeName.put('I', "threadName");
+pattern2AttributeName.put('X', "connectionStatus");
+PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
+

[tomcat] branch 10.1.x updated: Add an access log valve that uses a json format

2023-03-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 7642315355 Add an access log valve that uses a json format
7642315355 is described below

commit 76423153551f2c3c55cbb53871e95b2018f4bd7a
Author: remm 
AuthorDate: Fri Mar 3 10:40:08 2023 +0100

Add an access log valve that uses a json format

Note: The attribute names are important, and are not final. Please
comment if you care about this.
There's an inconsistency in the code between JSON and Json. I kept Json
to go along with the existing JsonErrorReportValve.
Based on code submitted by Thomas Meyer in PR#539.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 203 +
 java/org/apache/tomcat/util/json/JSONFilter.java   |   6 +-
 .../apache/tomcat/util/json/TestJSONFilter.java|   1 +
 webapps/docs/changelog.xml |   4 +
 webapps/docs/config/valve.xml  |  65 +++
 5 files changed, 277 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
new file mode 100644
index 00..cd48cfceb2
--- /dev/null
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.valves;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.tomcat.util.json.JSONFilter;
+
+/**
+ * Access log valve derivative that rewrites entries as JSON.
+ * Important note: the attribute names are not final
+ * Patterns are mapped to attributes as followed:
+ * 
+ * a: remoteAddr
+ * A: localAddr
+ * b: size (byteSent: size)
+ * B: byteSentNC
+ * D: elapsedTime
+ * F: firstByteTime
+ * h: host
+ * H: protocol
+ * l: logicalUserName
+ * m: method
+ * p: port
+ * q: query
+ * r: request
+ * s: statusCode
+ * S: sessionId
+ * t: time (dateTime: time)
+ * T: elapsedTimeS
+ * u: user
+ * U: path (requestURI: path)
+ * v: localServerName
+ * I: threadName
+ * X: connectionStatus
+ * 
+ * The attribute list is based on
+ * 
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
+ */
+public class JsonAccessLogValve extends AccessLogValve {
+
+private static final Map PATTERNS;
+static {
+// FIXME: finalize attribute names
+Map pattern2AttributeName = new HashMap<>();
+pattern2AttributeName.put('a', "remoteAddr");
+pattern2AttributeName.put('A', "localAddr");
+pattern2AttributeName.put('b', "size"); /* byteSent -> size */
+pattern2AttributeName.put('B', "byteSentNC");
+pattern2AttributeName.put('D', "elapsedTime");
+pattern2AttributeName.put('F', "firstByteTime");
+pattern2AttributeName.put('h', "host");
+pattern2AttributeName.put('H', "protocol");
+pattern2AttributeName.put('l', "logicalUserName");
+pattern2AttributeName.put('m', "method");
+pattern2AttributeName.put('p', "port");
+pattern2AttributeName.put('q', "query");
+pattern2AttributeName.put('r', "request");
+pattern2AttributeName.put('s', "statusCode");
+pattern2AttributeName.put('S', "sessionId");
+pattern2AttributeName.put('t', "time"); /* dateTime -> time */
+pattern2AttributeName.put('T', "elapsedTimeS");
+pattern2AttributeName.put('u', "user");
+pattern2AttributeName.put('U', "path"); /* requestURI -> path */
+pattern2AttributeName.put('v', "localServerName");
+pattern2AttributeName.put('I', "threadName");
+pattern2AttributeName.put('X', "connectionStatus");
+PATTERNS = Collections.unmodifiableMap(pattern2AttributeName

[tomcat] branch 9.0.x updated: Add an access log valve that uses a json format

2023-03-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 659caf3f82 Add an access log valve that uses a json format
659caf3f82 is described below

commit 659caf3f8274d78da119136a3982569b5e5dd319
Author: remm 
AuthorDate: Fri Mar 3 10:40:08 2023 +0100

Add an access log valve that uses a json format

Note: The attribute names are important, and are not final. Please
comment if you care about this.
There's an inconsistency in the code between JSON and Json. I kept Json
to go along with the existing JsonErrorReportValve.
Based on code submitted by Thomas Meyer in PR#539.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 203 +
 java/org/apache/tomcat/util/json/JSONFilter.java   |   6 +-
 .../apache/tomcat/util/json/TestJSONFilter.java|   1 +
 webapps/docs/changelog.xml |   4 +
 webapps/docs/config/valve.xml  |  65 +++
 5 files changed, 277 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
new file mode 100644
index 00..cd48cfceb2
--- /dev/null
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.valves;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.tomcat.util.json.JSONFilter;
+
+/**
+ * Access log valve derivative that rewrites entries as JSON.
+ * Important note: the attribute names are not final
+ * Patterns are mapped to attributes as followed:
+ * 
+ * a: remoteAddr
+ * A: localAddr
+ * b: size (byteSent: size)
+ * B: byteSentNC
+ * D: elapsedTime
+ * F: firstByteTime
+ * h: host
+ * H: protocol
+ * l: logicalUserName
+ * m: method
+ * p: port
+ * q: query
+ * r: request
+ * s: statusCode
+ * S: sessionId
+ * t: time (dateTime: time)
+ * T: elapsedTimeS
+ * u: user
+ * U: path (requestURI: path)
+ * v: localServerName
+ * I: threadName
+ * X: connectionStatus
+ * 
+ * The attribute list is based on
+ * 
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
+ */
+public class JsonAccessLogValve extends AccessLogValve {
+
+private static final Map PATTERNS;
+static {
+// FIXME: finalize attribute names
+Map pattern2AttributeName = new HashMap<>();
+pattern2AttributeName.put('a', "remoteAddr");
+pattern2AttributeName.put('A', "localAddr");
+pattern2AttributeName.put('b', "size"); /* byteSent -> size */
+pattern2AttributeName.put('B', "byteSentNC");
+pattern2AttributeName.put('D', "elapsedTime");
+pattern2AttributeName.put('F', "firstByteTime");
+pattern2AttributeName.put('h', "host");
+pattern2AttributeName.put('H', "protocol");
+pattern2AttributeName.put('l', "logicalUserName");
+pattern2AttributeName.put('m', "method");
+pattern2AttributeName.put('p', "port");
+pattern2AttributeName.put('q', "query");
+pattern2AttributeName.put('r', "request");
+pattern2AttributeName.put('s', "statusCode");
+pattern2AttributeName.put('S', "sessionId");
+pattern2AttributeName.put('t', "time"); /* dateTime -> time */
+pattern2AttributeName.put('T', "elapsedTimeS");
+pattern2AttributeName.put('u', "user");
+pattern2AttributeName.put('U', "path"); /* requestURI -> path */
+pattern2AttributeName.put('v', "localServerName");
+pattern2AttributeName.put('I', "threadName");
+pattern2AttributeName.put('X', "connectionStatus");
+PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);

[tomcat] branch 8.5.x updated: Add an access log valve that uses a json format

2023-03-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 857286f8e2 Add an access log valve that uses a json format
857286f8e2 is described below

commit 857286f8e23d2914e0f2f2e5e7bc74695024dadf
Author: remm 
AuthorDate: Fri Mar 3 10:40:08 2023 +0100

Add an access log valve that uses a json format

Note: The attribute names are important, and are not final. Please
comment if you care about this.
There's an inconsistency in the code between JSON and Json. I kept Json
to go along with the existing JsonErrorReportValve.
Based on code submitted by Thomas Meyer in PR#539.
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 203 +
 java/org/apache/tomcat/util/json/JSONFilter.java   |   6 +-
 .../apache/tomcat/util/json/TestJSONFilter.java|   1 +
 webapps/docs/changelog.xml |   4 +
 webapps/docs/config/valve.xml  |  65 +++
 5 files changed, 277 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
new file mode 100644
index 00..cd48cfceb2
--- /dev/null
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -0,0 +1,203 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.catalina.valves;
+
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+
+import org.apache.catalina.connector.Request;
+import org.apache.catalina.connector.Response;
+import org.apache.tomcat.util.json.JSONFilter;
+
+/**
+ * Access log valve derivative that rewrites entries as JSON.
+ * Important note: the attribute names are not final
+ * Patterns are mapped to attributes as followed:
+ * 
+ * a: remoteAddr
+ * A: localAddr
+ * b: size (byteSent: size)
+ * B: byteSentNC
+ * D: elapsedTime
+ * F: firstByteTime
+ * h: host
+ * H: protocol
+ * l: logicalUserName
+ * m: method
+ * p: port
+ * q: query
+ * r: request
+ * s: statusCode
+ * S: sessionId
+ * t: time (dateTime: time)
+ * T: elapsedTimeS
+ * u: user
+ * U: path (requestURI: path)
+ * v: localServerName
+ * I: threadName
+ * X: connectionStatus
+ * 
+ * The attribute list is based on
+ * 
https://github.com/fluent/fluentd/blob/master/lib/fluent/plugin/parser_apache2.rb#L72
+ */
+public class JsonAccessLogValve extends AccessLogValve {
+
+private static final Map PATTERNS;
+static {
+// FIXME: finalize attribute names
+Map pattern2AttributeName = new HashMap<>();
+pattern2AttributeName.put('a', "remoteAddr");
+pattern2AttributeName.put('A', "localAddr");
+pattern2AttributeName.put('b', "size"); /* byteSent -> size */
+pattern2AttributeName.put('B', "byteSentNC");
+pattern2AttributeName.put('D', "elapsedTime");
+pattern2AttributeName.put('F', "firstByteTime");
+pattern2AttributeName.put('h', "host");
+pattern2AttributeName.put('H', "protocol");
+pattern2AttributeName.put('l', "logicalUserName");
+pattern2AttributeName.put('m', "method");
+pattern2AttributeName.put('p', "port");
+pattern2AttributeName.put('q', "query");
+pattern2AttributeName.put('r', "request");
+pattern2AttributeName.put('s', "statusCode");
+pattern2AttributeName.put('S', "sessionId");
+pattern2AttributeName.put('t', "time"); /* dateTime -> time */
+pattern2AttributeName.put('T', "elapsedTimeS");
+pattern2AttributeName.put('u', "user");
+pattern2AttributeName.put('U', "path"); /* requestURI -> path */
+pattern2AttributeName.put('v', "localServerName");
+pattern2AttributeName.put('I', "threadName");
+pattern2AttributeName.put('X', "connectionStatus");
+PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);

[GitHub] [tomcat] rmaucher commented on pull request #539: JsonAccessLogValve: Add valve for structured logging

2023-03-03 Thread via GitHub


rmaucher commented on PR #539:
URL: https://github.com/apache/tomcat/pull/539#issuecomment-1453257058

   I merged this with significant modifications. Thanks.


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[GitHub] [tomcat] rmaucher closed pull request #539: JsonAccessLogValve: Add valve for structured logging

2023-03-03 Thread via GitHub


rmaucher closed pull request #539: JsonAccessLogValve: Add valve for structured 
logging
URL: https://github.com/apache/tomcat/pull/539


-- 
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: dev-unsubscr...@tomcat.apache.org

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


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r1908016 - in /tomcat/site/trunk: ./ docs/ xdocs/

2023-03-03 Thread remm
Author: remm
Date: Fri Mar  3 10:37:25 2023
New Revision: 1908016

URL: http://svn.apache.org/viewvc?rev=1908016&view=rev
Log:
Update website for 9.0.73

Modified:
tomcat/site/trunk/build.properties.default
tomcat/site/trunk/docs/doap_Tomcat.rdf
tomcat/site/trunk/docs/download-90.html
tomcat/site/trunk/docs/index.html
tomcat/site/trunk/docs/migration-9.html
tomcat/site/trunk/docs/oldnews.html
tomcat/site/trunk/docs/whichversion.html
tomcat/site/trunk/xdocs/doap_Tomcat.rdf
tomcat/site/trunk/xdocs/download-90.xml
tomcat/site/trunk/xdocs/index.xml
tomcat/site/trunk/xdocs/migration-9.xml
tomcat/site/trunk/xdocs/oldnews.xml
tomcat/site/trunk/xdocs/whichversion.xml

Modified: tomcat/site/trunk/build.properties.default
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/build.properties.default?rev=1908016&r1=1908015&r2=1908016&view=diff
==
--- tomcat/site/trunk/build.properties.default (original)
+++ tomcat/site/trunk/build.properties.default Fri Mar  3 10:37:25 2023
@@ -37,7 +37,7 @@ tomcat.loc=https://downloads.apache.org/
 
 # - Tomcat versions -
 tomcat8.5=8.5.86
-tomcat9.0=9.0.72
+tomcat9.0=9.0.73
 tomcat10.0=10.0.27
 tomcat10.1=10.1.6
 tomcat11.0=11.0.0-M3

Modified: tomcat/site/trunk/docs/doap_Tomcat.rdf
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/doap_Tomcat.rdf?rev=1908016&r1=1908015&r2=1908016&view=diff
==
--- tomcat/site/trunk/docs/doap_Tomcat.rdf (original)
+++ tomcat/site/trunk/docs/doap_Tomcat.rdf Fri Mar  3 10:37:25 2023
@@ -74,8 +74,8 @@
 
   
 Latest Stable 9.0.x Release
-2023-02-23
-9.0.72
+2023-03-03
+9.0.73
   
 
 

Modified: tomcat/site/trunk/docs/download-90.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/download-90.html?rev=1908016&r1=1908015&r2=1908016&view=diff
==
--- tomcat/site/trunk/docs/download-90.html (original)
+++ tomcat/site/trunk/docs/download-90.html Fri Mar  3 10:37:25 2023
@@ -10,7 +10,7 @@
 
   Quick Navigation
 
-[define v]9.0.72[end]
+[define v]9.0.73[end]
 https://downloads.apache.org/tomcat/tomcat-9/KEYS";>KEYS |
 [v] |
 Browse |

Modified: tomcat/site/trunk/docs/index.html
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/index.html?rev=1908016&r1=1908015&r2=1908016&view=diff
==
--- tomcat/site/trunk/docs/index.html (original)
+++ tomcat/site/trunk/docs/index.html Fri Mar  3 10:37:25 2023
@@ -34,6 +34,30 @@ wiki page.
 Apache Tomcat, Tomcat, Apache, the Apache feather, and the Apache Tomcat
 project logo are trademarks of the Apache Software Foundation.
 
+2023-03-03 Tomcat 9.0.73 Released
+
+The Apache Tomcat Project is proud to announce the release of version 9.0.73
+of Apache Tomcat. This release implements specifications that are part of the
+Java EE 8 platform. The notable changes compared to 9.0.72 include:
+
+Correct a regression introduced in the fix for bug
+  66196 that meant that the HTTP headers and/or request line
+  could get corrupted (one part overwriting another part) within a single
+  request.
+Provide a more appropriate response (501 rather than 400) when rejecting
+  an HTTP request using the CONNECT method.
+Add support for txt: and rnd: rewrite map types from mod_rewrite. Based
+  on a pull request provided by Dimitrios Soumis.
+
+
+Full details of these changes, and all the other changes, are available in the
+Tomcat 9
+changelog.
+
+
+
+https://tomcat.apache.org/download-90.cgi";>Download
+
 2023-02-24 Tomcat 10.1.6 Released
 
 The Apache Tomcat Project is proud to announce the release of version 10.1.6
@@ -100,29 +124,6 @@ reach https://tomcat.apache.org
 
 https://tomcat.apache.org/download-80.cgi";>Download
 
-2023-02-23 Tomcat 9.0.72 Released
-
-The Apache Tomcat Project is proud to announce the release of version 9.0.72
-of Apache Tomcat. This release implements specifications that are part of the
-Java EE 8 platform. The notable changes compared to 9.0.71 include:
-
-Add an error report valve that allows redirecting to or proxying from an
-   external web server.
-Log basic information for each configured TLS certificate when
-   Tomcat starts.
-Add the shared address space specified by RFC 6598 (100.64.0.0/10)
-   to the list of trusted proxies for RemoteIPValve/Filter.
-Limit access to examples web application to localhost by default.
-
-
-Full details of these changes, and all the other changes, are available in the
-Tomcat 9
-changelog.
-
-
-
-https://tomcat.apache.org/download-90.cgi";>Download
-
 2023-02-23 Tomcat 11.0.0-M3 Released
 
 The Apache Tomcat Project is proud to announce the release of version 11.0.0-M3

Modified: tomcat/site/trunk/docs/mig

svn commit: r1908017 - in /tomcat/site/trunk/docs/tomcat-9.0-doc/META-INF: ./ context.xml

2023-03-03 Thread remm
Author: remm
Date: Fri Mar  3 10:39:08 2023
New Revision: 1908017

URL: http://svn.apache.org/viewvc?rev=1908017&view=rev
Log:
Add new Tomcat config file. Not useful here but it will always be there.

Added:
tomcat/site/trunk/docs/tomcat-9.0-doc/META-INF/
tomcat/site/trunk/docs/tomcat-9.0-doc/META-INF/context.xml

Added: tomcat/site/trunk/docs/tomcat-9.0-doc/META-INF/context.xml
URL: 
http://svn.apache.org/viewvc/tomcat/site/trunk/docs/tomcat-9.0-doc/META-INF/context.xml?rev=1908017&view=auto
==
--- tomcat/site/trunk/docs/tomcat-9.0-doc/META-INF/context.xml (added)
+++ tomcat/site/trunk/docs/tomcat-9.0-doc/META-INF/context.xml Fri Mar  3 
10:39:08 2023
@@ -0,0 +1,21 @@
+
+
+
+  
+



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[ANN] Apache Tomcat 9.0.73 available

2023-03-03 Thread Rémy Maucherat
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 9.0.73.

Apache Tomcat 9 is an open source software implementation of the Java
Servlet, JavaServer Pages, Java Unified Expression Language, Java
WebSocket and JASPIC technologies.

Apache Tomcat 9.0.73 is a bugfix and feature release. The notable
changes compared to 9.0.72 include:

- Correct a regression introduced in the fix for bug
  66196 that meant that the HTTP headers and/or request line
  could get corrupted (one part overwriting another part) within a single
  request.

- Provide a more appropriate response (501 rather than 400) when rejecting
  an HTTP request using the CONNECT method.

- Add support for txt: and rnd: rewrite map types from mod_rewrite. Based
  on a pull request provided by Dimitrios Soumis.

Along with lots of other bug fixes and improvements.

Please refer to the change log for the complete list of changes:
https://tomcat.apache.org/tomcat-9.0-doc/changelog.html


Downloads:
https://tomcat.apache.org/download-90.cgi

Migration guides from Apache Tomcat 7.x and 8.x:
https://tomcat.apache.org/migration.html

Enjoy!

- The Apache Tomcat team

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot success in on tomcat-10.1.x

2023-03-03 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/44/builds/698
Blamelist: Mark Thomas , remm 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 10.1.x] 76423153551f2c3c55cbb53871e95b2018f4bd7a


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot success in on tomcat-9.0.x

2023-03-03 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/37/builds/481
Blamelist: Mark Thomas , remm 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 9.0.x] 659caf3f8274d78da119136a3982569b5e5dd319


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 1

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot failure in on tomcat-8.5.x

2023-03-03 Thread buildbot
Build status: BUILD FAILED: failed compile (failure)
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/36/builds/414
Blamelist: remm 
Build Text: failed compile (failure)
Status Detected: new failure
Build Source Stamp: [branch 8.5.x] 857286f8e23d2914e0f2f2e5e7bc74695024dadf


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 2


-- ASF Buildbot


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Fix lambda

2023-03-03 Thread remm
This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 4836e260f4 Fix lambda
4836e260f4 is described below

commit 4836e260f473d7d832b74a2cf1f1d1f7f0b9c8e2
Author: remm 
AuthorDate: Fri Mar 3 13:26:11 2023 +0100

Fix lambda
---
 .../org/apache/catalina/valves/JsonAccessLogValve.java | 18 +++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index cd48cfceb2..aae85b824f 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -97,7 +97,11 @@ public class JsonAccessLogValve extends AccessLogValve {
 protected AccessLogElement[] createLogElements() {
 List logElements = new 
ArrayList<>(Arrays.asList(super.createLogElements()));
 ListIterator lit = logElements.listIterator();
-lit.add((buf, date, req, resp, time) -> buf.write('{'));
+lit.add(new AccessLogElement() {
+@Override
+public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
+buf.write('{');
+}});
 while (lit.hasNext()) {
 AccessLogElement logElement = lit.next();
 // remove all other elements, like StringElements
@@ -105,12 +109,20 @@ public class JsonAccessLogValve extends AccessLogValve {
 lit.remove();
 continue;
 }
-lit.add((buf, date, req, resp, time) -> buf.write(','));
+lit.add(new AccessLogElement() {
+@Override
+public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
+buf.write(',');
+}});
 }
 // remove last comma again
 lit.previous();
 lit.remove();
-lit.add((buf, date, req, resp, time) -> buf.write('}'));
+lit.add(new AccessLogElement() {
+@Override
+public void addElement(CharArrayWriter buf, Date date, Request 
request, Response response, long time) {
+buf.write('}');
+}});
 return logElements.toArray(new AccessLogElement[logElements.size()]);
 }
 


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



Buildbot success in on tomcat-8.5.x

2023-03-03 Thread buildbot
Build status: Build succeeded!
Worker used: bb_worker2_ubuntu
URL: https://ci2.apache.org/#builders/36/builds/415
Blamelist: remm 
Build Text: build successful
Status Detected: restored build
Build Source Stamp: [branch 8.5.x] 4836e260f473d7d832b74a2cf1f1d1f7f0b9c8e2


Steps:

  worker_preparation: 0

  git: 0

  shell: 0

  shell_1: 0

  shell_2: 0

  shell_3: 0

  shell_4: 0

  shell_5: 0

  compile: 0

  shell_6: 0

  shell_7: 0

  shell_8: 0

  shell_9: 0

  Rsync docs to nightlies.apache.org: 0

  shell_10: 0

  Rsync RAT to nightlies.apache.org: 0

  compile_1: 1

  shell_11: 0

  Rsync Logs to nightlies.apache.org: 0


-- ASF Buildbot


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 10.1.x updated: Update format

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 4aa341bf1e Update format
4aa341bf1e is described below

commit 4aa341bf1e8f9b51dd69a1d969eb2951690c08a8
Author: Mark Thomas 
AuthorDate: Fri Mar 3 13:53:22 2023 +

Update format
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index a9a00d4e48..6bf98bd9e2 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -1309,6 +1309,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 
 
 protected enum AllowCorsPreflight {
-NEVER, FILTER, ALWAYS
+NEVER,
+FILTER,
+ALWAYS
 }
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Update format

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 1794087c7b Update format
1794087c7b is described below

commit 1794087c7b14277ef073d3bc1254a20a52d8bb80
Author: Mark Thomas 
AuthorDate: Fri Mar 3 13:53:22 2023 +

Update format
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 9563b7a6ae..fc9bf8bea4 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -1308,6 +1308,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 
 
 protected enum AllowCorsPreflight {
-NEVER, FILTER, ALWAYS
+NEVER,
+FILTER,
+ALWAYS
 }
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch main updated: Update format

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new e775429ab3 Update format
e775429ab3 is described below

commit e775429ab3ff8664b3552d0d030d817f8a231ff9
Author: Mark Thomas 
AuthorDate: Fri Mar 3 13:53:22 2023 +

Update format
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index a9a00d4e48..6bf98bd9e2 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -1309,6 +1309,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 
 
 protected enum AllowCorsPreflight {
-NEVER, FILTER, ALWAYS
+NEVER,
+FILTER,
+ALWAYS
 }
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Update format

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 2784ea307b Update format
2784ea307b is described below

commit 2784ea307b98e4e3371d97f8752e6b85805ea1c5
Author: Mark Thomas 
AuthorDate: Fri Mar 3 13:53:22 2023 +

Update format
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 899aa1bd97..24d82fd2a3 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -1334,6 +1334,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
 
 
 protected enum AllowCorsPreflight {
-NEVER, FILTER, ALWAYS
+NEVER,
+FILTER,
+ALWAYS
 }
 }


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch main updated: Update reference to RFC for BASIC authentication to RFC 7617

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new e8fb2de8d8 Update reference to RFC for BASIC authentication to RFC 7617
e8fb2de8d8 is described below

commit e8fb2de8d8f9ed4a75ef807c407f0903b5dc275d
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:04:15 2023 +

Update reference to RFC for BASIC authentication to RFC 7617
---
 java/org/apache/catalina/authenticator/BasicAuthenticator.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java 
b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index f19c89c6a6..7ec9c43862 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -32,8 +32,8 @@ import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.codec.binary.Base64;
 
 /**
- * An Authenticator and Valve implementation of HTTP BASIC 
Authentication, as outlined in RFC 2617: "HTTP
- * Authentication: Basic and Digest Access Authentication."
+ * An Authenticator and Valve implementation of HTTP BASIC 
Authentication, as outlined in RFC 7617: "The
+ * 'Basic' HTTP Authentication Scheme"
  *
  * @author Craig R. McClanahan
  */


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 10.1.x updated: Update reference to RFC for BASIC authentication to RFC 7617

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new 59f552c31b Update reference to RFC for BASIC authentication to RFC 7617
59f552c31b is described below

commit 59f552c31b0b1a69462a5c08137662a56a5f45ac
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:04:15 2023 +

Update reference to RFC for BASIC authentication to RFC 7617
---
 java/org/apache/catalina/authenticator/BasicAuthenticator.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java 
b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index 3b8b26fb48..27ab6ec60d 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -32,8 +32,8 @@ import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.codec.binary.Base64;
 
 /**
- * An Authenticator and Valve implementation of HTTP BASIC 
Authentication, as outlined in RFC 2617: "HTTP
- * Authentication: Basic and Digest Access Authentication."
+ * An Authenticator and Valve implementation of HTTP BASIC 
Authentication, as outlined in RFC 7617: "The
+ * 'Basic' HTTP Authentication Scheme"
  *
  * @author Craig R. McClanahan
  */


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Update reference to RFC for BASIC authentication to RFC 7617

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new faaab45bcc Update reference to RFC for BASIC authentication to RFC 7617
faaab45bcc is described below

commit faaab45bcc88c1baa98a28a4ffc4d34b12314f43
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:04:15 2023 +

Update reference to RFC for BASIC authentication to RFC 7617
---
 java/org/apache/catalina/authenticator/BasicAuthenticator.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java 
b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index 103b7d3a0c..eb9e4dbc20 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -32,8 +32,8 @@ import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.codec.binary.Base64;
 
 /**
- * An Authenticator and Valve implementation of HTTP BASIC 
Authentication, as outlined in RFC 2617: "HTTP
- * Authentication: Basic and Digest Access Authentication."
+ * An Authenticator and Valve implementation of HTTP BASIC 
Authentication, as outlined in RFC 7617: "The
+ * 'Basic' HTTP Authentication Scheme"
  *
  * @author Craig R. McClanahan
  */


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 8.5.x updated: Update reference to RFC for BASIC authentication to RFC 7617

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 7efb3baf67 Update reference to RFC for BASIC authentication to RFC 7617
7efb3baf67 is described below

commit 7efb3baf6743f5b088a5fe2d5f11d9df7a3df644
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:04:15 2023 +

Update reference to RFC for BASIC authentication to RFC 7617
---
 java/org/apache/catalina/authenticator/BasicAuthenticator.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/BasicAuthenticator.java 
b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
index 103b7d3a0c..eb9e4dbc20 100644
--- a/java/org/apache/catalina/authenticator/BasicAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/BasicAuthenticator.java
@@ -32,8 +32,8 @@ import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.codec.binary.Base64;
 
 /**
- * An Authenticator and Valve implementation of HTTP BASIC 
Authentication, as outlined in RFC 2617: "HTTP
- * Authentication: Basic and Digest Access Authentication."
+ * An Authenticator and Valve implementation of HTTP BASIC 
Authentication, as outlined in RFC 7617: "The
+ * 'Basic' HTTP Authentication Scheme"
  *
  * @author Craig R. McClanahan
  */


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 10.1.x updated: Refactor code using MD5Encoder to use HexUtils.toHexString()

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new f3997773d3 Refactor code using MD5Encoder to use HexUtils.toHexString()
f3997773d3 is described below

commit f3997773d34df4150b0991c04c2f473d69ccbbca
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:35:31 2023 +

Refactor code using MD5Encoder to use HexUtils.toHexString()

Removes duplicate functionality.
---
 .../org/apache/catalina/authenticator/DigestAuthenticator.java |  8 
 java/org/apache/catalina/realm/RealmBase.java  |  6 +++---
 java/org/apache/catalina/servlets/WebdavServlet.java   |  4 ++--
 java/org/apache/tomcat/util/security/MD5Encoder.java   |  5 +
 java/org/apache/tomcat/websocket/DigestAuthenticator.java  |  4 ++--
 .../apache/catalina/authenticator/TestDigestAuthenticator.java |  4 ++--
 .../authenticator/TestSSOnonLoginAndDigestAuthenticator.java   |  4 ++--
 .../authenticator/TesterDigestAuthenticatorPerformance.java|  8 
 test/org/apache/catalina/realm/TestJNDIRealm.java  | 10 +-
 webapps/docs/changelog.xml |  4 
 10 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/DigestAuthenticator.java 
b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
index 9ef3dd8b40..247ea05d8c 100644
--- a/java/org/apache/catalina/authenticator/DigestAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
@@ -31,10 +31,10 @@ import org.apache.catalina.Realm;
 import org.apache.catalina.connector.Request;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.parser.Authorization;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
-import org.apache.tomcat.util.security.MD5Encoder;
 
 
 /**
@@ -296,7 +296,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 String ipTimeKey = request.getRemoteAddr() + ":" + currentTime + ":" + 
getKey();
 
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(ipTimeKey.getBytes(StandardCharsets.ISO_8859_1));
-String nonce = currentTime + ":" + MD5Encoder.encode(buffer);
+String nonce = currentTime + ":" + HexUtils.toHexString(buffer);
 
 NonceInfo info = new NonceInfo(currentTime, getNonceCountWindowSize());
 synchronized (nonces) {
@@ -539,7 +539,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 }
 String serverIpTimeKey = request.getRemoteAddr() + ":" + nonceTime 
+ ":" + key;
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(serverIpTimeKey.getBytes(StandardCharsets.ISO_8859_1));
-String md5ServerIpTimeKey = MD5Encoder.encode(buffer);
+String md5ServerIpTimeKey = HexUtils.toHexString(buffer);
 if (!md5ServerIpTimeKey.equals(md5clientIpTimeKey)) {
 return false;
 }
@@ -597,7 +597,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 String a2 = method + ":" + uri;
 
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(a2.getBytes(StandardCharsets.ISO_8859_1));
-String md5a2 = MD5Encoder.encode(buffer);
+String md5a2 = HexUtils.toHexString(buffer);
 
 return realm.authenticate(userName, response, nonce, nc, cnonce, 
qop, realmName, md5a2);
 }
diff --git a/java/org/apache/catalina/realm/RealmBase.java 
b/java/org/apache/catalina/realm/RealmBase.java
index 25149713ef..c55a64bc7c 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -52,11 +52,11 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.buf.B2CConverter;
+import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
-import org.apache.tomcat.util.security.MD5Encoder;
 import org.ietf.jgss.GSSContext;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
@@ -399,7 +399,7 @@ public abstract class RealmBase extends LifecycleMBeanBase 
implements Realm {
 uee);
 }
 
-String serverDigest = 
MD5Encoder.encode(ConcurrentMessageDigest.digestMD5(valueBytes));
+String serverDigest = 
HexUtils.toHexString(ConcurrentMessageDigest.digestMD5(valueBytes));
 
 if (log.isDeb

[tomcat] branch main updated: Refactor code using MD5Encoder to use HexUtils.toHexString()

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 5518441992 Refactor code using MD5Encoder to use HexUtils.toHexString()
5518441992 is described below

commit 5518441992c91353e639ba0790a805195257440a
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:35:31 2023 +

Refactor code using MD5Encoder to use HexUtils.toHexString()

Removes duplicate functionality.
---
 .../org/apache/catalina/authenticator/DigestAuthenticator.java |  8 
 java/org/apache/catalina/realm/RealmBase.java  |  6 +++---
 java/org/apache/catalina/servlets/WebdavServlet.java   |  4 ++--
 java/org/apache/tomcat/util/security/MD5Encoder.java   |  5 +
 java/org/apache/tomcat/websocket/DigestAuthenticator.java  |  4 ++--
 .../apache/catalina/authenticator/TestDigestAuthenticator.java |  4 ++--
 .../authenticator/TestSSOnonLoginAndDigestAuthenticator.java   |  4 ++--
 .../authenticator/TesterDigestAuthenticatorPerformance.java|  8 
 test/org/apache/catalina/realm/TestJNDIRealm.java  | 10 +-
 webapps/docs/changelog.xml |  4 
 10 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/DigestAuthenticator.java 
b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
index 9ef3dd8b40..247ea05d8c 100644
--- a/java/org/apache/catalina/authenticator/DigestAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
@@ -31,10 +31,10 @@ import org.apache.catalina.Realm;
 import org.apache.catalina.connector.Request;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.parser.Authorization;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
-import org.apache.tomcat.util.security.MD5Encoder;
 
 
 /**
@@ -296,7 +296,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 String ipTimeKey = request.getRemoteAddr() + ":" + currentTime + ":" + 
getKey();
 
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(ipTimeKey.getBytes(StandardCharsets.ISO_8859_1));
-String nonce = currentTime + ":" + MD5Encoder.encode(buffer);
+String nonce = currentTime + ":" + HexUtils.toHexString(buffer);
 
 NonceInfo info = new NonceInfo(currentTime, getNonceCountWindowSize());
 synchronized (nonces) {
@@ -539,7 +539,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 }
 String serverIpTimeKey = request.getRemoteAddr() + ":" + nonceTime 
+ ":" + key;
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(serverIpTimeKey.getBytes(StandardCharsets.ISO_8859_1));
-String md5ServerIpTimeKey = MD5Encoder.encode(buffer);
+String md5ServerIpTimeKey = HexUtils.toHexString(buffer);
 if (!md5ServerIpTimeKey.equals(md5clientIpTimeKey)) {
 return false;
 }
@@ -597,7 +597,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 String a2 = method + ":" + uri;
 
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(a2.getBytes(StandardCharsets.ISO_8859_1));
-String md5a2 = MD5Encoder.encode(buffer);
+String md5a2 = HexUtils.toHexString(buffer);
 
 return realm.authenticate(userName, response, nonce, nc, cnonce, 
qop, realmName, md5a2);
 }
diff --git a/java/org/apache/catalina/realm/RealmBase.java 
b/java/org/apache/catalina/realm/RealmBase.java
index 25149713ef..c55a64bc7c 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -52,11 +52,11 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.buf.B2CConverter;
+import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
-import org.apache.tomcat.util.security.MD5Encoder;
 import org.ietf.jgss.GSSContext;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
@@ -399,7 +399,7 @@ public abstract class RealmBase extends LifecycleMBeanBase 
implements Realm {
 uee);
 }
 
-String serverDigest = 
MD5Encoder.encode(ConcurrentMessageDigest.digestMD5(valueBytes));
+String serverDigest = 
HexUtils.toHexString(ConcurrentMessageDigest.digestMD5(valueBytes));
 
 if (log.isDebugEn

[tomcat] branch 9.0.x updated: Refactor code using MD5Encoder to use HexUtils.toHexString()

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new f5ef9fc3d3 Refactor code using MD5Encoder to use HexUtils.toHexString()
f5ef9fc3d3 is described below

commit f5ef9fc3d308f7cd1798bfea60f66f75e0236181
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:35:31 2023 +

Refactor code using MD5Encoder to use HexUtils.toHexString()

Removes duplicate functionality.
---
 .../org/apache/catalina/authenticator/DigestAuthenticator.java |  8 
 java/org/apache/catalina/realm/RealmBase.java  |  6 +++---
 java/org/apache/catalina/servlets/WebdavServlet.java   |  4 ++--
 java/org/apache/tomcat/util/security/MD5Encoder.java   |  5 +
 java/org/apache/tomcat/websocket/DigestAuthenticator.java  |  4 ++--
 .../apache/catalina/authenticator/TestDigestAuthenticator.java |  4 ++--
 .../authenticator/TestSSOnonLoginAndDigestAuthenticator.java   |  4 ++--
 .../authenticator/TesterDigestAuthenticatorPerformance.java|  8 
 test/org/apache/catalina/realm/TestJNDIRealm.java  | 10 +-
 webapps/docs/changelog.xml |  4 
 10 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/DigestAuthenticator.java 
b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
index 5588119787..bb2504a9df 100644
--- a/java/org/apache/catalina/authenticator/DigestAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
@@ -31,10 +31,10 @@ import org.apache.catalina.Realm;
 import org.apache.catalina.connector.Request;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.parser.Authorization;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
-import org.apache.tomcat.util.security.MD5Encoder;
 
 
 /**
@@ -296,7 +296,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 String ipTimeKey = request.getRemoteAddr() + ":" + currentTime + ":" + 
getKey();
 
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(ipTimeKey.getBytes(StandardCharsets.ISO_8859_1));
-String nonce = currentTime + ":" + MD5Encoder.encode(buffer);
+String nonce = currentTime + ":" + HexUtils.toHexString(buffer);
 
 NonceInfo info = new NonceInfo(currentTime, getNonceCountWindowSize());
 synchronized (nonces) {
@@ -539,7 +539,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 }
 String serverIpTimeKey = request.getRemoteAddr() + ":" + nonceTime 
+ ":" + key;
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(serverIpTimeKey.getBytes(StandardCharsets.ISO_8859_1));
-String md5ServerIpTimeKey = MD5Encoder.encode(buffer);
+String md5ServerIpTimeKey = HexUtils.toHexString(buffer);
 if (!md5ServerIpTimeKey.equals(md5clientIpTimeKey)) {
 return false;
 }
@@ -597,7 +597,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 String a2 = method + ":" + uri;
 
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(a2.getBytes(StandardCharsets.ISO_8859_1));
-String md5a2 = MD5Encoder.encode(buffer);
+String md5a2 = HexUtils.toHexString(buffer);
 
 return realm.authenticate(userName, response, nonce, nc, cnonce, 
qop, realmName, md5a2);
 }
diff --git a/java/org/apache/catalina/realm/RealmBase.java 
b/java/org/apache/catalina/realm/RealmBase.java
index b68ae6100a..0e245f36f5 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -52,11 +52,11 @@ import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.IntrospectionUtils;
 import org.apache.tomcat.util.buf.B2CConverter;
+import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
-import org.apache.tomcat.util.security.MD5Encoder;
 import org.ietf.jgss.GSSContext;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
@@ -399,7 +399,7 @@ public abstract class RealmBase extends LifecycleMBeanBase 
implements Realm {
 uee);
 }
 
-String serverDigest = 
MD5Encoder.encode(ConcurrentMessageDigest.digestMD5(valueBytes));
+String serverDigest = 
HexUtils.toHexString(ConcurrentMessageDigest.digestMD5(valueBytes));
 
 if (log.isDebug

[tomcat] branch 8.5.x updated: Refactor code using MD5Encoder to use HexUtils.toHexString()

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new fdb651d604 Refactor code using MD5Encoder to use HexUtils.toHexString()
fdb651d604 is described below

commit fdb651d604c1ce5507ee96998cbba612db66cf70
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:35:31 2023 +

Refactor code using MD5Encoder to use HexUtils.toHexString()

Removes duplicate functionality.
---
 .../org/apache/catalina/authenticator/DigestAuthenticator.java |  8 
 java/org/apache/catalina/realm/RealmBase.java  |  5 ++---
 java/org/apache/catalina/servlets/WebdavServlet.java   |  4 ++--
 java/org/apache/tomcat/util/security/MD5Encoder.java   |  5 +
 java/org/apache/tomcat/websocket/DigestAuthenticator.java  |  4 ++--
 .../apache/catalina/authenticator/TestDigestAuthenticator.java |  5 ++---
 .../authenticator/TestSSOnonLoginAndDigestAuthenticator.java   |  5 ++---
 .../authenticator/TesterDigestAuthenticatorPerformance.java|  8 
 test/org/apache/catalina/realm/TestJNDIRealm.java  | 10 +-
 webapps/docs/changelog.xml |  4 
 10 files changed, 32 insertions(+), 26 deletions(-)

diff --git a/java/org/apache/catalina/authenticator/DigestAuthenticator.java 
b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
index 5588119787..bb2504a9df 100644
--- a/java/org/apache/catalina/authenticator/DigestAuthenticator.java
+++ b/java/org/apache/catalina/authenticator/DigestAuthenticator.java
@@ -31,10 +31,10 @@ import org.apache.catalina.Realm;
 import org.apache.catalina.connector.Request;
 import org.apache.juli.logging.Log;
 import org.apache.juli.logging.LogFactory;
+import org.apache.tomcat.util.buf.HexUtils;
 import org.apache.tomcat.util.buf.MessageBytes;
 import org.apache.tomcat.util.http.parser.Authorization;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
-import org.apache.tomcat.util.security.MD5Encoder;
 
 
 /**
@@ -296,7 +296,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 String ipTimeKey = request.getRemoteAddr() + ":" + currentTime + ":" + 
getKey();
 
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(ipTimeKey.getBytes(StandardCharsets.ISO_8859_1));
-String nonce = currentTime + ":" + MD5Encoder.encode(buffer);
+String nonce = currentTime + ":" + HexUtils.toHexString(buffer);
 
 NonceInfo info = new NonceInfo(currentTime, getNonceCountWindowSize());
 synchronized (nonces) {
@@ -539,7 +539,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 }
 String serverIpTimeKey = request.getRemoteAddr() + ":" + nonceTime 
+ ":" + key;
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(serverIpTimeKey.getBytes(StandardCharsets.ISO_8859_1));
-String md5ServerIpTimeKey = MD5Encoder.encode(buffer);
+String md5ServerIpTimeKey = HexUtils.toHexString(buffer);
 if (!md5ServerIpTimeKey.equals(md5clientIpTimeKey)) {
 return false;
 }
@@ -597,7 +597,7 @@ public class DigestAuthenticator extends AuthenticatorBase {
 String a2 = method + ":" + uri;
 
 byte[] buffer = 
ConcurrentMessageDigest.digestMD5(a2.getBytes(StandardCharsets.ISO_8859_1));
-String md5a2 = MD5Encoder.encode(buffer);
+String md5a2 = HexUtils.toHexString(buffer);
 
 return realm.authenticate(userName, response, nonce, nc, cnonce, 
qop, realmName, md5a2);
 }
diff --git a/java/org/apache/catalina/realm/RealmBase.java 
b/java/org/apache/catalina/realm/RealmBase.java
index a0262be710..84d40c8143 100644
--- a/java/org/apache/catalina/realm/RealmBase.java
+++ b/java/org/apache/catalina/realm/RealmBase.java
@@ -56,7 +56,6 @@ import 
org.apache.tomcat.util.descriptor.web.SecurityCollection;
 import org.apache.tomcat.util.descriptor.web.SecurityConstraint;
 import org.apache.tomcat.util.res.StringManager;
 import org.apache.tomcat.util.security.ConcurrentMessageDigest;
-import org.apache.tomcat.util.security.MD5Encoder;
 import org.ietf.jgss.GSSContext;
 import org.ietf.jgss.GSSCredential;
 import org.ietf.jgss.GSSException;
@@ -400,7 +399,7 @@ public abstract class RealmBase extends LifecycleMBeanBase 
implements org.apache
 throw new IllegalArgumentException(uee.getMessage());
 }
 
-String serverDigest = 
MD5Encoder.encode(ConcurrentMessageDigest.digestMD5(valueBytes));
+String serverDigest = 
HexUtils.toHexString(ConcurrentMessageDigest.digestMD5(valueBytes));
 
 if (log.isDebugEnabled()) {
 log.debug("Digest : " + clientDigest + " Username:" + username + " 
ClientDigest:" + clientDigest +
@@ -1140,7 +1139,7 @@ public abstract class RealmBase ext

[tomcat] branch main updated: Remove deprecated code

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 11574ef85f Remove deprecated code
11574ef85f is described below

commit 11574ef85f43b42b9e09a01bc37fd8da491c01b5
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:39:41 2023 +

Remove deprecated code
---
 .../apache/tomcat/util/security/MD5Encoder.java| 70 --
 1 file changed, 70 deletions(-)

diff --git a/java/org/apache/tomcat/util/security/MD5Encoder.java 
b/java/org/apache/tomcat/util/security/MD5Encoder.java
deleted file mode 100644
index c42f3e3403..00
--- a/java/org/apache/tomcat/util/security/MD5Encoder.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.tomcat.util.security;
-
-import org.apache.tomcat.util.buf.HexUtils;
-
-/**
- * Encode an MD5 digest into a String.
- * 
- * The 128 bit MD5 hash is converted into a 32 character long String.
- * Each character of the String is the hexadecimal representation of 4 bits
- * of the digest.
- *
- * @author Remy Maucherat
- *
- * @deprecated Unused. Use {@link HexUtils} instead. Will be removed in Tomcat 
11.
- */
-@Deprecated
-public final class MD5Encoder {
-
-
-private MD5Encoder() {
-// Hide default constructor for utility class
-}
-
-
-private static final char[] hexadecimal = {'0', '1', '2', '3', '4', '5',
-'6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
-
-
-/**
- * Encodes the 128 bit (16 bytes) MD5 into a 32 character String.
- *
- * @param binaryData Array containing the digest
- *
- * @return Encoded MD5, or null if encoding failed
- */
-public static String encode(byte[] binaryData) {
-
-if (binaryData.length != 16) {
-return null;
-}
-
-char[] buffer = new char[32];
-
-for (int i=0; i<16; i++) {
-int low = binaryData[i] & 0x0f;
-int high = (binaryData[i] & 0xf0) >> 4;
-buffer[i*2] = hexadecimal[high];
-buffer[i*2 + 1] = hexadecimal[low];
-}
-
-return new String(buffer);
-}
-}
-


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch main updated: Delete unused terms

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new 39f66e45ee Delete unused terms
39f66e45ee is described below

commit 39f66e45eec9adf25b91298909115e55f809ada5
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:41:21 2023 +

Delete unused terms
---
 java/org/apache/tomcat/util/security/LocalStrings.properties   | 3 ---
 java/org/apache/tomcat/util/security/LocalStrings_fr.properties| 3 ---
 java/org/apache/tomcat/util/security/LocalStrings_ja.properties| 3 ---
 java/org/apache/tomcat/util/security/LocalStrings_ko.properties| 3 ---
 java/org/apache/tomcat/util/security/LocalStrings_zh_CN.properties | 3 ---
 5 files changed, 15 deletions(-)

diff --git a/java/org/apache/tomcat/util/security/LocalStrings.properties 
b/java/org/apache/tomcat/util/security/LocalStrings.properties
index 39e92df46d..577cd38463 100644
--- a/java/org/apache/tomcat/util/security/LocalStrings.properties
+++ b/java/org/apache/tomcat/util/security/LocalStrings.properties
@@ -14,6 +14,3 @@
 # limitations under the License.
 
 concurrentMessageDigest.noDigest=Digest algorithm unavailable
-
-privilegedSetAccessControlContext.lookupFailed=Unable to obtain reference to 
field Thread.inheritedAccessControlContext
-privilegedSetAccessControlContext.setFailed=Unable to set field 
Thread.inheritedAccessControlContext
diff --git a/java/org/apache/tomcat/util/security/LocalStrings_fr.properties 
b/java/org/apache/tomcat/util/security/LocalStrings_fr.properties
index 79bf7f886d..3a1f0324dd 100644
--- a/java/org/apache/tomcat/util/security/LocalStrings_fr.properties
+++ b/java/org/apache/tomcat/util/security/LocalStrings_fr.properties
@@ -14,6 +14,3 @@
 # limitations under the License.
 
 concurrentMessageDigest.noDigest=L'algorithme de digest est introuvable
-
-privilegedSetAccessControlContext.lookupFailed=Impossible d'obtenir une 
référence pour le champ Thread.inheritedAccessControlContext
-privilegedSetAccessControlContext.setFailed=Impossible de fixer la valeur du 
champ Thread.inheritedAccessControlContext
diff --git a/java/org/apache/tomcat/util/security/LocalStrings_ja.properties 
b/java/org/apache/tomcat/util/security/LocalStrings_ja.properties
index 5ae31f866b..19c3c69e97 100644
--- a/java/org/apache/tomcat/util/security/LocalStrings_ja.properties
+++ b/java/org/apache/tomcat/util/security/LocalStrings_ja.properties
@@ -14,6 +14,3 @@
 # limitations under the License.
 
 concurrentMessageDigest.noDigest=ダイジェストアルゴリズムを利用できません。
-
-privilegedSetAccessControlContext.lookupFailed=フィールド 
Thread.inheritedAccessControlContext への参照を取得できません
-privilegedSetAccessControlContext.setFailed=フィールド 
Thread.inheritedAccessControlContext を設定できません
diff --git a/java/org/apache/tomcat/util/security/LocalStrings_ko.properties 
b/java/org/apache/tomcat/util/security/LocalStrings_ko.properties
index 24fba21205..b9761265c7 100644
--- a/java/org/apache/tomcat/util/security/LocalStrings_ko.properties
+++ b/java/org/apache/tomcat/util/security/LocalStrings_ko.properties
@@ -14,6 +14,3 @@
 # limitations under the License.
 
 concurrentMessageDigest.noDigest=Digest 알고리즘이 가용하지 않습니다.
-
-privilegedSetAccessControlContext.lookupFailed=Thread.inheritedAccessControlContext
 필드를 참조할 수 없습니다.
-privilegedSetAccessControlContext.setFailed=Thread.inheritedAccessControlContext
 필드를 설정할 수 없습니다.
diff --git a/java/org/apache/tomcat/util/security/LocalStrings_zh_CN.properties 
b/java/org/apache/tomcat/util/security/LocalStrings_zh_CN.properties
index bc021bbf9f..7864aaf1e1 100644
--- a/java/org/apache/tomcat/util/security/LocalStrings_zh_CN.properties
+++ b/java/org/apache/tomcat/util/security/LocalStrings_zh_CN.properties
@@ -14,6 +14,3 @@
 # limitations under the License.
 
 concurrentMessageDigest.noDigest=摘要算法不可用
-
-privilegedSetAccessControlContext.lookupFailed=无法获取对字段 
Thread.inheritedAccessControlContext 的引用
-privilegedSetAccessControlContext.setFailed=无法设置字段 
Thread.inheritedAccessControlContext


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[tomcat] branch 9.0.x updated: Fix IDE warnings

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
 new 0229e5905e Fix IDE warnings
0229e5905e is described below

commit 0229e5905efe0a43fa2f54c67ccaf1e094728724
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:45:58 2023 +

Fix IDE warnings
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 46 +++---
 java/org/apache/tomcat/util/json/JSONFilter.java   |  6 +--
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index cd48cfceb2..2a56d1763e 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -68,28 +68,28 @@ public class JsonAccessLogValve extends AccessLogValve {
 static {
 // FIXME: finalize attribute names
 Map pattern2AttributeName = new HashMap<>();
-pattern2AttributeName.put('a', "remoteAddr");
-pattern2AttributeName.put('A', "localAddr");
-pattern2AttributeName.put('b', "size"); /* byteSent -> size */
-pattern2AttributeName.put('B', "byteSentNC");
-pattern2AttributeName.put('D', "elapsedTime");
-pattern2AttributeName.put('F', "firstByteTime");
-pattern2AttributeName.put('h', "host");
-pattern2AttributeName.put('H', "protocol");
-pattern2AttributeName.put('l', "logicalUserName");
-pattern2AttributeName.put('m', "method");
-pattern2AttributeName.put('p', "port");
-pattern2AttributeName.put('q', "query");
-pattern2AttributeName.put('r', "request");
-pattern2AttributeName.put('s', "statusCode");
-pattern2AttributeName.put('S', "sessionId");
-pattern2AttributeName.put('t', "time"); /* dateTime -> time */
-pattern2AttributeName.put('T', "elapsedTimeS");
-pattern2AttributeName.put('u', "user");
-pattern2AttributeName.put('U', "path"); /* requestURI -> path */
-pattern2AttributeName.put('v', "localServerName");
-pattern2AttributeName.put('I', "threadName");
-pattern2AttributeName.put('X', "connectionStatus");
+pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr");
+pattern2AttributeName.put(Character.valueOf('A'), "localAddr");
+pattern2AttributeName.put(Character.valueOf('b'), "size"); /* byteSent 
-> size */
+pattern2AttributeName.put(Character.valueOf('B'), "byteSentNC");
+pattern2AttributeName.put(Character.valueOf('D'), "elapsedTime");
+pattern2AttributeName.put(Character.valueOf('F'), "firstByteTime");
+pattern2AttributeName.put(Character.valueOf('h'), "host");
+pattern2AttributeName.put(Character.valueOf('H'), "protocol");
+pattern2AttributeName.put(Character.valueOf('l'), "logicalUserName");
+pattern2AttributeName.put(Character.valueOf('m'), "method");
+pattern2AttributeName.put(Character.valueOf('p'), "port");
+pattern2AttributeName.put(Character.valueOf('q'), "query");
+pattern2AttributeName.put(Character.valueOf('r'), "request");
+pattern2AttributeName.put(Character.valueOf('s'), "statusCode");
+pattern2AttributeName.put(Character.valueOf('S'), "sessionId");
+pattern2AttributeName.put(Character.valueOf('t'), "time"); /* dateTime 
-> time */
+pattern2AttributeName.put(Character.valueOf('T'), "elapsedTimeS");
+pattern2AttributeName.put(Character.valueOf('u'), "user");
+pattern2AttributeName.put(Character.valueOf('U'), "path"); /* 
requestURI -> path */
+pattern2AttributeName.put(Character.valueOf('v'), "localServerName");
+pattern2AttributeName.put(Character.valueOf('I'), "threadName");
+pattern2AttributeName.put(Character.valueOf('X'), "connectionStatus");
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
@@ -117,7 +117,7 @@ public class JsonAccessLogValve extends AccessLogValve {
 @Override
 protected AccessLogElement createAccessLogElement(char pattern) {
 AccessLogElement ale = super.createAccessLogElement(pattern);
-String attributeName = PATTERNS.get(pattern);
+String attributeName = PATTERNS.get(Character.valueOf(pattern));
 if (attributeName == null) {
 attributeName = "other-" + new String(JSONFilter.escape(pattern));
 }
diff --git a/java/org/apache/tomcat/util/json/JSONFilter.java 
b/java/org/apache/tomcat/util/json/JSONFilter.java
index 43c23f331b..176867407d 100644
--- a/java/org/apache/tomcat/util/json/JSONFilter.java
+++ b/java/org/apache/tomcat/util/json/JSONFilter.java
@@ -29,8 +29,7 @@ public class JSONFilter {
  * @return a char array with the escaped sequence
  */
 public static c

[tomcat] branch main updated: Fix IDE warnings

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
 new fc9272fe5a Fix IDE warnings
fc9272fe5a is described below

commit fc9272fe5ac58d7d770ed5838fb2a5b7d381bc3d
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:45:58 2023 +

Fix IDE warnings
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 46 +++---
 java/org/apache/tomcat/util/json/JSONFilter.java   |  6 +--
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index cd48cfceb2..2a56d1763e 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -68,28 +68,28 @@ public class JsonAccessLogValve extends AccessLogValve {
 static {
 // FIXME: finalize attribute names
 Map pattern2AttributeName = new HashMap<>();
-pattern2AttributeName.put('a', "remoteAddr");
-pattern2AttributeName.put('A', "localAddr");
-pattern2AttributeName.put('b', "size"); /* byteSent -> size */
-pattern2AttributeName.put('B', "byteSentNC");
-pattern2AttributeName.put('D', "elapsedTime");
-pattern2AttributeName.put('F', "firstByteTime");
-pattern2AttributeName.put('h', "host");
-pattern2AttributeName.put('H', "protocol");
-pattern2AttributeName.put('l', "logicalUserName");
-pattern2AttributeName.put('m', "method");
-pattern2AttributeName.put('p', "port");
-pattern2AttributeName.put('q', "query");
-pattern2AttributeName.put('r', "request");
-pattern2AttributeName.put('s', "statusCode");
-pattern2AttributeName.put('S', "sessionId");
-pattern2AttributeName.put('t', "time"); /* dateTime -> time */
-pattern2AttributeName.put('T', "elapsedTimeS");
-pattern2AttributeName.put('u', "user");
-pattern2AttributeName.put('U', "path"); /* requestURI -> path */
-pattern2AttributeName.put('v', "localServerName");
-pattern2AttributeName.put('I', "threadName");
-pattern2AttributeName.put('X', "connectionStatus");
+pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr");
+pattern2AttributeName.put(Character.valueOf('A'), "localAddr");
+pattern2AttributeName.put(Character.valueOf('b'), "size"); /* byteSent 
-> size */
+pattern2AttributeName.put(Character.valueOf('B'), "byteSentNC");
+pattern2AttributeName.put(Character.valueOf('D'), "elapsedTime");
+pattern2AttributeName.put(Character.valueOf('F'), "firstByteTime");
+pattern2AttributeName.put(Character.valueOf('h'), "host");
+pattern2AttributeName.put(Character.valueOf('H'), "protocol");
+pattern2AttributeName.put(Character.valueOf('l'), "logicalUserName");
+pattern2AttributeName.put(Character.valueOf('m'), "method");
+pattern2AttributeName.put(Character.valueOf('p'), "port");
+pattern2AttributeName.put(Character.valueOf('q'), "query");
+pattern2AttributeName.put(Character.valueOf('r'), "request");
+pattern2AttributeName.put(Character.valueOf('s'), "statusCode");
+pattern2AttributeName.put(Character.valueOf('S'), "sessionId");
+pattern2AttributeName.put(Character.valueOf('t'), "time"); /* dateTime 
-> time */
+pattern2AttributeName.put(Character.valueOf('T'), "elapsedTimeS");
+pattern2AttributeName.put(Character.valueOf('u'), "user");
+pattern2AttributeName.put(Character.valueOf('U'), "path"); /* 
requestURI -> path */
+pattern2AttributeName.put(Character.valueOf('v'), "localServerName");
+pattern2AttributeName.put(Character.valueOf('I'), "threadName");
+pattern2AttributeName.put(Character.valueOf('X'), "connectionStatus");
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
@@ -117,7 +117,7 @@ public class JsonAccessLogValve extends AccessLogValve {
 @Override
 protected AccessLogElement createAccessLogElement(char pattern) {
 AccessLogElement ale = super.createAccessLogElement(pattern);
-String attributeName = PATTERNS.get(pattern);
+String attributeName = PATTERNS.get(Character.valueOf(pattern));
 if (attributeName == null) {
 attributeName = "other-" + new String(JSONFilter.escape(pattern));
 }
diff --git a/java/org/apache/tomcat/util/json/JSONFilter.java 
b/java/org/apache/tomcat/util/json/JSONFilter.java
index 43c23f331b..176867407d 100644
--- a/java/org/apache/tomcat/util/json/JSONFilter.java
+++ b/java/org/apache/tomcat/util/json/JSONFilter.java
@@ -29,8 +29,7 @@ public class JSONFilter {
  * @return a char array with the escaped sequence
  */
 public static cha

[tomcat] branch 10.1.x updated: Fix IDE warnings

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
 new eb11c5c6c2 Fix IDE warnings
eb11c5c6c2 is described below

commit eb11c5c6c27bdd7d570c6ab2e479700ebb47cfcf
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:45:58 2023 +

Fix IDE warnings
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 46 +++---
 java/org/apache/tomcat/util/json/JSONFilter.java   |  6 +--
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index cd48cfceb2..2a56d1763e 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -68,28 +68,28 @@ public class JsonAccessLogValve extends AccessLogValve {
 static {
 // FIXME: finalize attribute names
 Map pattern2AttributeName = new HashMap<>();
-pattern2AttributeName.put('a', "remoteAddr");
-pattern2AttributeName.put('A', "localAddr");
-pattern2AttributeName.put('b', "size"); /* byteSent -> size */
-pattern2AttributeName.put('B', "byteSentNC");
-pattern2AttributeName.put('D', "elapsedTime");
-pattern2AttributeName.put('F', "firstByteTime");
-pattern2AttributeName.put('h', "host");
-pattern2AttributeName.put('H', "protocol");
-pattern2AttributeName.put('l', "logicalUserName");
-pattern2AttributeName.put('m', "method");
-pattern2AttributeName.put('p', "port");
-pattern2AttributeName.put('q', "query");
-pattern2AttributeName.put('r', "request");
-pattern2AttributeName.put('s', "statusCode");
-pattern2AttributeName.put('S', "sessionId");
-pattern2AttributeName.put('t', "time"); /* dateTime -> time */
-pattern2AttributeName.put('T', "elapsedTimeS");
-pattern2AttributeName.put('u', "user");
-pattern2AttributeName.put('U', "path"); /* requestURI -> path */
-pattern2AttributeName.put('v', "localServerName");
-pattern2AttributeName.put('I', "threadName");
-pattern2AttributeName.put('X', "connectionStatus");
+pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr");
+pattern2AttributeName.put(Character.valueOf('A'), "localAddr");
+pattern2AttributeName.put(Character.valueOf('b'), "size"); /* byteSent 
-> size */
+pattern2AttributeName.put(Character.valueOf('B'), "byteSentNC");
+pattern2AttributeName.put(Character.valueOf('D'), "elapsedTime");
+pattern2AttributeName.put(Character.valueOf('F'), "firstByteTime");
+pattern2AttributeName.put(Character.valueOf('h'), "host");
+pattern2AttributeName.put(Character.valueOf('H'), "protocol");
+pattern2AttributeName.put(Character.valueOf('l'), "logicalUserName");
+pattern2AttributeName.put(Character.valueOf('m'), "method");
+pattern2AttributeName.put(Character.valueOf('p'), "port");
+pattern2AttributeName.put(Character.valueOf('q'), "query");
+pattern2AttributeName.put(Character.valueOf('r'), "request");
+pattern2AttributeName.put(Character.valueOf('s'), "statusCode");
+pattern2AttributeName.put(Character.valueOf('S'), "sessionId");
+pattern2AttributeName.put(Character.valueOf('t'), "time"); /* dateTime 
-> time */
+pattern2AttributeName.put(Character.valueOf('T'), "elapsedTimeS");
+pattern2AttributeName.put(Character.valueOf('u'), "user");
+pattern2AttributeName.put(Character.valueOf('U'), "path"); /* 
requestURI -> path */
+pattern2AttributeName.put(Character.valueOf('v'), "localServerName");
+pattern2AttributeName.put(Character.valueOf('I'), "threadName");
+pattern2AttributeName.put(Character.valueOf('X'), "connectionStatus");
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
@@ -117,7 +117,7 @@ public class JsonAccessLogValve extends AccessLogValve {
 @Override
 protected AccessLogElement createAccessLogElement(char pattern) {
 AccessLogElement ale = super.createAccessLogElement(pattern);
-String attributeName = PATTERNS.get(pattern);
+String attributeName = PATTERNS.get(Character.valueOf(pattern));
 if (attributeName == null) {
 attributeName = "other-" + new String(JSONFilter.escape(pattern));
 }
diff --git a/java/org/apache/tomcat/util/json/JSONFilter.java 
b/java/org/apache/tomcat/util/json/JSONFilter.java
index 43c23f331b..176867407d 100644
--- a/java/org/apache/tomcat/util/json/JSONFilter.java
+++ b/java/org/apache/tomcat/util/json/JSONFilter.java
@@ -29,8 +29,7 @@ public class JSONFilter {
  * @return a char array with the escaped sequence
  */
 public static

[tomcat] branch 8.5.x updated: Fix IDE warnings

2023-03-03 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
 new 0df94e05b0 Fix IDE warnings
0df94e05b0 is described below

commit 0df94e05b0bd2420c22036717fcb38191f23c127
Author: Mark Thomas 
AuthorDate: Fri Mar 3 14:45:58 2023 +

Fix IDE warnings
---
 .../apache/catalina/valves/JsonAccessLogValve.java | 46 +++---
 java/org/apache/tomcat/util/json/JSONFilter.java   |  6 +--
 2 files changed, 25 insertions(+), 27 deletions(-)

diff --git a/java/org/apache/catalina/valves/JsonAccessLogValve.java 
b/java/org/apache/catalina/valves/JsonAccessLogValve.java
index aae85b824f..c2564f9778 100644
--- a/java/org/apache/catalina/valves/JsonAccessLogValve.java
+++ b/java/org/apache/catalina/valves/JsonAccessLogValve.java
@@ -68,28 +68,28 @@ public class JsonAccessLogValve extends AccessLogValve {
 static {
 // FIXME: finalize attribute names
 Map pattern2AttributeName = new HashMap<>();
-pattern2AttributeName.put('a', "remoteAddr");
-pattern2AttributeName.put('A', "localAddr");
-pattern2AttributeName.put('b', "size"); /* byteSent -> size */
-pattern2AttributeName.put('B', "byteSentNC");
-pattern2AttributeName.put('D', "elapsedTime");
-pattern2AttributeName.put('F', "firstByteTime");
-pattern2AttributeName.put('h', "host");
-pattern2AttributeName.put('H', "protocol");
-pattern2AttributeName.put('l', "logicalUserName");
-pattern2AttributeName.put('m', "method");
-pattern2AttributeName.put('p', "port");
-pattern2AttributeName.put('q', "query");
-pattern2AttributeName.put('r', "request");
-pattern2AttributeName.put('s', "statusCode");
-pattern2AttributeName.put('S', "sessionId");
-pattern2AttributeName.put('t', "time"); /* dateTime -> time */
-pattern2AttributeName.put('T', "elapsedTimeS");
-pattern2AttributeName.put('u', "user");
-pattern2AttributeName.put('U', "path"); /* requestURI -> path */
-pattern2AttributeName.put('v', "localServerName");
-pattern2AttributeName.put('I', "threadName");
-pattern2AttributeName.put('X', "connectionStatus");
+pattern2AttributeName.put(Character.valueOf('a'), "remoteAddr");
+pattern2AttributeName.put(Character.valueOf('A'), "localAddr");
+pattern2AttributeName.put(Character.valueOf('b'), "size"); /* byteSent 
-> size */
+pattern2AttributeName.put(Character.valueOf('B'), "byteSentNC");
+pattern2AttributeName.put(Character.valueOf('D'), "elapsedTime");
+pattern2AttributeName.put(Character.valueOf('F'), "firstByteTime");
+pattern2AttributeName.put(Character.valueOf('h'), "host");
+pattern2AttributeName.put(Character.valueOf('H'), "protocol");
+pattern2AttributeName.put(Character.valueOf('l'), "logicalUserName");
+pattern2AttributeName.put(Character.valueOf('m'), "method");
+pattern2AttributeName.put(Character.valueOf('p'), "port");
+pattern2AttributeName.put(Character.valueOf('q'), "query");
+pattern2AttributeName.put(Character.valueOf('r'), "request");
+pattern2AttributeName.put(Character.valueOf('s'), "statusCode");
+pattern2AttributeName.put(Character.valueOf('S'), "sessionId");
+pattern2AttributeName.put(Character.valueOf('t'), "time"); /* dateTime 
-> time */
+pattern2AttributeName.put(Character.valueOf('T'), "elapsedTimeS");
+pattern2AttributeName.put(Character.valueOf('u'), "user");
+pattern2AttributeName.put(Character.valueOf('U'), "path"); /* 
requestURI -> path */
+pattern2AttributeName.put(Character.valueOf('v'), "localServerName");
+pattern2AttributeName.put(Character.valueOf('I'), "threadName");
+pattern2AttributeName.put(Character.valueOf('X'), "connectionStatus");
 PATTERNS = Collections.unmodifiableMap(pattern2AttributeName);
 }
 
@@ -129,7 +129,7 @@ public class JsonAccessLogValve extends AccessLogValve {
 @Override
 protected AccessLogElement createAccessLogElement(char pattern) {
 AccessLogElement ale = super.createAccessLogElement(pattern);
-String attributeName = PATTERNS.get(pattern);
+String attributeName = PATTERNS.get(Character.valueOf(pattern));
 if (attributeName == null) {
 attributeName = "other-" + new String(JSONFilter.escape(pattern));
 }
diff --git a/java/org/apache/tomcat/util/json/JSONFilter.java 
b/java/org/apache/tomcat/util/json/JSONFilter.java
index 43c23f331b..176867407d 100644
--- a/java/org/apache/tomcat/util/json/JSONFilter.java
+++ b/java/org/apache/tomcat/util/json/JSONFilter.java
@@ -29,8 +29,7 @@ public class JSONFilter {
  * @return a char array with the escaped sequence
  */
 public static c

[VOTE][RESULT] Release Apache Tomcat 8.5.87

2023-03-03 Thread Christopher Schultz

All,

The following votes were cast:

Binding:
+1 kkolinko, markt, schultz

No other votes were cast.

The vote therefore passes.

Thanks to everyone who contributed toward this release.

-chris

On 2/27/23 15:11, Christopher Schultz wrote:

The proposed Apache Tomcat 8.5.87 release is now available for voting.

The notable changes compared to 8.5.86 are:

  - Correct a regression introduced in the fix for bug 66196 that
    meant that the HTTP headers and/or request line could get
    corrupted (one part overwriting another part) within a single
    request.

  - Provide a more appropriate response (501 rather than 400) when
    rejecting an HTTP request using the CONNECT method.

  - Add support for txt: and rnd: rewrite map types from mod_rewrite.
    Based on a pull request provided by Dimitrios Soumis.

Along with lots of other bug fixes and improvements.

For full details, see the changelog:
https://nightlies.apache.org/tomcat/tomcat-8.5.x/docs/changelog.html

It can be obtained from:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-8/v8.5.87/

The Maven staging repo is:
https://repository.apache.org/content/repositories/orgapachetomcat-1424

The tag is:
https://github.com/apache/tomcat/tree/8.5.87/
9179f3c22aead8702936eace5c46e8860b644b3c

The proposed 8.5.87 release is:
[ ] Broken - do not release
[ ] Stable - go ahead and release as 8.5.87 (stable)

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[VOTE][RESULT] Release Apache Tomcat 10.1.7

2023-03-03 Thread Christopher Schultz

All,

The following votes were cast:

Binding:
+1 remm, markt, schultz, kkolinko

Non-binding:
+1 lihan, Dimitris Soumis

No other votes were cast.

The vote therefore passes.

Thanks to everyone who contributed toward this release.

-chris

On 2/27/23 15:56, Christopher Schultz wrote:

The proposed Apache Tomcat 10.1.7 release is now available for
voting.

The notable changes compared to 10.1.6 are:

  - Revert the switch to using the ServiceLoader mechanism to load the
    custom URL protocol handlers that Tomcat uses. The original system
    property based approach has been restored.

  - Restore inline state after async operation in NIO2, to account the
    fact that unexpected exceptions are sometimes thrown by the
    implementation. Patch submitted by zhougang.

  - Provide a more appropriate response (501 rather than 400) when
    rejecting an HTTP request using the CONNECT method.

  - Add support for txt: and rnd: rewrite map types from mod_rewrite.
    Based on a pull request provided by Dimitrios Soumis.

For full details, see the change log:
https://nightlies.apache.org/tomcat/tomcat-10.1.x/docs/changelog.html

Applications that run on Tomcat 9 and earlier will not run on Tomcat 10 
without changes. Java EE applications designed for Tomcat 9 and earlier 
may be placed in the $CATALINA_BASE/webapps-javaee directory and Tomcat 
will automatically convert them to Jakarta EE and copy them to the 
webapps directory.


It can be obtained from:
https://dist.apache.org/repos/dist/dev/tomcat/tomcat-10/v10.1.7/

The Maven staging repo is:
https://repository.apache.org/content/repositories/orgapachetomcat-1426

The tag is:
https://github.com/apache/tomcat/tree/10.1.7
473ef42c637c97eb17b38c5580a6b854dfe27a02

The proposed 10.1.7 release is:
[ ] Broken - do not release
[ ] Stable - go ahead and release as 10.1.7


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r60438 - /dev/tomcat/tomcat-10/v10.1.7/ /release/tomcat/tomcat-10/v10.1.7/

2023-03-03 Thread schultz
Author: schultz
Date: Sat Mar  4 00:12:43 2023
New Revision: 60438

Log:
Promote r10.1.7 to released.

Added:
release/tomcat/tomcat-10/v10.1.7/
  - copied from r60437, dev/tomcat/tomcat-10/v10.1.7/
Removed:
dev/tomcat/tomcat-10/v10.1.7/


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r60439 - /dev/tomcat/tomcat-8/v8.5.87/ /release/tomcat/tomcat-8/v8.5.87/

2023-03-03 Thread schultz
Author: schultz
Date: Sat Mar  4 00:13:05 2023
New Revision: 60439

Log:
Promote r8.5.87 to released.

Added:
release/tomcat/tomcat-8/v8.5.87/
  - copied from r60438, dev/tomcat/tomcat-8/v8.5.87/
Removed:
dev/tomcat/tomcat-8/v8.5.87/


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



[Bug 66508] New: Tomcat after a GC pause causes the HTTP threads to be blocked to acquire a semaphore to process WebSockets connection closure.

2023-03-03 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66508

Bug ID: 66508
   Summary: Tomcat after a GC pause causes the HTTP threads to be
blocked to acquire a semaphore to process WebSockets
connection closure.
   Product: Tomcat 8
   Version: Tomcat 8.5.84
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: WebSocket
  Assignee: dev@tomcat.apache.org
  Reporter: mvssrmur...@gmail.com
  Target Milestone: 

For this issue to happen there are three events that need to happen and they
are listed below:

Event 1. Tomcat is going through a GC Pause.
Event 2. WebSocket connection at the client is closed (not processed by the
tomcat as it is going through a GC pause)
Event 3. Tomcat is trying to write a message on the same connection as above
but has not started as the tomcat is going through a pause.

Event 2 happens on an HTTP thread (In the below stack trace it is
http-nio2-8082-exec-7) and Event 3 happens on a background thread
(pool-12-thread-1).

If Event 3 happens before Event 2, then the semaphore acquired by the event 3
thread is not released and the event 2 thread is blocked for a duration of
org.apache.tomcat.websocket.BLOCKING_SEND_TIMEOUT (default value is 20
seconds). If I am not wrong event 3 thread never releases the semaphore.

If there are 5000 connections on a Tomcat and all going through the above
issue, causes all the Tomcat HTTP thread pools to stuck for a long duration not
processing any incoming HTTP requests. In a way, each tomcat HTTP thread tries
to process the socket close and waits to acquire the semaphore for 20 seconds.
With a thread pool of 50, and 5000 connections then it takes 100 * 20 Seconds
(default time out) = 2000 seconds = 33.33 Minutes.


In our environment, we are using CometD (https://cometd.org/) to support
transport independent client-to-server and server-to-client communication via
Bayeux protocol. This protocol sends heartbeat messages every 30 seconds to
detect the availability of both parties. If the server does not respond within
30 seconds + 10 seconds (Configurable grace period) the client considers the
server is not available and re-connects by opening a new connection and closing
the old one. Due to a GC Pause at the server, the client won't receive a
heartbeat message within a certain interval and is closing the connection. The
server when it processes this socket close message writes a response back to
the client about it (not sure why it is needed or even if it is needed why it
is trying to acquire semaphore with max waiting for
org.apache.tomcat.websocket.BLOCKING_SEND_TIMEOUT).

Please review below stack traces. The main issue is http-ni02-8082-exec-7
thread is trying to acquire a semaphore for 20 seconds and pool-12-thread-1
trying to write a message never releases the lock. My debugging points out that
the pool-12-thread-1 in our environment is doing a nonblocking write and for
some reason, this never completes and never calls to release the semaphore.

Let me know if you need any further information.

Event 2 Stack Trace:

"http-nio2-8082-exec-7" #112 daemon prio=5 os_prio=31 tid=0x7fc9c07e9000
nid=0x1f403 waiting on condition [0x78eb7000]
   java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for  <0x000748319390> (a
java.util.concurrent.Semaphore$NonfairSync)
at
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(AbstractQueuedSynchronizer.java:1037)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(AbstractQueuedSynchronizer.java:1328)
at java.util.concurrent.Semaphore.tryAcquire(Semaphore.java:409)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:299)
at
org.apache.tomcat.websocket.WsRemoteEndpointImplBase.sendMessageBlock(WsRemoteEndpointImplBase.java:262)
at
org.apache.tomcat.websocket.WsSession.sendCloseMessage(WsSession.java:816)
at org.apache.tomcat.websocket.WsSession.onClose(WsSession.java:739)
- locked <0x00074831a820> (a java.lang.Object)
at
org.apache.tomcat.websocket.WsFrameBase.processDataControl(WsFrameBase.java:367)
at
org.apache.tomcat.websocket.WsFrameBase.processData(WsFrameBase.java:296)
at
org.apache.tomcat.websocket.WsFrameBase.processInputBuffer(WsFrameBase.java:133)
at
org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:85)
at
org.apache.tomcat.websocket.server.WsFrameServer.doOnDataAvailable(WsFrameServer.java:183)
at
org.apache.tomcat.websocket.server.WsFrameServer.notifyDataAvailable(WsFrameServer.java:162)
at
org.apache.tom

[Bug 66508] Tomcat after a GC pause causes the HTTP threads to be blocked to acquire a semaphore to process WebSockets connection closure.

2023-03-03 Thread bugzilla
https://bz.apache.org/bugzilla/show_bug.cgi?id=66508

--- Comment #1 from Venkata Manda  ---
In my below issue description, I mentioned the test environment java version is
1.8. The issue is reproducible with Java 11.

Based on my reading and analysis of the issue, any time a socket is closed at
the client and a thread at the server to send a message on that socket happens
before the socket close is processed can trigger this issue.

With GC Pause this issue is reproduced consistently.

Thanks.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org