rmannibucau commented on code in PR #14173:
URL: https://github.com/apache/maven/pull/14173#discussion_r4729093821
##########
maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java:
##########
@@ -384,6 +385,11 @@ public RepositorySystemSession.SessionBuilder
newRepositorySessionBuilder(MavenE
AuthenticationBuilder authBuilder = new AuthenticationBuilder();
authBuilder.addUsername(server.getUsername()).addPassword(server.getPassword());
authBuilder.addPrivateKey(server.getPrivateKey(),
server.getPassphrase());
+ if (server.getTokenHeader() == null ||
server.getTokenHeader().isEmpty()) {
Review Comment:
empty is a valid use case IMHO
##########
apache-maven/src/conf/settings.xml:
##########
@@ -131,6 +131,18 @@ under the License.
<passphrase>optional; leave empty if not used.</passphrase>
</server>
-->
+
+ <!-- Another sample, using a token to authenticate (HTTP transports only,
not Wagon).
+ | Without tokenHeader the token is sent as "Authorization: Bearer
<token>", and username and
+ | password are ignored. With tokenHeader it is sent as is in that header,
for example
+ | Private-Token, Job-Token or Deploy-Token for GitLab.
+ |
+ <server>
+ <id>tokenServer</id>
+ <token>token</token>
Review Comment:
why making it specific, we already have
```xml
<property>
<name>Authorization</name>
<value>Bearer xxxx</value>
</property>
```
in httpHeaders which avoids to have two inconsistent cases using `token`
(bearer and a do what you want as schema case)
so literally we are just aliasing what is already there in terms of
configuration so I would remove that
--
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]