oscerd commented on PR #28527:
URL: https://github.com/apache/camel/pull/28527#issuecomment-6477633103

   Thanks for the follow-up review. Both points are addressed in "CAMEL-26322: 
camel-as2 - write the IPv6 form of asyncMdnAllowedHosts in words, and bracket 
an IPv6 host in the warning".
   
   **1. The IPv6 example in the catalog and Endpoint DSL**
   
   Confirmed. The option description goes through 
`JavadocHelper.sanitizeDescription` (camel-tooling-util), which keeps only 
identifier characters and `.,-='/\!&%():;#${}`, and its `{@...}` unwrapping 
pattern does not match `[::1]`. So `{@code [::1]}` can only come out as `{code 
::1}`: run through the sanitizer, the old text gives exactly what the head 
carried.
   
   - The `asyncMdnAllowedHosts` javadoc no longer uses bracket characters: 
"Each entry is a host with an optional port in host:port form; an IPv6 literal 
is written in square brackets, as in a URL, optionally followed by :port." I 
ran the whole new description through `sanitizeDescription` before the regen, 
and it comes out unchanged.
   - Both `as2.json` copies and `AS2EndpointBuilderFactory` are regenerated 
from it by the full reactor, with no hand edits.
   - The literal examples stay in the pages that are not generated from the 
javadoc. The upgrade-guide note keeps `[::1]` / `[::1]:8443` unchanged, as it 
was already right. `as2-component.adoc` had no example, so it gets a short 
"Delivering asynchronous MDNs" section that lists the entry forms with `[::1]` 
and `[::1]:8443`, and notes that an unbracketed `::1:8443` is read as another 
IPv6 address, not as `::1` with a port. The catalog copy of the page is 
regenerated.
   
   **2. The warning prints `::1:8443`**
   
   Applied. The warning now writes the authority through a small 
package-private helper, `formatAuthority(host, port)`. A host that contains `:` 
(after `normalizeHost`, only an IPv6 literal) is put back in square brackets, 
so the warning logs `[::1]:8443`; any other host is written as `host:port`. 
Only the log text changes: `isAllowedAuthority` and `authorityMatches` are 
untouched.
   
   The new test `theWarningNamesTheAuthorityAsAnAllowListEntry` in 
`AS2AsynchronousMDNManagerDeliveryAddressTest` checks both forms. It also 
checks that each printed entry, once listed in `asyncMdnAllowedHosts`, matches 
the authority it was written for. Without the brackets it fails with `expected: 
<[::1]:8443> but was: <::1:8443>`. It tests the helper rather than the log 
line: reaching the warning needs a live connection, and for the IPv6 case a 
listener on `::1`, which not every CI host has.
   
   **Tests** (local, JDK 21): camel-as2-api 119 tests; camel-as2-component 45 
unit tests (1 manual test skipped) and 112 integration tests in 11 classes; no 
failures. The full reactor (`clean install -DskipTests -DskipITs`) passes, and 
the files it regenerated (both `as2.json` copies, the Endpoint DSL and the 
catalog copy of `as2-component.adoc`) are in the commit.
   
   _Claude Code on behalf of oscerd_
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to