cstamas commented on code in PR #14173:
URL: https://github.com/apache/maven/pull/14173#discussion_r4728982293
##########
maven-settings-builder/src/test/java/org/apache/maven/settings/validation/DefaultSettingsValidatorTest.java:
##########
@@ -321,6 +321,33 @@ void
testValidateServerRepositoryOriginWithPlaceholderIsNotValidated() {
assertEquals(0, problems.messages.size());
}
+ @Test
+ void testValidateServerBearerTokenWithUsernameIsWarnedAbout() {
+ assertEquals(0, validateBearerToken("token", null,
null).messages.size());
+ assertEquals(0, validateBearerToken(null, "user",
"pwd").messages.size());
+
+ SimpleProblemCollector problems = validateBearerToken("token", "user",
null);
+ assertEquals(1, problems.messages.size());
+ assertContains(
+ problems.messages.get(0),
+ "'servers.server[0].bearerToken' for server-1 is set together
with username and/or password");
+ assertEquals(1, validateBearerToken("token", null,
"pwd").messages.size());
Review Comment:
Taken in 9298093f7c, adapted to the API after 912af7af73 (`bearerToken`
became `token` + `tokenHeader`). The case with no header and both username and
password set is now asserted explicitly. The explicit `Authorization` header
and custom-header (`Private-Token`) variants were already covered.
##########
pom.xml:
##########
@@ -146,7 +146,7 @@ under the License.
<!-- plexus-cipher 2.1.0 uses an incompatible KDF; ciphertext encrypted
with 2.0 will no longer decrypt — see #12811. Do not bump on this branch. -->
<cipherVersion>2.0</cipherVersion>
<jxpathVersion>1.4.0</jxpathVersion>
- <resolverVersion>2.0.26</resolverVersion>
+ <resolverVersion>2.0.27-SNAPSHOT</resolverVersion>
Review Comment:
Acknowledged. This tracks apache/maven-resolver#2372, and `resolverVersion`
will be switched to `2.0.27` once it is released, before merge. Note that #2372
now also carries the token-header rework this PR builds on since 912af7af73.
--
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]