slachiewicz commented on PR #902:
URL: https://github.com/apache/maven-wagon/pull/902#issuecomment-5227233931

   Both review comments were right; fixed in the last commit, and the branch is 
rebased onto
   current `wagon-3.x` so it picks up the Sisu shim from #913 (it was failing 
the
   `drop-legacy-dependencies` enforcer before that).
   
   **The agent guard.** The constructor references did defeat it. A constructor 
reference
   resolves its class when the reference is *evaluated*, and that happens at 
the call site in
   `agentIdentityRepository()` — outside the `try` in `identitiesFrom`. So a 
missing connector
   class threw `NoClassDefFoundError` straight past the catch, which is exactly 
what the
   javadoc claimed could not happen. I checked it rather than argued about it:
   
   ```
   methodref: ESCAPED the guard: NoClassDefFoundError
   lambda   : caught: NoClassDefFoundError
   ```
   
   Written as `() -> new SSHAgentConnector()` the class is not mentioned until 
the lambda body
   runs, which is inside the guard. The javadoc now says why the form matters.
   
   **The key preference.** Also right, and it matters here because this branch 
targets Java 8.
   The JDK grew EdDSA in Java 15; before that JSch needs a provider such as 
Bouncy Castle,
   which is not a dependency. The base `SignatureEdDSA` in the JSch jar states 
it outright —
   `"SignatureEdDSA requires Java15+."` — so on Java 8 a stray `id_ed25519` 
would be selected
   and fail even with a usable `id_rsa` beside it.
   
   I demoted it rather than skipping it. Skipping outright would break the case 
where
   `id_ed25519` is the *only* key present, which is a real one for 
`wagon-ssh-external`: the
   host's own `scp` does the cryptography there, so the JVM's capabilities say 
nothing about
   whether the key works. Three unit tests cover both orderings and the 
still-offered case, so
   they run on any JDK rather than only on one.
   
   Full reactor green, and `-Dssh-tests -Dssh-embedded=true` still gives 42 
tests, 0 failures.


-- 
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